| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- //
- // 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>
- [MonoTODO]
- protected virtual void OnSwitchSettingChanged()
- {
- // TODO: implement me
- }
- }
- }
|