System.Diagnostics.Log.AddLogSwitch C# (CSharp) Method

AddLogSwitch() private method

private AddLogSwitch ( LogSwitch logSwitch ) : void
logSwitch LogSwitch
return void
    	internal static extern void AddLogSwitch(LogSwitch logSwitch);
    	[MethodImplAttribute(MethodImplOptions.InternalCall)]

Usage Example

Beispiel #1
0
        // 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)));
            }
        }
All Usage Examples Of System.Diagnostics.Log::AddLogSwitch