public EventSchemaTraceListener(string fileName, string name, int bufferSize, System.Diagnostics.TraceLogRetentionOption logRetentionOption, long maximumFileSize, int maximumNumberOfFiles)
 {
     this._bufferSize       = 0x8000;
     this._retention        = System.Diagnostics.TraceLogRetentionOption.SingleFileUnboundedSize;
     this._maxFileSize      = 0x9c4000L;
     this._maxNumberOfFiles = 2;
     this.m_lockObject      = new object();
     if (bufferSize < 0)
     {
         throw new ArgumentOutOfRangeException("bufferSize", System.SR.GetString("ArgumentOutOfRange_NeedNonNegNum"));
     }
     if ((logRetentionOption < System.Diagnostics.TraceLogRetentionOption.UnlimitedSequentialFiles) || (logRetentionOption > System.Diagnostics.TraceLogRetentionOption.SingleFileBoundedSize))
     {
         throw new ArgumentOutOfRangeException("logRetentionOption", System.SR.GetString("ArgumentOutOfRange_NeedValidLogRetention"));
     }
     base.Name     = name;
     this.fileName = fileName;
     if ((!string.IsNullOrEmpty(this.fileName) && (fileName[0] != Path.DirectorySeparatorChar)) && ((fileName[0] != Path.AltDirectorySeparatorChar) && !Path.IsPathRooted(fileName)))
     {
         this.fileName = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile), this.fileName);
     }
     this._retention  = logRetentionOption;
     this._bufferSize = bufferSize;
     this._SetMaxFileSize(maximumFileSize, false);
     this._SetMaxNumberOfFiles(maximumNumberOfFiles, false);
 }
 public EventSchemaTraceListener(string fileName, string name, int bufferSize, System.Diagnostics.TraceLogRetentionOption logRetentionOption, long maximumFileSize, int maximumNumberOfFiles)
 {
     this._bufferSize = 0x8000;
     this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileUnboundedSize;
     this._maxFileSize = 0x9c4000L;
     this._maxNumberOfFiles = 2;
     this.m_lockObject = new object();
     if (bufferSize < 0)
     {
         throw new ArgumentOutOfRangeException("bufferSize", System.SR.GetString("ArgumentOutOfRange_NeedNonNegNum"));
     }
     if ((logRetentionOption < System.Diagnostics.TraceLogRetentionOption.UnlimitedSequentialFiles) || (logRetentionOption > System.Diagnostics.TraceLogRetentionOption.SingleFileBoundedSize))
     {
         throw new ArgumentOutOfRangeException("logRetentionOption", System.SR.GetString("ArgumentOutOfRange_NeedValidLogRetention"));
     }
     base.Name = name;
     this.fileName = fileName;
     if ((!string.IsNullOrEmpty(this.fileName) && (fileName[0] != Path.DirectorySeparatorChar)) && ((fileName[0] != Path.AltDirectorySeparatorChar) && !Path.IsPathRooted(fileName)))
     {
         this.fileName = Path.Combine(Path.GetDirectoryName(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile), this.fileName);
     }
     this._retention = logRetentionOption;
     this._bufferSize = bufferSize;
     this._SetMaxFileSize(maximumFileSize, false);
     this._SetMaxNumberOfFiles(maximumNumberOfFiles, false);
 }
 public EventSchemaTraceListener(string fileName, string name, int bufferSize, System.Diagnostics.TraceLogRetentionOption logRetentionOption, long maximumFileSize) : this(fileName, name, bufferSize, logRetentionOption, maximumFileSize, 2)
 {
 }
 private void Init()
 {
     if (!this._initialized)
     {
         lock (this.m_lockObject)
         {
             if (!this._initialized)
             {
                 try
                 {
                     if (base.Attributes.ContainsKey("bufferSize"))
                     {
                         int num = int.Parse(base.Attributes["bufferSize"], CultureInfo.InvariantCulture);
                         if (num > 0)
                         {
                             this._bufferSize = num;
                         }
                     }
                     if (base.Attributes.ContainsKey("logRetentionOption"))
                     {
                         string strA = base.Attributes["logRetentionOption"];
                         if (string.Compare(strA, "SingleFileUnboundedSize", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileUnboundedSize;
                         }
                         else if (string.Compare(strA, "LimitedCircularFiles", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.LimitedCircularFiles;
                         }
                         else if (string.Compare(strA, "UnlimitedSequentialFiles", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.UnlimitedSequentialFiles;
                         }
                         else if (string.Compare(strA, "SingleFileBoundedSize", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileBoundedSize;
                         }
                         else if (string.Compare(strA, "LimitedSequentialFiles", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.LimitedSequentialFiles;
                         }
                         else
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileUnboundedSize;
                         }
                     }
                     if (base.Attributes.ContainsKey("maximumFileSize"))
                     {
                         long maximumFileSize = long.Parse(base.Attributes["maximumFileSize"], CultureInfo.InvariantCulture);
                         this._SetMaxFileSize(maximumFileSize, false);
                     }
                     if (base.Attributes.ContainsKey("maximumNumberOfFiles"))
                     {
                         int maximumNumberOfFiles = int.Parse(base.Attributes["maximumNumberOfFiles"], CultureInfo.InvariantCulture);
                         this._SetMaxNumberOfFiles(maximumNumberOfFiles, false);
                     }
                 }
                 catch (Exception)
                 {
                 }
                 finally
                 {
                     this._initialized = true;
                 }
             }
         }
     }
 }
 public EventSchemaTraceListener(string fileName, string name, int bufferSize, System.Diagnostics.TraceLogRetentionOption logRetentionOption) : this(fileName, name, bufferSize, logRetentionOption, 0x9c4000L)
 {
 }
예제 #6
0
 public EventSchemaTraceListener(string fileName, string name, int bufferSize, System.Diagnostics.TraceLogRetentionOption logRetentionOption, long maximumFileSize, int maximumNumberOfFiles)
 {
 }
예제 #7
0
 public EventSchemaTraceListener(string fileName, string name, int bufferSize, System.Diagnostics.TraceLogRetentionOption logRetentionOption)
 {
 }
 private void Init()
 {
     if (!this._initialized)
     {
         lock (this.m_lockObject)
         {
             if (!this._initialized)
             {
                 try
                 {
                     if (base.Attributes.ContainsKey("bufferSize"))
                     {
                         int num = int.Parse(base.Attributes["bufferSize"], CultureInfo.InvariantCulture);
                         if (num > 0)
                         {
                             this._bufferSize = num;
                         }
                     }
                     if (base.Attributes.ContainsKey("logRetentionOption"))
                     {
                         string strA = base.Attributes["logRetentionOption"];
                         if (string.Compare(strA, "SingleFileUnboundedSize", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileUnboundedSize;
                         }
                         else if (string.Compare(strA, "LimitedCircularFiles", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.LimitedCircularFiles;
                         }
                         else if (string.Compare(strA, "UnlimitedSequentialFiles", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.UnlimitedSequentialFiles;
                         }
                         else if (string.Compare(strA, "SingleFileBoundedSize", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileBoundedSize;
                         }
                         else if (string.Compare(strA, "LimitedSequentialFiles", StringComparison.OrdinalIgnoreCase) == 0)
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.LimitedSequentialFiles;
                         }
                         else
                         {
                             this._retention = System.Diagnostics.TraceLogRetentionOption.SingleFileUnboundedSize;
                         }
                     }
                     if (base.Attributes.ContainsKey("maximumFileSize"))
                     {
                         long maximumFileSize = long.Parse(base.Attributes["maximumFileSize"], CultureInfo.InvariantCulture);
                         this._SetMaxFileSize(maximumFileSize, false);
                     }
                     if (base.Attributes.ContainsKey("maximumNumberOfFiles"))
                     {
                         int maximumNumberOfFiles = int.Parse(base.Attributes["maximumNumberOfFiles"], CultureInfo.InvariantCulture);
                         this._SetMaxNumberOfFiles(maximumNumberOfFiles, false);
                     }
                 }
                 catch (Exception)
                 {
                 }
                 finally
                 {
                     this._initialized = true;
                 }
             }
         }
     }
 }