File: SettingsProperty.cs

package info (click to toggle)
mono 6.8.0.105%2Bdfsg-3.3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,284,512 kB
  • sloc: cs: 11,172,132; xml: 2,850,069; ansic: 671,653; cpp: 122,091; perl: 59,366; javascript: 30,841; asm: 22,168; makefile: 20,093; sh: 15,020; python: 4,827; pascal: 925; sql: 859; sed: 16; php: 1
file content (83 lines) | stat: -rw-r--r-- 4,094 bytes parent folder | download | duplicates (7)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//------------------------------------------------------------------------------
// <copyright file="SettingsProperty.cs" company="Microsoft">
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//------------------------------------------------------------------------------

namespace System.Configuration {
    using  System.Collections;
    using  System.Collections.Specialized;
    using  System.Runtime.Serialization;
    using  System.Configuration.Provider;
    using  System.Globalization;
    using  System.IO;
    using System.Runtime.Serialization.Formatters.Binary;
    using System.Xml.Serialization;
    using System.ComponentModel;

   ////////////////////////////////////////////////////////////
   ////////////////////////////////////////////////////////////
   ////////////////////////////////////////////////////////////
   public class SettingsProperty {

       public virtual string Name          { get { return _Name; } set { _Name = value; } }
       public virtual bool IsReadOnly { get { return _IsReadOnly; } set { _IsReadOnly = value; } }
       public virtual object DefaultValue { get { return _DefaultValue; } set { _DefaultValue = value; } }
       public virtual Type PropertyType { get { return _PropertyType; } set { _PropertyType = value; } }
       public virtual SettingsSerializeAs SerializeAs { get { return _SerializeAs; } set { _SerializeAs = value; } }
       public virtual SettingsProvider Provider { get { return _Provider; } set { _Provider = value; } }
       public virtual SettingsAttributeDictionary Attributes { get { return _Attributes; } }
       public bool ThrowOnErrorDeserializing { get { return _ThrowOnErrorDeserializing; } set { _ThrowOnErrorDeserializing = value; } }
       public bool ThrowOnErrorSerializing { get { return _ThrowOnErrorSerializing; } set { _ThrowOnErrorSerializing = value; } }

       ////////////////////////////////////////////////////////////
       ////////////////////////////////////////////////////////////
       public SettingsProperty(string name) 
       {
           _Name = name;
           _Attributes = new SettingsAttributeDictionary();
       }

       public SettingsProperty(string name, Type propertyType, SettingsProvider provider, 
                               bool isReadOnly, object defaultValue, SettingsSerializeAs serializeAs, 
                               SettingsAttributeDictionary attributes,
                               bool throwOnErrorDeserializing, bool throwOnErrorSerializing) 
       {
           _Name = name;
           _PropertyType = propertyType;
           _Provider = provider;
           _IsReadOnly = isReadOnly;
           _DefaultValue = defaultValue;
           _SerializeAs = serializeAs;
           _Attributes = attributes;
           _ThrowOnErrorDeserializing = throwOnErrorDeserializing;
           _ThrowOnErrorSerializing = throwOnErrorSerializing;
       }


       ////////////////////////////////////////////////////////////
       ////////////////////////////////////////////////////////////
       public SettingsProperty(SettingsProperty propertyToCopy) 
       {
           _Name = propertyToCopy.Name;
           _IsReadOnly = propertyToCopy.IsReadOnly;
           _DefaultValue = propertyToCopy.DefaultValue;
           _SerializeAs = propertyToCopy.SerializeAs;
           _Provider = propertyToCopy.Provider;
           _PropertyType = propertyToCopy.PropertyType;
           _ThrowOnErrorDeserializing = propertyToCopy.ThrowOnErrorDeserializing;
           _ThrowOnErrorSerializing = propertyToCopy.ThrowOnErrorSerializing;
           _Attributes = new SettingsAttributeDictionary(propertyToCopy.Attributes);
       }

       private string _Name;
       private bool _IsReadOnly;
       private object _DefaultValue;
       private SettingsSerializeAs _SerializeAs;
       private SettingsProvider _Provider;
       private SettingsAttributeDictionary _Attributes;
       private Type _PropertyType;
       private bool _ThrowOnErrorDeserializing;
       private bool _ThrowOnErrorSerializing;
   }
}