// Constructs a LogSwitch. A LogSwitch is used to categorize log messages. // // All switches (except for the global LogSwitch) have a parent LogSwitch. // public LogSwitch(String name, String description, LogSwitch parent) { if (name != null && name.Length == 0) { throw new ArgumentOutOfRangeException(nameof(Name), Environment.GetResourceString("Argument_StringZeroLength")); } Contract.EndContractBlock(); if ((name != null) && (parent != null)) { strName = name; strDescription = description; iLevel = LoggingLevels.ErrorLevel; iOldLevel = iLevel; ParentSwitch = parent; Log.m_Hashtable.Add(strName, this); // Call into the EE to let it know about the creation of // this switch Log.AddLogSwitch(this); } else { throw new ArgumentNullException((name == null ? nameof(name) : nameof(parent))); } }
internal LogSwitch(string name, string description) { this.strName = name; this.strDescription = description; this.iLevel = LoggingLevels.ErrorLevel; this.iOldLevel = this.iLevel; this.ParentSwitch = (LogSwitch)null; Log.m_Hashtable.Add((object)this.strName, (object)this); Log.AddLogSwitch(this); }
internal LogSwitch(String name, String description) { strName = name; strDescription = description; iLevel = LoggingLevels.ErrorLevel; iOldLevel = iLevel; ParentSwitch = null; Log.m_Hashtable.Add(strName, this); // Call into the EE to let it know about the creation of // this switch Log.AddLogSwitch(this); }
internal LogSwitch(string name, string description) { this.strName = name; this.strDescription = description; this.iLevel = LoggingLevels.ErrorLevel; this.iOldLevel = this.iLevel; this.ParentSwitch = null; this.ChildSwitch = null; this.iNumChildren = 0; this.iChildArraySize = 0; Log.m_Hashtable.Add(this.strName, this); Log.AddLogSwitch(this); Log.iNumOfSwitches++; }
public LogSwitch(string name, string description, LogSwitch parent) { if (name != null && name.Length == 0) { throw new ArgumentOutOfRangeException("Name", Environment.GetResourceString("Argument_StringZeroLength")); } if (name == null || parent == null) { throw new ArgumentNullException(name == null ? "name" : "parent"); } this.strName = name; this.strDescription = description; this.iLevel = LoggingLevels.ErrorLevel; this.iOldLevel = this.iLevel; this.ParentSwitch = parent; Log.m_Hashtable.Add((object)this.strName, (object)this); Log.AddLogSwitch(this); }
internal LogSwitch(String name, String description) { strName = name; strDescription = description; iLevel = LoggingLevels.ErrorLevel; iOldLevel = iLevel; ParentSwitch = null; ChildSwitch = null; iNumChildren = 0; iChildArraySize = 0; Log.m_Hashtable.Add(strName, this); // Call into the EE to let it know about the creation of // this switch Log.AddLogSwitch(this); // update switch count Log.iNumOfSwitches++; }
// Constructs a LogSwitch. A LogSwitch is used to categorize log messages. // // All switches (except for the global LogSwitch) have a parent LogSwitch. // /// <include file='doc\LogSwitch.uex' path='docs/doc[@for="LogSwitch.LogSwitch"]/*' /> public LogSwitch(String name, String description, LogSwitch parent) { if ((name != null) && (parent != null)) { if (name.Length == 0) { throw new ArgumentOutOfRangeException( "Name", Environment.GetResourceString( "Namelength_0")); } strName = name; strDescription = description; iLevel = LoggingLevels.ErrorLevel; iOldLevel = iLevel; // update the parent switch to reflect this child switch parent.AddChildSwitch(this); ParentSwitch = parent; ChildSwitch = null; iNumChildren = 0; iChildArraySize = 0; Log.m_Hashtable.Add(strName, this); // Call into the EE to let it know about the creation of // this switch Log.AddLogSwitch(this); // update switch count Log.iNumOfSwitches++; } else { throw new ArgumentNullException((name == null ? "name" : "parent")); } }
public LogSwitch(string name, string description, LogSwitch parent) { if ((name != null) && (name.Length == 0)) { throw new ArgumentOutOfRangeException("Name", Environment.GetResourceString("Argument_StringZeroLength")); } if ((name == null) || (parent == null)) { throw new ArgumentNullException((name == null) ? "name" : "parent"); } this.strName = name; this.strDescription = description; this.iLevel = LoggingLevels.ErrorLevel; this.iOldLevel = this.iLevel; parent.AddChildSwitch(this); this.ParentSwitch = parent; this.ChildSwitch = null; this.iNumChildren = 0; this.iChildArraySize = 0; Log.m_Hashtable.Add(this.strName, this); Log.AddLogSwitch(this); Log.iNumOfSwitches++; }