-
Notifications
You must be signed in to change notification settings - Fork 4
/
Settings.ascx.cs
28 lines (25 loc) · 1004 Bytes
/
Settings.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System.Linq;
using CompanyName.ModuleName.Components.Common;
using DotNetNuke.Entities.Modules;
namespace CompanyName.ModuleName
{
public partial class Settings : ModuleSettingsBase
{
public override void LoadSettings()
{
string[] views = System.IO.Directory.
GetFiles(Server.MapPath(ControlPath + "Views/"), "*.ascx").
Select(x => x.Substring(x.LastIndexOf("\\") + 1)).
Where(x => !x.Contains("NoSettings.ascx")).
ToArray();
ddlViews.DataSource = views;
ddlViews.DataBind();
ddlViews.SelectedValue = Settings.ContainsKey(CustomSettings.Keys.View.ToString()) ? (string)Settings[CustomSettings.Keys.View.ToString()] : "";
}
public override void UpdateSettings()
{
var mc = new ModuleController();
mc.UpdateModuleSetting(ModuleId, CustomSettings.Keys.View.ToString(), ddlViews.SelectedValue);
}
}
}