0
|
1 using System;
|
|
2 using System.Configuration;
|
|
3
|
|
4 using BLToolkit.Data.DataProvider;
|
|
5
|
|
6 namespace BLToolkit.Configuration
|
|
7 {
|
|
8 internal class DataProviderElement : ElementBase
|
|
9 {
|
|
10 protected static readonly ConfigurationProperty _propTypeName = new ConfigurationProperty("type", typeof(string), string.Empty, ConfigurationPropertyOptions.IsRequired);
|
|
11 protected static readonly ConfigurationProperty _propName = new ConfigurationProperty("name", typeof(string), string.Empty, ConfigurationPropertyOptions.None);
|
|
12 protected static readonly ConfigurationProperty _propDefault = new ConfigurationProperty("default", typeof(bool), false, ConfigurationPropertyOptions.None);
|
|
13
|
|
14 public DataProviderElement()
|
|
15 {
|
|
16 _properties.Add(_propTypeName);
|
|
17 _properties.Add(_propName);
|
|
18 _properties.Add(_propDefault);
|
|
19 }
|
|
20
|
|
21 /// <summary>
|
|
22 /// Gets or sets an assembly qualified type name of this data provider.
|
|
23 /// </summary>
|
|
24 public string TypeName
|
|
25 {
|
|
26 get { return (string)base[_propTypeName]; }
|
|
27 }
|
|
28
|
|
29 /// <summary>
|
|
30 /// Gets or sets a name of this data provider.
|
|
31 /// If not set, <see cref="DataProviderBase.Name"/> is used.
|
|
32 /// </summary>
|
|
33 public string Name
|
|
34 {
|
|
35 get { return (string)base[_propName]; }
|
|
36 }
|
|
37
|
|
38 /// <summary>
|
|
39 /// Gets a value indicating whether the provider is default.
|
|
40 /// </summary>
|
|
41 public bool Default
|
|
42 {
|
|
43 get { return (bool)base[_propDefault]; }
|
|
44 }
|
|
45 }
|
|
46 } |