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
-
DelimitedListTraceListener(Stream)
-
DelimitedListTraceListener(Stream, string)
-
DelimitedListTraceListener(string)
-
DelimitedListTraceListener(string, string)
-
DelimitedListTraceListener(TextWriter)
-
DelimitedListTraceListener(TextWriter, string)
-
Delimiter()
-
GetSupportedAttributes()
-
TraceData(TraceEventCache, string, TraceEventType, int, object)
-
TraceData(TraceEventCache, string, TraceEventType, int, object)
-
TraceEvent(TraceEventCache, string, TraceEventType, int, string)
-
TraceEvent(TraceEventCache, string, TraceEventType, int, string, object)
-
WriteEscaped(string)
-
WriteFooter(TraceEventCache)
-
WriteHeader(string, TraceEventType, int)
-
WriteStackEscaped(Stack)
-
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
-
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
- using System;
- using System.Text;
- using System.Globalization;
- using System.IO;
- using System.Collections;
- using System.Security.Permissions;
- using System.Runtime.Versioning;
- namespace System.Diagnostics
- {
- [HostProtection(Synchronization = true)]
- public class DelimitedListTraceListener : TextWriterTraceListener
- {
- string delimiter = ";";
- string secondaryDelim = ",";
- bool initializedDelim = false;
-
- public DelimitedListTraceListener(Stream stream) : base(stream)
- {
- }
-
- public DelimitedListTraceListener(Stream stream, string name) : base(stream, name)
- {
- }
-
- public DelimitedListTraceListener(TextWriter writer) : base(writer)
- {
- }
-
- public DelimitedListTraceListener(TextWriter writer, string name) : base(writer, name)
- {
- }
-
- [ResourceExposure(ResourceScope.Machine)]
- [ResourceConsumption(ResourceScope.Machine)]
- public DelimitedListTraceListener(string fileName) : base(fileName)
- {
- }
-
- [ResourceExposure(ResourceScope.Machine)]
- [ResourceConsumption(ResourceScope.Machine)]
- public DelimitedListTraceListener(string fileName, string name) : base(fileName, name)
- {
- }
-
- public string Delimiter {
- get {
- lock (this) {
-
- if (!initializedDelim) {
-
- if (Attributes.ContainsKey("delimiter"))
- delimiter = Attributes["delimiter"];
-
- initializedDelim = true;
- }
- }
- return delimiter;
- }
- set {
- if (value == null)
- throw new ArgumentNullException("Delimiter");
-
- if (value.Length == 0)
- throw new ArgumentException(SR.GetString("Generic_ArgCantBeEmptyString", "Delimiter"));
-
- lock (this) {
- delimiter = value;
- initializedDelim = true;
- }
-
- if (delimiter == ",")
- secondaryDelim = ";";
- else
- secondaryDelim = ",";
- }
- }
-
- protected internal override string[] GetSupportedAttributes()
- {
- return new string[] {"delimiter"};
- }
-
-
- public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
- {
- if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, format, args))
- return;
-
- WriteHeader(source, eventType, id);
-
- if (args != null)
- WriteEscaped(String.Format(CultureInfo.InvariantCulture, format, args));
- else
- WriteEscaped(format);
- Write(Delimiter);
-
-
- Write(Delimiter);
-
- WriteFooter(eventCache);
- }
-
- public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
- {
- if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, message))
- return;
-
- WriteHeader(source, eventType, id);
-
- WriteEscaped(message);
- Write(Delimiter);
-
-
- Write(Delimiter);
-
- WriteFooter(eventCache);
- }
-
- public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
- {
- if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, null, null, data))
- return;
-
- WriteHeader(source, eventType, id);
-
-
- Write(Delimiter);
-
- WriteEscaped(data.ToString());
- Write(Delimiter);
-
- WriteFooter(eventCache);
- }
-
- public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, params object[] data)
- {
- if (Filter != null && !Filter.ShouldTrace(eventCache, source, eventType, id, null, null, null, data))
- return;
-
- WriteHeader(source, eventType, id);
-
-
- Write(Delimiter);
-
- if (data != null) {
- for (int i = 0; i < data.Length; i++) {
- if (i != 0)
- Write(secondaryDelim);
- WriteEscaped(data[i].ToString());
- }
- }
- Write(Delimiter);
-
- WriteFooter(eventCache);
- }
-
- private void WriteHeader(string source, TraceEventType eventType, int id)
- {
- WriteEscaped(source);
- Write(Delimiter);
-
- Write(eventType.ToString());
- Write(Delimiter);
-
- Write(id.ToString(CultureInfo.InvariantCulture));
- Write(Delimiter);
-
- }
-
- private void WriteFooter(TraceEventCache eventCache)
- {
- if (eventCache != null) {
- if (IsEnabled(TraceOptions.ProcessId))
- Write(eventCache.ProcessId.ToString(CultureInfo.InvariantCulture));
- Write(Delimiter);
-
- if (IsEnabled(TraceOptions.LogicalOperationStack))
- WriteStackEscaped(eventCache.LogicalOperationStack);
- Write(Delimiter);
-
- if (IsEnabled(TraceOptions.ThreadId))
- WriteEscaped(eventCache.ThreadId.ToString(CultureInfo.InvariantCulture));
- Write(Delimiter);
-
- if (IsEnabled(TraceOptions.DateTime))
- WriteEscaped(eventCache.DateTime.ToString("o", CultureInfo.InvariantCulture));
- Write(Delimiter);
-
- if (IsEnabled(TraceOptions.Timestamp))
- Write(eventCache.Timestamp.ToString(CultureInfo.InvariantCulture));
- Write(Delimiter);
-
- if (IsEnabled(TraceOptions.Callstack))
- WriteEscaped(eventCache.Callstack);
- }
- else {
- for (int i = 0; i < 5; i++)
- Write(Delimiter);
-
- }
-
- WriteLine("");
- }
-
- private void WriteEscaped(string message)
- {
- if (!String.IsNullOrEmpty(message)) {
- StringBuilder sb = new StringBuilder("\"");
- int index;
- int lastindex = 0;
- while ((index = message.IndexOf('"', lastindex)) != -1) {
- sb.Append(message, lastindex, index - lastindex);
- sb.Append("\"\"");
- lastindex = index + 1;
- }
-
- sb.Append(message, lastindex, message.Length - lastindex);
- sb.Append("\"");
- Write(sb.ToString());
- }
- }
-
- private void WriteStackEscaped(Stack stack)
- {
- StringBuilder sb = new StringBuilder("\"");
- bool first = true;
- foreach (object obj in stack) {
- if (!first)
- sb.Append(", ");
- else
- first = false;
-
- string operation = obj.ToString();
-
- int index;
- int lastindex = 0;
- while ((index = operation.IndexOf('"', lastindex)) != -1) {
- sb.Append(operation, lastindex, index - lastindex);
- sb.Append("\"\"");
- lastindex = index + 1;
- }
-
- sb.Append(operation, lastindex, operation.Length - lastindex);
- }
- sb.Append("\"");
- Write(sb.ToString());
- }
-
- }
- }