| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //
- // System.Diagnostics.Switch.cs
- //
- // Author:
- // John R. Hicks ([email protected])
- //
- // (C) 2001
- //
- namespace System.Diagnostics
- {
- /// <summary>
- /// Abstract base class to create new debugging and tracing switches
- /// </summary>
- public abstract class Switch
- {
- private string desc = "";
- private string display_name = "";
- private int iSwitch;
- // ================= Constructors ===================
- /// <summary>
- /// Initialize a new instance
- /// </summary>
- protected Switch(string displayName, string description)
- {
- display_name = displayName;
- desc = description;
- }
- /// <summary>
- /// Allows an Object to attempt to free resources and
- /// perform cleanup before the Object is reclaimed
- /// by the Garbage Collector
- /// </summary>
- ~Switch()
- {
- }
- // ================ Instance Methods ================
- // ==================== Properties ==================
- /// <summary>
- /// Returns a description of the switch
- /// </summary>
- public string Description
- {
- get
- {
- return desc;
- }
- }
- /// <summary>
- /// Returns a name used to identify the switch
- /// </summary>
- public string DisplayName
- {
- get
- {
- return display_name;
- }
- }
- /// <summary>
- /// Gets or sets the current setting for this switch
- /// </summary>
- protected int SwitchSetting
- {
- get
- {
- return iSwitch;
- }
- set
- {
- if(iSwitch != value)
- {
- iSwitch = value;
- OnSwitchSettingChanged();
- }
- }
- }
- /// <summary>
- /// Raises the SwitchSettingChanged event
- /// </summary>
- protected virtual void OnSwitchSettingChanged()
- {
- // TODO: implement me
- }
- }
- }
|