90efcc258e8943ec1ed7e0d50565ae6f7ddace7a
[mono.git] / mcs / class / System / System.Diagnostics / Switch.cs
1 //
2 // System.Diagnostics.Switch.cs
3 //
4 // Author:
5 //      John R. Hicks  (angryjohn69@nc.rr.com)
6 //
7 // (C) 2001
8 //
9
10 namespace System.Diagnostics
11 {
12         /// <summary>
13         /// Abstract base class to create new debugging and tracing switches
14         /// </summary>
15         public abstract class Switch
16         {
17                     private string desc = "";
18                 private string display_name = "";
19                 private int iSwitch;
20
21                 // ================= Constructors ===================
22                 /// <summary>
23                 /// Initialize a new instance
24                 /// </summary>
25                 protected Switch(string displayName, string description)
26                 {
27                         display_name = displayName;
28                         desc = description;
29                 }
30
31                 /// <summary>
32                 /// Allows an Object to attempt to free resources and
33                 /// perform cleanup before the Object is reclaimed
34                 /// by the Garbage Collector
35                 /// </summary>
36                 ~Switch()
37                 {
38                 }
39
40                 // ================ Instance Methods ================
41
42                 // ==================== Properties ==================
43
44                 /// <summary>
45                 /// Returns a description of the switch
46                 /// </summary>
47                 public string Description
48                 {
49                         get
50                         {
51                                 return desc;
52                         }
53                 }
54
55                 /// <summary>
56                 /// Returns a name used to identify the switch
57                 /// </summary>
58                 public string DisplayName
59                 {
60                         get
61                         {
62                                 return display_name;
63                         }
64                 }
65
66                 /// <summary>
67                 /// Gets or sets the current setting for this switch
68                 /// </summary>
69                 protected int SwitchSetting
70                 {
71                         get
72                         {
73                                 return iSwitch;
74                         }
75                         set
76                         {
77                                                         if(iSwitch != value) 
78                                                         {
79                                                                 iSwitch = value;
80                                                                 OnSwitchSettingChanged();
81                                                         }
82                                                 }
83                                 }
84
85                 /// <summary>
86                 /// Raises the SwitchSettingChanged event
87                 /// </summary>
88                 [MonoTODO]
89                 protected virtual void OnSwitchSettingChanged()
90                 {
91                         // TODO: implement me
92                 }
93         }
94 }