当前位置: 首页>>代码示例>>C#>>正文


C# TraceOptions类代码示例

本文整理汇总了C#中TraceOptions的典型用法代码示例。如果您正苦于以下问题:C# TraceOptions类的具体用法?C# TraceOptions怎么用?C# TraceOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TraceOptions类属于命名空间,在下文中一共展示了TraceOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FlatFileTraceListenerData

 /// <summary>
 /// Initializes a named instance of <see cref="FlatFileTraceListenerData"/>.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="fileName">The file name.</param>
 /// <param name="header">The header.</param>
 /// <param name="footer">The footer.</param>
 /// <param name="formatterName">The formatter name.</param>
 /// <param name="traceOutputOptions">The trace options.</param>
 public FlatFileTraceListenerData(string name, string fileName, string header, string footer, string formatterName,
                 TraceOptions traceOutputOptions)
     : this(name, typeof(FlatFileTraceListener), fileName, formatterName, traceOutputOptions)
 {
     this.Header = header;
     this.Footer = footer;
 }
开发者ID:randylevy,项目名称:Samples,代码行数:16,代码来源:FlatFileTraceListenerData.cs

示例2: enableOption

 static void enableOption( string s )
 {
     switch(s) {
     case "-test":
         testOption = 1;
         break;
     case "-Test":
         testOption = 2;
         break;
     case "-dump":
         dumpCodeOption = true;
         break;
     case "-traceOps":
         traceOption |= TraceOptions.TraceOps;
         break;
     case "-traceCalls":
         traceOption |= TraceOptions.TraceCalls;
         break;
     case "-traceStack":
         traceOption |= TraceOptions.TraceStack;
         break;
     case "-traceAll":
         traceOption = (TraceOptions)255;
         break;
     default:
         Usage();
         break;
     }
 }
开发者ID:bradens,项目名称:uvc,代码行数:29,代码来源:Main.cs

示例3: DomainObject

		public DomainObject(string name, string surName, int numberProperty, TraceOptions enumProperty)
		{
			this.name = name;
			this.surName = surName;
			this.numberProperty = numberProperty;
			this.enumProperty = enumProperty;
		}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:7,代码来源:DomainObject.cs

示例4: Writer

 /// <summary>
 /// Initializes the traceHandlerStreamWriter object
 /// </summary>
 /// <param name="traceSource">Trace source that holds a set of handlers</param>
 /// <param name="filterLevels">The level of trace message filtered by trace listener</param>
 /// <param name="traceOptions">Trace data options that has to be written in the trace output</param>
 /// <param name="traceFileFormat">File format component for the handler</param>
 /// <param name="fileExtension">Extension of trace file name for each handler</param>
 public Writer(TraceSource traceSource, SourceLevels filterLevels, TraceOptions traceOptions, ITraceFileFormat traceFileFormat, string fileExtension = "txt")
 {
     this.traceSource = traceSource;
     this.filterLevels = filterLevels;
     this.traceOptions = traceOptions;
     this.traceFileFormat = traceFileFormat;
     this.fileExtension = fileExtension;
 }
开发者ID:krishnarajv,项目名称:Code,代码行数:16,代码来源:Writer.cs

示例5: BindingListener

 public BindingListener(TraceOptions options)
 {
     IsFirstWrite = true;
     PresentationTraceSources.Refresh();
     PresentationTraceSources.DataBindingSource.Listeners.Add(this);
     PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Error;
     TraceOutputOptions = options;
     DetermineInformationPropertyCount();
 }
开发者ID:Ktarianen,项目名称:s3pi-wrappers,代码行数:9,代码来源:BindingListener.cs

示例6: SetupFileTrace

 public static void SetupFileTrace(string filePath, TraceOptions options)
 {
     Trace.AutoFlush = true;
     Directory.CreateDirectory(Path.GetDirectoryName(filePath));
     FileStream fileStream = new FileStream(filePath, FileMode.OpenOrCreate);
     fileStream.Seek(0L, SeekOrigin.End);
     TextWriterTraceListener writerTraceListener = new TextWriterTraceListener((Stream)fileStream);
     writerTraceListener.TraceOutputOptions = options;
     Trace.Listeners.Add((TraceListener)writerTraceListener);
 }
开发者ID:kingpin2k,项目名称:MCS,代码行数:10,代码来源:TraceUtil.cs

示例7: SetTrace

        public static void SetTrace(SourceLevels level, TraceOptions options)
        {
            if (_listener == null)
              {
            _listener = new BindingErrorTraceListener();
            PresentationTraceSources.DataBindingSource.Listeners.Add(_listener);
              }

              _listener.TraceOutputOptions = options;
              PresentationTraceSources.DataBindingSource.Switch.Level = level;
        }
开发者ID:stevenh77,项目名称:SilverlightSamples,代码行数:11,代码来源:BindingErrorTraceListener.cs

示例8: RollingXmlTraceListenerData

 /// <summary>
 /// Initializes a new instance of the <see cref="RollingXmlTraceListenerData"/> class.
 /// </summary>
 /// <param name="name">The name for the configuration object.</param>
 /// <param name="traceOutputOptions">The trace options.</param>
 /// <param name="fileName"></param>
 /// <param name="rollSizeKB"></param>
 /// <param name="timeStampPattern"></param>
 /// <param name="rollFileExistsBehavior"></param>
 /// <param name="rollInterval"></param>
 public RollingXmlTraceListenerData(string name,
                                         string fileName,
                                         int rollSizeKB,
                                         string timeStampPattern,
                                         RollFileExistsBehavior rollFileExistsBehavior,
                                         RollInterval rollInterval,
                                         TraceOptions traceOutputOptions)
     : base(name, typeof(RollingXmlTraceListener), traceOutputOptions)
 {
     FileName = fileName;
     RollSizeKB = rollSizeKB;
     RollFileExistsBehavior = rollFileExistsBehavior;
     RollInterval = rollInterval;
     TimeStampPattern = timeStampPattern;
 }
开发者ID:randylevy,项目名称:Samples,代码行数:25,代码来源:RollingXmlTraceListenerData.cs

示例9: Run

 public bool Run( TraceOptions traceFlags )
 {
     CompiledFunction ep;
     if (!function.TryGetValue("Main", out ep)) {
         Console.WriteLine("No Main function found");
         return false;
     }
     if (ep.NumArguments != 0) {
         Console.WriteLine("The Main function takes 0 arguments");
         return false;
     }
     this.traceFlags = traceFlags;
     stack = new SMValue[stackSizeInitial];
     stackHeight = 0;
     bool resultCode = executeFunction( ep );
     return resultCode;
 }
开发者ID:bradens,项目名称:uvc,代码行数:17,代码来源:interpreter-v1.cs

示例10: RollingFlatFileTraceListenerData

 /// <summary>
 /// Initializes a new instance of the <see cref="RollingFlatFileTraceListenerData"/> class.
 /// </summary>
 /// <param name="name">The name for the configuration object.</param>
 /// <param name="traceOutputOptions">The trace options.</param>
 /// <param name="fileName"></param>
 /// <param name="footer"></param>
 /// <param name="header"></param>
 /// <param name="rollSizeKB"></param>
 /// <param name="timeStampPattern"></param>
 /// <param name="rollFileExistsBehavior"></param>
 /// <param name="rollInterval"></param>
 /// <param name="formatter"></param>
 public RollingFlatFileTraceListenerData(string name,
                                         string fileName,
                                         string header,
                                         string footer,
                                         int rollSizeKB,
                                         string timeStampPattern,
                                         RollFileExistsBehavior rollFileExistsBehavior,
                                         RollInterval rollInterval,
                                         TraceOptions traceOutputOptions,
                                         string formatter)
     : base(name, typeof(RollingFlatFileTraceListener), traceOutputOptions)
 {
     FileName = fileName;
     Header = header;
     Footer = footer;
     RollSizeKB = rollSizeKB;
     RollFileExistsBehavior = rollFileExistsBehavior;
     RollInterval = rollInterval;
     TimeStampPattern = timeStampPattern;
     Formatter = formatter;
 }
开发者ID:randylevy,项目名称:Samples,代码行数:34,代码来源:RollingFlatFileTraceListenerData.cs

示例11: setTracing

        public static void setTracing(TraceLevel level, TraceOptions options,
            string traceFileName)
        {
            m_level = level;
            if (m_level != TraceLevel.Off)
            {

                TextWriterTraceListener tr1;
                try
                {
                    tr1 = new TextWriterTraceListener(File.CreateText(traceFileName));
                    tr1.TraceOutputOptions = options;
                    Trace.Listeners.Add(tr1);

                }
                catch (Exception e)
                {
                    log(TraceEventType.Error, e.StackTrace);
                }
            }
        }
开发者ID:nydehi,项目名称:gumpad,代码行数:21,代码来源:GumTrace.cs

示例12: IsEnabled

 private bool IsEnabled(TraceOptions opts)
 {
     return (opts & TraceOutputOptions) != 0;
 }
开发者ID:Erls-Corporation,项目名称:Glimpse,代码行数:4,代码来源:TraceListener.cs

示例13: MsmqTraceListenerData

 /// <summary>
 /// Initializes a new instance of the <see cref="MsmqTraceListenerData"/> class.
 /// </summary>
 /// <param name="name">The name for the represented trace listener.</param>
 /// <param name="queuePath">The path name for the represented trace listener.</param>
 /// <param name="formatterName">The formatter name for the represented trace listener.</param>
 /// <param name="messagePriority">The priority for the represented trace listener.</param>
 /// <param name="recoverable">The recoverable flag for the represented trace listener.</param>
 /// <param name="timeToReachQueue">The timeToReachQueue for the represented trace listener.</param>
 /// <param name="timeToBeReceived">The timeToReachQueue for the represented trace listener.</param>
 /// <param name="useAuthentication">The use authentication flag for the represented trace listener.</param>
 /// <param name="useDeadLetterQueue">The use dead letter flag for the represented trace listener.</param>
 /// <param name="useEncryption">The use encryption flag for the represented trace listener.</param>
 /// <param name="transactionType">The transaction type for the represented trace listener.</param>
 /// <param name="traceOutputOptions">The trace output options for the represented trace listener.</param>
 /// <param name="filter">The filter for the represented trace listener.</param>
 public MsmqTraceListenerData(string name, string queuePath, string formatterName,
                              MessagePriority messagePriority, bool recoverable,
                              TimeSpan timeToReachQueue, TimeSpan timeToBeReceived,
                              bool useAuthentication, bool useDeadLetterQueue, bool useEncryption,
                              MessageQueueTransactionType transactionType, TraceOptions traceOutputOptions, SourceLevels filter)
     : base(name, typeof(MsmqTraceListener), traceOutputOptions, filter)
 {
     this.QueuePath = queuePath;
     this.Formatter = formatterName;
     this.MessagePriority = messagePriority;
     this.Recoverable = recoverable;
     this.TimeToReachQueue = timeToReachQueue;
     this.TimeToBeReceived = timeToBeReceived;
     this.UseAuthentication = useAuthentication;
     this.UseDeadLetterQueue = useDeadLetterQueue;
     this.UseEncryption = useEncryption;
     this.TransactionType = transactionType;
 }
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:34,代码来源:MsmqTraceListenerData.cs

示例14: ExtendedFormattedDatabaseTraceListenerData

 /// <summary>
 /// Initializes a named instance of <see cref="FormattedDatabaseTraceListenerData"/> with 
 /// name, stored procedure name, databse instance name, and formatter name.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="writeLogStoredProcName">The stored procedure name for writing the log.</param>
 /// <param name="addCategoryStoredProcName">The stored procedure name for adding a category for this log.</param>
 /// <param name="databaseInstanceName">The database instance name.</param>
 /// <param name="formatterName">The formatter name.</param>
 /// <param name="traceOutputOptions">The trace options.</param>
 /// <param name="filter">The filter to be applied</param>
 public ExtendedFormattedDatabaseTraceListenerData(string name,
                                           string writeLogStoredProcName,
                                           string addCategoryStoredProcName,
                                           string databaseInstanceName,
                                           string formatterName,
                                           TraceOptions traceOutputOptions,
                                           SourceLevels filter)
     : base(name, typeof(ExtendedFormattedDatabaseTraceListener), traceOutputOptions, filter)
 {
     DatabaseInstanceName = databaseInstanceName;
     WriteLogStoredProcName = writeLogStoredProcName;
     AddCategoryStoredProcName = addCategoryStoredProcName;
     Formatter = formatterName;
 }
开发者ID:randylevy,项目名称:Samples,代码行数:25,代码来源:ExtendedFormattedDatabaseTraceListenerData.cs

示例15: TraceListenerData

 /// <summary>
 /// Initializes an instance of <see cref="TraceListenerData"/> with a name, a <see cref="TraceOptions"/> for 
 /// a TraceListenerType and a <see cref="SourceLevels"/> for a Filter.
 /// </summary>
 /// <param name="name">The name for the instance.</param>
 /// <param name="traceListenerType">The trace listener type.</param>
 /// <param name="traceOutputOptions">The trace options.</param>
 /// <param name="filter">The filter.</param>
 protected TraceListenerData(string name, Type traceListenerType, TraceOptions traceOutputOptions, SourceLevels filter)
     : base(name, traceListenerType)
 {
     this.ListenerDataType = this.GetType();
     this.TraceOutputOptions = traceOutputOptions;
     this.Filter = filter;
 }
开发者ID:jmeckley,项目名称:Enterprise-Library-5.0,代码行数:15,代码来源:TraceListenerData.cs


注:本文中的TraceOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。