本文整理汇总了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;
}
示例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;
}
}
示例3: DomainObject
public DomainObject(string name, string surName, int numberProperty, TraceOptions enumProperty)
{
this.name = name;
this.surName = surName;
this.numberProperty = numberProperty;
this.enumProperty = enumProperty;
}
示例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;
}
示例5: BindingListener
public BindingListener(TraceOptions options)
{
IsFirstWrite = true;
PresentationTraceSources.Refresh();
PresentationTraceSources.DataBindingSource.Listeners.Add(this);
PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Error;
TraceOutputOptions = options;
DetermineInformationPropertyCount();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例12: IsEnabled
private bool IsEnabled(TraceOptions opts)
{
return (opts & TraceOutputOptions) != 0;
}
示例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;
}
示例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;
}
示例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;
}