Repository navigation
Expand file tree
/
Copy pathSettingsBase.cs
More file actions
69 lines (58 loc) · 1.84 KB
/
Copy pathSettingsBase.cs
File metadata and controls
69 lines (58 loc) · 1.84 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
namespace BlogEngine.Core.DataStore
{
/// <summary>
/// Base class for extension settings
/// </summary>
public abstract class SettingsBase
{
#region Constants and Fields
/// <summary>
/// Initializes a new instance of the <see cref="SettingsBase"/> class.
/// </summary>
protected SettingsBase()
{
this.SettingId = string.Empty;
this.ExType = ExtensionType.Extension;
}
#endregion
#region Properties
/// <summary>
/// Gets or sets the type of extension (extension, widget or theme)
/// </summary>
public ExtensionType ExType { get; set; }
/// <summary>
/// Gets or sets the Setting ID
/// </summary>
public string SettingId { get; set; }
/// <summary>
/// Gets or sets the Settings behavior
/// </summary>
public ISettingsBehavior SettingsBehavior { get; set; }
#endregion
#region Public Methods
/// <summary>
/// Get settings object from data storage
/// </summary>
/// <returns>
/// Stream representing extension object
/// </returns>
public object GetSettings()
{
return this.SettingsBehavior.GetSettings(this.ExType, this.SettingId);
}
/// <summary>
/// Saves setting object to data storage
/// </summary>
/// <param name="settings">
/// Settings object
/// </param>
/// <returns>
/// True if saved
/// </returns>
public bool SaveSettings(object settings)
{
return this.SettingsBehavior.SaveSettings(this.ExType, this.SettingId, settings);
}
#endregion
}
}