Esempio n. 1
0
        /// <summary>
        /// Creates a new <see cref="LogEntry"/> that is a copy of the current instance.
        /// </summary>
        /// <remarks>
        /// If the dictionary contained in <see cref="ExtendedProperties"/> implements <see cref="ICloneable"/>, the resulting
        /// <see cref="LogEntry"/> will have its ExtendedProperties set by calling <c>Clone()</c>. Otherwise the resulting
        /// <see cref="LogEntry"/> will have its ExtendedProperties set to null.
        /// </remarks>
        /// <implements>ICloneable.Clone</implements>
        /// <returns>A new <c>LogEntry</c> that is a copy of the current instance.</returns>
        public object Clone()
        {
            WSLogEntry result = new WSLogEntry();

            result.Message  = this.Message;
            result.Category = this.Category;
            result.EventId  = this.EventId;
            result.Title    = this.Title;
            result.Severity = this.Severity;
            result.Priority = this.Priority;

            result.TimeStamp         = this.TimeStamp;
            result.MachineName       = this.MachineName;
            result.AppDomainName     = this.AppDomainName;
            result.ProcessId         = this.ProcessId;
            result.ProcessName       = this.ProcessName;
            result.ManagedThreadName = this.ManagedThreadName;

            result.ExtendedProperties = ToJaggedArray((Hashtable)(IDictionary)((ICloneable)extendedProperties).Clone());

            return(result);
        }
Esempio n. 2
0
 /// <summary>
 /// Write a new log entry as defined in the <see cref="WSLogEntry"/> parameter.
 /// </summary>
 /// <example>The following examples demonstrates use of the Write method using
 /// <code>
 /// LogEntry log = new LogEntry();
 /// log.Category = "MyCategory1";
 /// log.Message = "My message body";
 /// log.Severity = Severity.Error;
 /// log.Priority = 100;
 /// Logger.Write(log);</code></example>
 /// <param name="log">Log entry object to write.</param>
 public static void Write(WSLogEntry log)
 {
     Writer.Write(log.ToLogEntry());
 }
Esempio n. 3
0
 /// <summary>
 /// Write a new log entry as defined in the <see cref="WSLogEntry"/> parameter.
 /// </summary>
 /// <example>The following examples demonstrates use of the Write method using
 /// <code>
 /// LogEntry log = new LogEntry();
 /// log.Category = "MyCategory1";
 /// log.Message = "My message body";
 /// log.Severity = Severity.Error;
 /// log.Priority = 100;
 /// Logger.Write(log);</code></example>
 /// <param name="log">Log entry object to write.</param>
 public static void Write(WSLogEntry log)
 {
     Writer.Write(log.ToLogEntry());
 }
Esempio n. 4
0
        /// <summary>
        /// Creates a new <see cref="LogEntry"/> that is a copy of the current instance.
        /// </summary>
        /// <remarks>
        /// If the dictionary contained in <see cref="ExtendedProperties"/> implements <see cref="ICloneable"/>, the resulting
        /// <see cref="LogEntry"/> will have its ExtendedProperties set by calling <c>Clone()</c>. Otherwise the resulting
        /// <see cref="LogEntry"/> will have its ExtendedProperties set to null.
        /// </remarks>
        /// <implements>ICloneable.Clone</implements>
        /// <returns>A new <c>LogEntry</c> that is a copy of the current instance.</returns>
        public object Clone()
        {
            WSLogEntry result = new WSLogEntry();

            result.Message = this.Message;
            result.Category = this.Category;
            result.EventId = this.EventId;
            result.Title = this.Title;
            result.Severity = this.Severity;
            result.Priority = this.Priority;

            result.TimeStamp = this.TimeStamp;
            result.MachineName = this.MachineName;
            result.AppDomainName = this.AppDomainName;
            result.ProcessId = this.ProcessId;
            result.ProcessName = this.ProcessName;
            result.ManagedThreadName = this.ManagedThreadName;

               result.ExtendedProperties = ToJaggedArray((Hashtable)(IDictionary) ((ICloneable) extendedProperties).Clone());

            return result;
        }