We need you! We're working hard on the next version of Developer Fusion -
Let us know what you think we should be up to!
-
Expand
Microsoft.Win32
-
Expand
Microsoft.Win32.SafeHandles
-
Expand
System
-
Expand
System.Runtime.Hosting
-
Expand
System.Runtime.InteropServices
-
Expand
System.Runtime.CompilerServices
-
Expand
System.Collections
-
Expand
System.Collections.Generic
-
Expand
System.Collections.ObjectModel
-
Expand
System.Configuration.Assemblies
-
Expand
System.Diagnostics
-
Expand
Assert
-
Expand
AssertFilter
-
Expand
AssertFilters
-
Expand
AssertSection
-
Expand
AssertWrapper
-
Expand
AsyncStreamReader
-
Expand
BooleanSwitch
-
Expand
ConditionalAttribute
-
Expand
ConsoleTraceListener
-
Expand
CorrelationManager
-
Expand
CounterSampleCalculator
-
Expand
DataReceivedEventArgs
-
Expand
Debug
-
Expand
DebuggableAttribute
-
Expand
Debugger
-
Expand
DebuggerBrowsableAttribute
-
Expand
DebuggerBrowsableState
-
Expand
DebuggerDisplayAttribute
-
Expand
DebuggerHiddenAttribute
-
Expand
DebuggerNonUserCodeAttribute
-
Expand
DebuggerStepperBoundaryAttribute
-
Expand
DebuggerStepThroughAttribute
-
Expand
DebuggerTypeProxyAttribute
-
Expand
DebuggerVisualizerAttribute
-
Expand
DebuggingModes
-
Expand
DefaultFilter
-
Expand
DefaultTraceListener
-
Expand
DelimitedListTraceListener
-
Expand
DiagnosticsConfiguration
-
Expand
DiagnosticsConfigurationHandler
-
Expand
EnvironmentBlock
-
Expand
EventTypeFilter
-
Expand
FilterElement
-
Expand
fred
-
Expand
InitState
-
Expand
ListenerElement
-
Expand
ListenerElementsCollection
-
Expand
Log
-
Expand
LoggingLevels
-
Expand
LogSwitch
-
Expand
ModuleInfo
-
Expand
MonitoringDescriptionAttribute
-
Expand
OrdinalCaseInsensitiveComparer
-
Expand
PerfCounterSection
-
Expand
Process
-
Expand
ProcessInfo
-
Expand
ProcessPriorityClass
-
Expand
ProcessStartInfo
-
Expand
ProcessThreadTimes
-
Expand
ProcessWaitHandle
-
Expand
ProcessWindowStyle
-
Expand
SharedListenerElementsCollection
-
Expand
SourceElement
-
Expand
SourceElementsCollection
-
Expand
SourceFilter
-
Expand
SourceLevels
-
Expand
SourceSwitch
-
Expand
StackFrame
-
Expand
StackFrameHelper
-
Expand
StackTrace
-
Expand
State
-
Expand
Stopwatch
-
Expand
StreamReadMode
-
Expand
Switch
-
Expand
SwitchAttribute
-
Expand
SwitchElement
-
Expand
SwitchElementsCollection
-
Expand
SwitchesDictionarySectionHandler
-
Expand
SwitchLevelAttribute
-
Expand
SystemDiagnosticsSection
-
Expand
TextWriterTraceListener
-
Expand
ThreadInfo
-
Expand
Trace
-
Assert(bool)
-
Assert(bool, string)
-
Assert(bool, string, string)
-
AutoFlush()
-
Close()
-
CorrelationManager()
-
Fail(string)
-
Fail(string, string)
-
Flush()
-
Indent()
-
IndentLevel()
-
IndentSize()
-
Listeners()
-
Refresh()
-
Trace()
-
TraceError(string)
-
TraceError(string, object)
-
TraceInformation(string)
-
TraceInformation(string, object)
-
TraceWarning(string)
-
TraceWarning(string, object)
-
Unindent()
-
UseGlobalLock()
-
Write(object)
-
Write(object, string)
-
Write(string)
-
Write(string, string)
-
WriteIf(bool, object)
-
WriteIf(bool, object, string)
-
WriteIf(bool, string)
-
WriteIf(bool, string, string)
-
WriteLine(object)
-
WriteLine(object, string)
-
WriteLine(string)
-
WriteLine(string, string)
-
WriteLineIf(bool, object)
-
WriteLineIf(bool, object, string)
-
WriteLineIf(bool, string)
-
WriteLineIf(bool, string, string)
-
Expand
TraceEventCache
-
Expand
TraceEventType
-
Expand
TraceFilter
-
Expand
TraceFormat
-
Expand
TraceInternal
-
Expand
TraceLevel
-
Expand
TraceListener
-
Expand
TraceListenerCollection
-
Expand
TraceOptions
-
Expand
TraceSection
-
Expand
TraceSource
-
Expand
TraceSwitch
-
Expand
TraceUtils
-
Expand
TypedElement
-
Expand
XmlWriterTraceListener
-
Expand
System.Diagnostics.CodeAnalysis
-
Expand
System.Diagnostics.SymbolStore
-
Expand
System.Globalization
-
Expand
System.IO
-
Expand
System.IO.IsolatedStorage
-
Expand
System.Reflection
-
Expand
System.Reflection.Cache
-
Expand
System.Reflection.Emit
-
Expand
System.Resources
-
Expand
System.Runtime
-
Expand
System.Runtime.InteropServices.Expando
-
Expand
System.Runtime.ConstrainedExecution
-
Expand
System.Runtime.Remoting.Activation
-
Expand
System.Runtime.Remoting.Messaging
-
Expand
System.Runtime.Remoting.Channels
-
Expand
System.Runtime.Remoting.Lifetime
-
Expand
System.Runtime.Remoting
-
Expand
System.Runtime.Remoting.Contexts
-
Expand
System.Runtime.Remoting.Proxies
-
Expand
System.Runtime.Remoting.Metadata
-
Expand
System.Runtime.Remoting.Metadata.W3cXsd2001
-
Expand
System.Runtime.Remoting.Services
-
Expand
System.Runtime.Serialization
-
Expand
System.Runtime.Serialization.Formatters
-
Expand
System.Runtime.Serialization.Formatters.Binary
-
Expand
System.Runtime.Versioning
-
Expand
System.Security
-
Expand
System.Security.Cryptography
-
Expand
System.Security.Cryptography.X509Certificates
-
Expand
System.Security.Permissions
-
Expand
System.Security.Policy
-
Expand
System.Security.Principal
-
Expand
System.Security.Util
-
Expand
System.Text
-
Expand
System.Threading
-
Expand
System.Runtime.Remoting.Channels.Http
-
Expand
System.Runtime.Remoting.Channels.Tcp
-
Expand
System.Runtime.Remoting.MetadataServices
-
Expand
System.Runtime.Serialization.Formatters.Soap.Xml
-
Expand
System.Runtime.Serialization.Formatters.Soap
-
Expand
Microsoft.Tools.Caspol
-
Expand
Microsoft.Tools.Build
-
Expand
Microsoft.CSharp
-
Expand
System.CodeDom
-
Expand
System.CodeDom.Compiler
-
Expand
System.Collections.Specialized
-
Expand
System.ComponentModel
-
Expand
System.ComponentModel.Design
-
Expand
System.ComponentModel.Design.Serialization
-
Expand
System.Configuration
-
Expand
System.Web
-
Expand
System.Configuration.Provider
-
Expand
System.Configuration.Internal
-
Expand
System.Internal
-
Expand
System.Windows.Forms
-
Expand
System.Net
-
Expand
System.Net.Sockets
-
Expand
System.Net.NetworkInformation
-
Expand
System.Net.ComImports
-
Expand
System.Net.Security
-
Expand
System.Net.Cache
-
Expand
System.Net.Configuration
-
Expand
System.Text.RegularExpressions
-
Expand
System.Tools
-
Expand
System.IO.Compression
-
Expand
System.IO.Ports
-
Expand
System.Security.AccessControl
-
Expand
System.Xml
-
Expand
System.Xml.XPath.DataBinding
-
Expand
System.Xml.Schema
-
Expand
System.Xml.Serialization
-
Expand
System.Xml.Serialization.Advanced
-
Expand
System.Xml.Serialization.Configuration
-
Expand
System.Xml.XPath
-
Expand
System.Xml.Xsl
-
Expand
System.Xml.Xsl.IlGen
-
Expand
System.Xml.Xsl.Qil
-
Expand
System.Xml.Xsl.Runtime
-
Expand
System.Xml.Xsl.XPath
-
Expand
System.Xml.Xsl.Xslt
-
Expand
System.Xml.Xsl.XsltOld
-
Expand
System.Xml.Xsl.XsltOld.Debugger
-
Expand
Microsoft.JScript
-
Expand
Microsoft.Vsa
-
Expand
Microsoft.JScript.Vsa
- #define TRACE
- namespace System.Diagnostics
- {
- using System;
- using System.Collections;
- using System.Security.Permissions;
- using System.Threading;
-
- /// <devdoc>
- /// <para>Provides a set of properties and methods to trace the execution of your code.</para>
- /// </devdoc>
- public sealed class Trace
- {
- private static CorrelationManager correlationManager = null;
-
-
-
- private Trace()
- {
- }
-
- /// <devdoc>
- /// <para>Gets the collection of listeners that is monitoring the trace output.</para>
- /// </devdoc>
- public static TraceListenerCollection Listeners {
- [HostProtection(SharedState = true)]
- get {
-
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
-
- return TraceInternal.Listeners;
- }
- }
-
- /// <devdoc>
- /// <para>
- /// Gets or sets whether <see cref='System.Diagnostics.Trace.Flush'/> should be called on the <see cref='System.Diagnostics.Trace.Listeners'/> after every write.
- /// </para>
- /// </devdoc>
- public static bool AutoFlush {
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- get { return TraceInternal.AutoFlush; }
-
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- set { TraceInternal.AutoFlush = value; }
- }
-
- public static bool UseGlobalLock {
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- get { return TraceInternal.UseGlobalLock; }
-
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- set { TraceInternal.UseGlobalLock = value; }
- }
-
- public static CorrelationManager CorrelationManager {
- [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- get {
- if (correlationManager == null)
- correlationManager = new CorrelationManager();
-
- return correlationManager;
- }
- }
-
- /// <devdoc>
- /// <para>Gets or sets the indent level.</para>
- /// </devdoc>
- public static int IndentLevel {
- get { return TraceInternal.IndentLevel; }
-
- set { TraceInternal.IndentLevel = value; }
- }
-
-
- /// <devdoc>
- /// <para>
- /// Gets or sets the number of spaces in an indent.
- /// </para>
- /// </devdoc>
- public static int IndentSize {
- get { return TraceInternal.IndentSize; }
-
- set { TraceInternal.IndentSize = value; }
- }
-
- /// <devdoc>
- /// <para>Clears the output buffer, and causes buffered data to
- /// be written to the <see cref='System.Diagnostics.Trace.Listeners'/>.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Flush()
- {
- TraceInternal.Flush();
- }
-
- /// <devdoc>
- /// <para>Clears the output buffer, and then closes the <see cref='System.Diagnostics.Trace.Listeners'/> so that they no
- /// longer receive debugging output.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Close()
- {
-
- new SecurityPermission(SecurityPermissionFlag.UnmanagedCode).Demand();
-
- TraceInternal.Close();
- }
-
- /// <devdoc>
- /// <para>Checks for a condition, and outputs the callstack if the
- /// condition
- /// is <see langword='false'/>.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Assert(bool condition)
- {
- TraceInternal.Assert(condition);
- }
-
- /// <devdoc>
- /// <para>Checks for a condition, and displays a message if the condition is
- /// <see langword='false'/>. </para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Assert(bool condition, string message)
- {
- TraceInternal.Assert(condition, message);
- }
-
- /// <devdoc>
- /// <para>Checks for a condition, and displays both messages if the condition
- /// is <see langword='false'/>. </para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Assert(bool condition, string message, string detailMessage)
- {
- TraceInternal.Assert(condition, message, detailMessage);
- }
-
- /// <devdoc>
- /// <para>Emits or displays a message for an assertion that always fails.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Fail(string message)
- {
- TraceInternal.Fail(message);
- }
-
- /// <devdoc>
- /// <para>Emits or displays both messages for an assertion that always fails.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Fail(string message, string detailMessage)
- {
- TraceInternal.Fail(message, detailMessage);
- }
-
- public static void Refresh()
- {
- DiagnosticsConfiguration.Refresh();
- Switch.RefreshAll();
- TraceSource.RefreshAll();
- }
-
- [System.Diagnostics.Conditional("TRACE")]
- public static void TraceInformation(string message)
- {
- TraceInternal.TraceEvent(TraceEventType.Information, 0, message, null);
- }
-
- [System.Diagnostics.Conditional("TRACE")]
- public static void TraceInformation(string format, params object[] args)
- {
- TraceInternal.TraceEvent(TraceEventType.Information, 0, format, args);
- }
-
- [System.Diagnostics.Conditional("TRACE")]
- public static void TraceWarning(string message)
- {
- TraceInternal.TraceEvent(TraceEventType.Warning, 0, message, null);
- }
-
- [System.Diagnostics.Conditional("TRACE")]
- public static void TraceWarning(string format, params object[] args)
- {
- TraceInternal.TraceEvent(TraceEventType.Warning, 0, format, args);
- }
-
- [System.Diagnostics.Conditional("TRACE")]
- public static void TraceError(string message)
- {
- TraceInternal.TraceEvent(TraceEventType.Error, 0, message, null);
- }
-
- [System.Diagnostics.Conditional("TRACE")]
- public static void TraceError(string format, params object[] args)
- {
- TraceInternal.TraceEvent(TraceEventType.Error, 0, format, args);
- }
-
- /// <devdoc>
- /// <para>Writes a message to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/>
- /// collection.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Write(string message)
- {
- TraceInternal.Write(message);
- }
-
- /// <devdoc>
- /// <para>Writes the name of the <paramref name="value "/>
- /// parameter to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Write(object value)
- {
- TraceInternal.Write(value);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and message to the trace listeners
- /// in the <see cref='System.Diagnostics.Trace.Listeners'/> collection.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Write(string message, string category)
- {
- TraceInternal.Write(message, category);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and the name of the value parameter to the trace listeners
- /// in the <see cref='System.Diagnostics.Trace.Listeners'/> collection.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Write(object value, string category)
- {
- TraceInternal.Write(value, category);
- }
-
- /// <devdoc>
- /// <para>Writes a message followed by a line terminator to the
- /// trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection.
- /// The default line terminator is a carriage return followed by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLine(string message)
- {
- TraceInternal.WriteLine(message);
- }
-
- /// <devdoc>
- /// <para>Writes the name of the <paramref name="value "/> parameter followed by a line terminator to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection. The default line
- /// terminator is a carriage return followed by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLine(object value)
- {
- TraceInternal.WriteLine(value);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and message followed by a line terminator to the trace
- /// listeners in the <see cref='System.Diagnostics.Trace.Listeners'/>
- /// collection. The default line terminator is a carriage return followed by a line
- /// feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLine(string message, string category)
- {
- TraceInternal.WriteLine(message, category);
- }
-
- /// <devdoc>
- /// <para>Writes a <paramref name="category "/>name and the name of the <paramref name="value "/> parameter followed by a line
- /// terminator to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection. The default line
- /// terminator is a carriage return followed by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLine(object value, string category)
- {
- TraceInternal.WriteLine(value, category);
- }
-
- /// <devdoc>
- /// <para>Writes a message to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection
- /// if a condition is <see langword='true'/>.</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteIf(bool condition, string message)
- {
- TraceInternal.WriteIf(condition, message);
- }
-
- /// <devdoc>
- /// <para>Writes the name of the <paramref name="value "/>
- /// parameter to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection if a condition is
- /// <see langword='true'/>. </para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteIf(bool condition, object value)
- {
- TraceInternal.WriteIf(condition, value);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and message to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/>
- /// collection if a condition is <see langword='true'/>. </para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteIf(bool condition, string message, string category)
- {
- TraceInternal.WriteIf(condition, message, category);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and the name of the <paramref name="value"/> parameter to the trace
- /// listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection
- /// if a condition is <see langword='true'/>. </para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteIf(bool condition, object value, string category)
- {
- TraceInternal.WriteIf(condition, value, category);
- }
-
- /// <devdoc>
- /// <para>Writes a message followed by a line terminator to the trace listeners in the
- /// <see cref='System.Diagnostics.Trace.Listeners'/> collection if a condition is
- /// <see langword='true'/>. The default line terminator is a carriage return followed
- /// by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLineIf(bool condition, string message)
- {
- TraceInternal.WriteLineIf(condition, message);
- }
-
- /// <devdoc>
- /// <para>Writes the name of the <paramref name="value"/> parameter followed by a line terminator to the
- /// trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection
- /// if a condition is
- /// <see langword='true'/>. The default line
- /// terminator is a carriage return followed by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLineIf(bool condition, object value)
- {
- TraceInternal.WriteLineIf(condition, value);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and message followed by a line terminator to the trace
- /// listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection if a condition is
- /// <see langword='true'/>. The default line terminator is a carriage return followed by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLineIf(bool condition, string message, string category)
- {
- TraceInternal.WriteLineIf(condition, message, category);
- }
-
- /// <devdoc>
- /// <para>Writes a category name and the name of the <paramref name="value "/> parameter followed by a line
- /// terminator to the trace listeners in the <see cref='System.Diagnostics.Trace.Listeners'/> collection
- /// if a <paramref name="condition"/> is <see langword='true'/>. The
- /// default line terminator is a carriage return followed by a line feed (\r\n).</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void WriteLineIf(bool condition, object value, string category)
- {
- TraceInternal.WriteLineIf(condition, value, category);
- }
-
- /// <devdoc>
- /// <para>[To be supplied.]</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Indent()
- {
- TraceInternal.Indent();
- }
-
- /// <devdoc>
- /// <para>[To be supplied.]</para>
- /// </devdoc>
- [System.Diagnostics.Conditional("TRACE")]
- public static void Unindent()
- {
- TraceInternal.Unindent();
- }
- }
- }