PageRenderTime 27ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/BlogEngine/DotNetSlave.BusinessLogic/DataStore/ExtensionSettingsBehavior.cs

#
C# | 57 lines | 20 code | 6 blank | 31 comment | 0 complexity | ca1afbbcdd58606c78aaedd8f7efcc10 MD5 | raw file
 1namespace BlogEngine.Core.DataStore
 2{
 3    using BlogEngine.Core.Providers;
 4
 5    /// <summary>
 6    /// Incapsulates behavior for saving and retreaving
 7    ///     extension settings
 8    /// </summary>
 9    public class ExtensionSettingsBehavior : ISettingsBehavior
10    {
11        #region Implemented Interfaces
12
13        #region ISettingsBehavior
14
15        /// <summary>
16        /// Retreaves extension object from database or file system
17        /// </summary>
18        /// <param name="extensionType">
19        /// Extension Type
20        /// </param>
21        /// <param name="extensionId">
22        /// Extension ID
23        /// </param>
24        /// <returns>
25        /// Extension object as Stream
26        /// </returns>
27        public object GetSettings(ExtensionType extensionType, string extensionId)
28        {
29            return BlogService.LoadFromDataStore(extensionType, extensionId);
30        }
31
32        /// <summary>
33        /// Saves extension to database or file system
34        /// </summary>
35        /// <param name="extensionType">
36        /// Extension Type
37        /// </param>
38        /// <param name="extensionId">
39        /// Extension ID
40        /// </param>
41        /// <param name="settings">
42        /// Extension object
43        /// </param>
44        /// <returns>
45        /// True if saved
46        /// </returns>
47        public bool SaveSettings(ExtensionType extensionType, string extensionId, object settings)
48        {
49            BlogService.SaveToDataStore(extensionType, extensionId, settings);
50            return true;
51        }
52
53        #endregion
54
55        #endregion
56    }
57}