PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/BlogEngine/DotNetSlave.BusinessLogic/Providers/BlogProviderSection.cs

#
C# | 69 lines | 43 code | 7 blank | 19 comment | 0 complexity | a0332b3c07aa69b965b8fa16f3715690 MD5 | raw file
 1namespace BlogEngine.Core.Providers
 2{
 3    using System.Configuration;
 4
 5    /// <summary>
 6    /// A configuration section for web.config.
 7    /// </summary>
 8    /// <remarks>
 9    /// In the config section you can specify the provider you 
10    ///     want to use for BlogEngine.NET.
11    /// </remarks>
12    public class BlogProviderSection : ConfigurationSection
13    {
14        #region Properties
15
16        /// <summary>
17        ///     Gets or sets the name of the default provider
18        /// </summary>
19        [StringValidator(MinLength = 1)]
20        [ConfigurationProperty("defaultProvider", DefaultValue = "XmlBlogProvider")]
21        public string DefaultProvider
22        {
23            get
24            {
25                return (string)base["defaultProvider"];
26            }
27
28            set
29            {
30                base["defaultProvider"] = value;
31            }
32        }
33
34        /// <summary>
35        /// Gets or sets the name of the file storage provider, defaults to the XmlBlogProvider if one is not specified
36        /// </summary>
37        /// <remarks>
38        /// This  attribute is not required, however allows for specifying different providers for various operations
39        /// </remarks>
40        [StringValidator(MinLength = 0)]
41        [ConfigurationProperty("fileStoreProvider", IsRequired = false, DefaultValue = "XmlBlogProvider")]
42        public string FileStoreProvider
43        {
44            get
45            {
46                return (string)base["fileStoreProvider"];
47            }
48
49            set
50            {
51                base["fileStoreProvider"] = value;
52            }
53        }
54
55        /// <summary>
56        ///     Gets a collection of registered providers.
57        /// </summary>
58        [ConfigurationProperty("providers")]
59        public ProviderSettingsCollection Providers
60        {
61            get
62            {
63                return (ProviderSettingsCollection)base["providers"];
64            }
65        }
66
67        #endregion
68    }
69}