Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -0,0 +1,86 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.TraceSource.Tests", "tests\System.Diagnostics.TraceSource.Tests.csproj", "{7B32D24D-969A-4F7F-8461-B43E15E5D553}"
ProjectSection(ProjectDependencies) = postProject
{5380420C-EB1D-4C53-9CFC-916578C18334} = {5380420C-EB1D-4C53-9CFC-916578C18334}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{47919FF5-DA40-4D99-AF2D-F560282AA913}"
ProjectSection(SolutionItems) = preProject
..\.nuget\packages.Windows_NT.config = ..\.nuget\packages.Windows_NT.config
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.TraceSource", "src\System.Diagnostics.TraceSource.csproj", "{5380420C-EB1D-4C53-9CFC-916578C18334}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU = DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU
ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU = ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU
DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU = DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU
ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU = ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU
DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU
DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{7B32D24D-969A-4F7F-8461-B43E15E5D553}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Unix|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{5380420C-EB1D-4C53-9CFC-916578C18334}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
uap;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,320 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// ------------------------------------------------------------------------------
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace System.Diagnostics
{
public partial class BooleanSwitch : System.Diagnostics.Switch
{
public BooleanSwitch(string displayName, string description) : base(default(string), default(string)) { }
public BooleanSwitch(string displayName, string description, string defaultSwitchValue) : base(default(string), default(string)) { }
public bool Enabled { get { throw null; } set { } }
protected override void OnValueChanged() { }
}
public partial class CorrelationManager
{
internal CorrelationManager() { }
public System.Guid ActivityId { get { throw null; } set { } }
public System.Collections.Stack LogicalOperationStack { get { throw null; } }
public void StartLogicalOperation() { }
public void StartLogicalOperation(object operationId) { }
public void StopLogicalOperation() { }
}
public partial class DefaultTraceListener : System.Diagnostics.TraceListener
{
public DefaultTraceListener() { }
public override void Fail(string message) { }
public override void Fail(string message, string detailMessage) { }
public override void Write(string message) { }
public override void WriteLine(string message) { }
public bool AssertUiEnabled { get { throw null; } set { } }
public string LogFileName { get { throw null; } set { } }
}
public partial class EventTypeFilter : System.Diagnostics.TraceFilter
{
public EventTypeFilter(System.Diagnostics.SourceLevels level) { }
public System.Diagnostics.SourceLevels EventType { get { throw null; } set { } }
public override bool ShouldTrace(System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data) { throw null; }
}
public partial class SourceFilter : System.Diagnostics.TraceFilter
{
public SourceFilter(string source) { }
public string Source { get { throw null; } set { } }
public override bool ShouldTrace(System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data) { throw null; }
}
[System.FlagsAttribute]
public enum SourceLevels
{
All = -1,
Critical = 1,
Error = 3,
Information = 15,
Off = 0,
Verbose = 31,
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)]
ActivityTracing = 0xFF00,
Warning = 7,
}
public partial class SourceSwitch : System.Diagnostics.Switch
{
public SourceSwitch(string name) : base(default(string), default(string)) { }
public SourceSwitch(string displayName, string defaultSwitchValue) : base(default(string), default(string)) { }
public System.Diagnostics.SourceLevels Level { get { throw null; } set { } }
protected override void OnValueChanged() { }
public bool ShouldTrace(System.Diagnostics.TraceEventType eventType) { throw null; }
}
public abstract partial class Switch
{
protected Switch(string displayName, string description) { }
protected Switch(string displayName, string description, string defaultSwitchValue) { }
public string Description { get { throw null; } }
public string DisplayName { get { throw null; } }
protected int SwitchSetting { get { throw null; } set { } }
protected string Value { get { throw null; } set { } }
protected virtual void OnSwitchSettingChanged() { }
protected virtual void OnValueChanged() { }
public System.Collections.Specialized.StringDictionary Attributes { get { throw null; } }
protected virtual string[] GetSupportedAttributes() { throw null; }
}
public sealed partial class Trace
{
public static CorrelationManager CorrelationManager { get { throw null; } }
internal Trace() { }
public static bool AutoFlush { get { throw null; } set { } }
public static int IndentLevel { get { throw null; } set { } }
public static int IndentSize { get { throw null; } set { } }
public static System.Diagnostics.TraceListenerCollection Listeners { get { throw null; } }
public static bool UseGlobalLock { get { throw null; } set { } }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Assert(bool condition) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Assert(bool condition, string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Assert(bool condition, string message, string detailMessage) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Close() { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Fail(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Fail(string message, string detailMessage) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Flush() { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Indent() { }
public static void Refresh() { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void TraceError(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void TraceError(string format, params object[] args) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void TraceInformation(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void TraceInformation(string format, params object[] args) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void TraceWarning(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void TraceWarning(string format, params object[] args) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Unindent() { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Write(object value) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Write(object value, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Write(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void Write(string message, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteIf(bool condition, object value) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteIf(bool condition, object value, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteIf(bool condition, string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteIf(bool condition, string message, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLine(object value) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLine(object value, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLine(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLine(string message, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, object value) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, object value, string category) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public static void WriteLineIf(bool condition, string message, string category) { }
}
public partial class TraceEventCache
{
public TraceEventCache() { }
public System.DateTime DateTime { get { throw null; } }
public int ProcessId { get { throw null; } }
public string ThreadId { get { throw null; } }
public long Timestamp { get { throw null; } }
public string Callstack { get { throw null; } }
public System.Collections.Stack LogicalOperationStack { get { throw null; } }
}
public enum TraceEventType
{
Critical = 1,
Error = 2,
Information = 8,
Verbose = 16,
Warning = 4,
Resume = 2048,
Start = 256,
Stop = 512,
Suspend = 1024,
Transfer = 4096,
}
public abstract partial class TraceFilter
{
protected TraceFilter() { }
public abstract bool ShouldTrace(System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data);
}
public enum TraceLevel
{
Error = 1,
Info = 3,
Off = 0,
Verbose = 4,
Warning = 2,
}
public abstract partial class TraceListener : System.MarshalByRefObject, System.IDisposable
{
protected TraceListener() { }
protected TraceListener(string name) { }
public System.Diagnostics.TraceFilter Filter { get { throw null; } set { } }
public int IndentLevel { get { throw null; } set { } }
public int IndentSize { get { throw null; } set { } }
public virtual bool IsThreadSafe { get { throw null; } }
public virtual string Name { get { throw null; } set { } }
protected bool NeedIndent { get { throw null; } set { } }
public System.Diagnostics.TraceOptions TraceOutputOptions { get { throw null; } set { } }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual void Fail(string message) { }
public virtual void Fail(string message, string detailMessage) { }
public virtual void Flush() { }
public virtual void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, object data) { }
public virtual void TraceData(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, params object[] data) { }
public virtual void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id) { }
public virtual void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string message) { }
public virtual void TraceEvent(System.Diagnostics.TraceEventCache eventCache, string source, System.Diagnostics.TraceEventType eventType, int id, string format, params object[] args) { }
public virtual void Write(object o) { }
public virtual void Write(object o, string category) { }
public abstract void Write(string message);
public virtual void Write(string message, string category) { }
protected virtual void WriteIndent() { }
public virtual void WriteLine(object o) { }
public virtual void WriteLine(object o, string category) { }
public abstract void WriteLine(string message);
public virtual void WriteLine(string message, string category) { }
public System.Collections.Specialized.StringDictionary Attributes { get { throw null; } }
public virtual void Close() { }
protected virtual string[] GetSupportedAttributes() { throw null; }
public virtual void TraceTransfer(TraceEventCache eventCache, string source, int id, string message, Guid relatedActivityId) { throw null; }
}
public partial class TraceListenerCollection : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
{
internal TraceListenerCollection() { }
public int Count { get { throw null; } }
public System.Diagnostics.TraceListener this[int i] { get { throw null; } set { } }
public System.Diagnostics.TraceListener this[string name] { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IList.IsFixedSize { get { throw null; } }
bool System.Collections.IList.IsReadOnly { get { throw null; } }
object System.Collections.IList.this[int index] { get { throw null; } set { } }
public int Add(System.Diagnostics.TraceListener listener) { throw null; }
public void AddRange(System.Diagnostics.TraceListener[] value) { }
public void AddRange(System.Diagnostics.TraceListenerCollection value) { }
public void Clear() { }
public bool Contains(System.Diagnostics.TraceListener listener) { throw null; }
public void CopyTo(System.Diagnostics.TraceListener[] listeners, int index) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
public int IndexOf(System.Diagnostics.TraceListener listener) { throw null; }
public void Insert(int index, System.Diagnostics.TraceListener listener) { }
public void Remove(System.Diagnostics.TraceListener listener) { }
public void Remove(string name) { }
public void RemoveAt(int index) { }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
int System.Collections.IList.Add(object value) { throw null; }
bool System.Collections.IList.Contains(object value) { throw null; }
int System.Collections.IList.IndexOf(object value) { throw null; }
void System.Collections.IList.Insert(int index, object value) { }
void System.Collections.IList.Remove(object value) { }
}
[System.FlagsAttribute]
public enum TraceOptions
{
DateTime = 2,
None = 0,
LogicalOperationStack = 1,
ProcessId = 8,
ThreadId = 16,
Timestamp = 4,
Callstack = 32,
}
public partial class TraceSource
{
public TraceSource(string name) { }
public TraceSource(string name, System.Diagnostics.SourceLevels defaultLevel) { }
public System.Diagnostics.TraceListenerCollection Listeners { get { throw null; } }
public string Name { get { throw null; } }
public System.Diagnostics.SourceSwitch Switch { get { throw null; } set { } }
public void Close() { }
public void Flush() { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceData(System.Diagnostics.TraceEventType eventType, int id, object data) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceData(System.Diagnostics.TraceEventType eventType, int id, params object[] data) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceEvent(System.Diagnostics.TraceEventType eventType, int id) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceEvent(System.Diagnostics.TraceEventType eventType, int id, string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceEvent(System.Diagnostics.TraceEventType eventType, int id, string format, params object[] args) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceInformation(string message) { }
[System.Diagnostics.ConditionalAttribute("TRACE")]
public void TraceInformation(string format, params object[] args) { }
public System.Collections.Specialized.StringDictionary Attributes { get { throw null; } }
protected virtual string[] GetSupportedAttributes() { throw null; }
public void TraceTransfer(int id, string message, System.Guid relatedActivityId) { }
}
public partial class TraceSwitch : System.Diagnostics.Switch
{
public TraceSwitch(string displayName, string description) : base(default(string), default(string)) { }
public TraceSwitch(string displayName, string description, string defaultSwitchValue) : base(default(string), default(string)) { }
public System.Diagnostics.TraceLevel Level { get { throw null; } set { } }
public bool TraceError { get { throw null; } }
public bool TraceInfo { get { throw null; } }
public bool TraceVerbose { get { throw null; } }
public bool TraceWarning { get { throw null; } }
protected override void OnSwitchSettingChanged() { }
protected override void OnValueChanged() { }
}
public sealed class SwitchAttribute : System.Attribute
{
public SwitchAttribute(string switchName, Type switchType) { throw null; }
public string SwitchDescription { get { throw null; } set { } }
public string SwitchName { get { throw null; } set { } }
public System.Type SwitchType { get { throw null; } set { } }
public static SwitchAttribute[] GetAll(System.Reflection.Assembly assembly) { throw null; }
}
public sealed class SwitchLevelAttribute : System.Attribute
{
public SwitchLevelAttribute(Type switchLevelType) { throw null; }
public System.Type SwitchLevelType { get { throw null; } set { } }
}
}

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System.Diagnostics.TraceSource.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
<ProjectReference Include="..\..\System.Collections.Specialized\ref\System.Collections.Specialized.csproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp-Unix;
netcoreapp-Windows_NT;
net463-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,21 @@
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Flush()")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Fail(System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Fail(System.String,System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.String,System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.Object)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#Write(System.Object,System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.String,System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.Object)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceInternal.#WriteLine(System.Object,System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#Flush()")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceEvent(System.Diagnostics.TraceEventType,System.Int32,System.String,System.Object[])")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceData(System.Diagnostics.TraceEventType,System.Int32,System.Object)")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceData(System.Diagnostics.TraceEventType,System.Int32,System.Object[])")]
[assembly: SuppressMessage("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity", Scope = "member", Target = "System.Diagnostics.TraceSource.#TraceTransfer(System.Int32,System.String,System.Guid)")]

View File

@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MustAddListener" xml:space="preserve">
<value>Only TraceListeners can be added to a TraceListenerCollection.</value>
</data>
<data name="IndentSize" xml:space="preserve">
<value>The IndentSize property must be non-negative.</value>
</data>
<data name="TraceListenerFail" xml:space="preserve">
<value>Fail:</value>
</data>
<data name="TraceListenerIndentSize" xml:space="preserve">
<value>The IndentSize property must be non-negative.</value>
</data>
<data name="DebugAssertBanner" xml:space="preserve">
<value>---- DEBUG ASSERTION FAILED ----</value>
</data>
<data name="DebugAssertShortMessage" xml:space="preserve">
<value>---- Assert Short Message ----</value>
</data>
<data name="DebugAssertLongMessage" xml:space="preserve">
<value>---- Assert Long Message ----</value>
</data>
<data name="ExceptionOccurred" xml:space="preserve">
<value>An exception occurred writing trace output to log file '{0}'. {1}</value>
</data>
<data name="TraceSwitchLevelTooLow" xml:space="preserve">
<value>Attempted to set {0} to a value that is too low. Setting level to TraceLevel.Off</value>
</data>
<data name="TraceSwitchInvalidLevel" xml:space="preserve">
<value>The Level must be set to a value in the enumeration TraceLevel.</value>
</data>
<data name="TraceSwitchLevelTooHigh" xml:space="preserve">
<value>Attempted to set {0} to a value that is too high. Setting level to TraceLevel.Verbose</value>
</data>
<data name="InvalidNullEmptyArgument" xml:space="preserve">
<value>Argument {0} cannot be null or zero-length.</value>
</data>
<data name="DebugAssertTitle" xml:space="preserve">
<value>Assertion Failed: Cancel=Debug, OK=Continue</value>
</data>
<data name="RTL" xml:space="preserve">
<value>RTL_False</value>
</data>
</root>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<RootNamespace>System.Diagnostics.TraceSource</RootNamespace>
<AssemblyName>System.Diagnostics.TraceSource</AssemblyName>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
<ProjectGuid>{5380420C-EB1D-4C53-9CFC-916578C18334}</ProjectGuid>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'net463'">true</IsPartialFacadeAssembly>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="FxCopBaseline.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp'">
<Compile Include="System\Diagnostics\BooleanSwitch.cs" />
<Compile Include="System\Diagnostics\CorrelationManager.cs" />
<Compile Include="System\Diagnostics\DefaultTraceListener.cs" />
<Compile Include="System\Diagnostics\DiagnosticsConfiguration.cs" />
<Compile Include="System\Diagnostics\SeverityFilter.cs" />
<Compile Include="System\Diagnostics\SourceFilter.cs" />
<Compile Include="System\Diagnostics\SourceLevels.cs" />
<Compile Include="System\Diagnostics\SourceSwitch.cs" />
<Compile Include="System\Diagnostics\Switch.cs" />
<Compile Include="System\Diagnostics\Trace.cs" />
<Compile Include="System\Diagnostics\TraceEventCache.cs" />
<Compile Include="System\Diagnostics\TraceEventType.cs" />
<Compile Include="System\Diagnostics\TraceFilter.cs" />
<Compile Include="System\Diagnostics\TraceInternal.cs" />
<Compile Include="System\Diagnostics\TraceLevel.cs" />
<Compile Include="System\Diagnostics\TraceListener.cs" />
<Compile Include="System\Diagnostics\TraceListeners.cs" />
<Compile Include="System\Diagnostics\TraceOptions.cs" />
<Compile Include="System\Diagnostics\TraceSource.cs" />
<Compile Include="System\Diagnostics\TraceSwitch.cs" />
<Compile Include="System\Diagnostics\SwitchAttribute.cs" />
<Compile Include="System\Diagnostics\SwitchLevelAttribute.cs" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetsWindows)' == 'true' And '$(TargetGroup)' == 'netcoreapp'">
<Compile Include="System\Diagnostics\TraceEventCache.Windows.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
<Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.GetCurrentProcessId.cs">
<Link>Common\Interop\Windows\Interop.GetCurrentProcessId.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition=" '$(TargetsUnix)' == 'true' And '$(TargetGroup)' == 'netcoreapp'">
<Compile Include="$(CommonPath)\Interop\Unix\Interop.Libraries.cs">
<Link>Common\Interop\Unix\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Unix\System.Native\Interop.GetPid.cs">
<Link>Common\Interop\Unix\Interop.GetPid.cs</Link>
</Compile>
<Compile Include="System\Diagnostics\TraceEventCache.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'net463'">
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="System" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Collections" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Collections.Specialized" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Diagnostics.Tools" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Threading" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,55 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System;
namespace System.Diagnostics
{
/// <devdoc>
/// <para>Provides a simple on/off switch that can be used to control debugging and tracing
/// output.</para>
/// </devdoc>
public class BooleanSwitch : Switch
{
/// <devdoc>
/// <para>Initializes a new instance of the <see cref='System.Diagnostics.BooleanSwitch'/>
/// class.</para>
/// </devdoc>
public BooleanSwitch(string displayName, string description)
: base(displayName, description)
{
}
public BooleanSwitch(string displayName, string description, string defaultSwitchValue)
: base(displayName, description, defaultSwitchValue)
{ }
/// <devdoc>
/// <para>Specifies whether the switch is enabled
/// (<see langword='true'/>) or disabled (<see langword='false'/>).</para>
/// </devdoc>
public bool Enabled
{
get
{
return (SwitchSetting == 0) ? false : true;
}
set
{
SwitchSetting = value ? 1 : 0;
}
}
protected override void OnValueChanged()
{
bool b;
if (Boolean.TryParse(Value, out b))
SwitchSetting = (b ? 1 : 0);
else
base.OnValueChanged();
}
}
}

View File

@@ -0,0 +1,143 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
namespace System.Diagnostics
{
public class CorrelationManager
{
private readonly AsyncLocal<Guid> _activityId = new AsyncLocal<Guid>();
private readonly AsyncLocal<StackNode> _stack = new AsyncLocal<StackNode>();
private readonly Stack _stackWrapper;
internal CorrelationManager()
{
_stackWrapper = new AsyncLocalStackWrapper(_stack);
}
public Stack LogicalOperationStack => _stackWrapper;
public void StartLogicalOperation() => StartLogicalOperation(Guid.NewGuid());
public void StopLogicalOperation() => _stackWrapper.Pop();
public Guid ActivityId { get { return _activityId.Value; } set { _activityId.Value = value; } }
public void StartLogicalOperation(object operationId)
{
if (operationId == null)
{
throw new ArgumentNullException(nameof(operationId));
}
_stackWrapper.Push(operationId);
}
private sealed class StackNode
{
internal StackNode(object value, StackNode prev = null)
{
Value = value;
Prev = prev;
Count = prev != null ? prev.Count + 1 : 1;
}
internal int Count { get; }
internal object Value { get; }
internal StackNode Prev { get; }
}
private sealed class AsyncLocalStackWrapper : Stack
{
private readonly AsyncLocal<StackNode> _stack;
internal AsyncLocalStackWrapper(AsyncLocal<StackNode> stack)
{
Debug.Assert(stack != null);
_stack = stack;
}
public override void Clear() => _stack.Value = null;
public override object Clone() => new AsyncLocalStackWrapper(_stack);
public override int Count => _stack.Value?.Count ?? 0;
public override IEnumerator GetEnumerator() => GetEnumerator(_stack.Value);
public override object Peek() => _stack.Value?.Value;
public override bool Contains(object obj)
{
for (StackNode n = _stack.Value; n != null; n = n.Prev)
{
if (obj == null)
{
if (n.Value == null) return true;
}
else if (obj.Equals(n.Value))
{
return true;
}
}
return false;
}
public override void CopyTo(Array array, int index)
{
for (StackNode n = _stack.Value; n != null; n = n.Prev)
{
array.SetValue(n.Value, index++);
}
}
private IEnumerator GetEnumerator(StackNode n)
{
while (n != null)
{
yield return n.Value;
n = n.Prev;
}
}
public override object Pop()
{
StackNode n = _stack.Value;
if (n == null)
{
base.Pop();
}
_stack.Value = n.Prev;
return n.Value;
}
public override void Push(object obj)
{
_stack.Value = new StackNode(obj, _stack.Value);
}
public override object[] ToArray()
{
StackNode n = _stack.Value;
if (n == null)
{
return Array.Empty<object>();
}
var results = new List<object>();
do
{
results.Add(n.Value);
n = n.Prev;
}
while (n != null);
return results.ToArray();
}
}
}
}

View File

@@ -0,0 +1,151 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#define DEBUG
#define TRACE
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.Runtime.InteropServices;
using System.Globalization;
namespace System.Diagnostics
{
/// <devdoc>
/// <para>Provides
/// the default output methods and behavior for tracing.</para>
/// </devdoc>
public class DefaultTraceListener : TraceListener
{
private const int InternalWriteSize = 16384;
private bool _assertUIEnabled;
private bool _settingsInitialized;
private string _logFileName;
/// <devdoc>
/// <para>Initializes a new instance of the <see cref='System.Diagnostics.DefaultTraceListener'/> class with
/// Default as its <see cref='System.Diagnostics.TraceListener.Name'/>.</para>
/// </devdoc>
public DefaultTraceListener()
: base("Default")
{
}
public bool AssertUiEnabled
{
get
{
if (!_settingsInitialized) InitializeSettings();
return _assertUIEnabled;
}
set
{
if (!_settingsInitialized) InitializeSettings();
_assertUIEnabled = value;
}
}
public string LogFileName
{
get
{
if (!_settingsInitialized) InitializeSettings();
return _logFileName;
}
set
{
if (!_settingsInitialized) InitializeSettings();
_logFileName = value;
}
}
/// <devdoc>
/// <para>
/// Emits or displays a message
/// and a stack trace for an assertion that
/// always fails.
/// </para>
/// </devdoc>
public override void Fail(string message)
{
Fail(message, null);
}
/// <devdoc>
/// <para>
/// Emits or displays messages and a stack trace for an assertion that
/// always fails.
/// </para>
/// </devdoc>
public override void Fail(string message, string detailMessage)
{
// UIAssert is not enabled.
WriteAssert(String.Empty, message, detailMessage);
}
private void InitializeSettings()
{
// don't use the property setters here to avoid infinite recursion.
_assertUIEnabled = DiagnosticsConfiguration.AssertUIEnabled;
_logFileName = DiagnosticsConfiguration.LogFileName;
_settingsInitialized = true;
}
private void WriteAssert(string stackTrace, string message, string detailMessage)
{
string assertMessage = SR.DebugAssertBanner + Environment.NewLine
+ SR.DebugAssertShortMessage + Environment.NewLine
+ message + Environment.NewLine
+ SR.DebugAssertLongMessage + Environment.NewLine +
detailMessage + Environment.NewLine
+ stackTrace;
WriteLine(assertMessage);
// In case the debugger is attached we break the debugger.
if (Debugger.IsAttached)
Debugger.Break();
}
/// <devdoc>
/// <para>
/// Writes the output using <see cref="System.Diagnostics.Debug.Write"/>.
/// </para>
/// </devdoc>
public override void Write(string message)
{
if (NeedIndent) WriteIndent();
// really huge messages mess up both VS and dbmon, so we chop it up into
// reasonable chunks if it's too big
if (message == null || message.Length <= InternalWriteSize)
{
Debug.Write(message);
}
else
{
int offset;
for (offset = 0; offset < message.Length - InternalWriteSize; offset += InternalWriteSize)
{
Debug.Write(message.Substring(offset, InternalWriteSize));
}
Debug.Write(message.Substring(offset));
}
}
/// <devdoc>
/// <para>
/// Writes the output followed by a line terminator using <see cref="System.Diagnostics.Debug.Write"/>.
/// </para>
/// </devdoc>
public override void WriteLine(string message)
{
if (NeedIndent) WriteIndent();
// I do the concat here to make sure it goes as one call to the output.
// we would save a stringbuilder operation by calling Write twice.
Write(message + Environment.NewLine);
NeedIndent = true;
}
}
}

View File

@@ -0,0 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections;
namespace System.Diagnostics
{
internal static class DiagnosticsConfiguration
{
// setting for TraceInternal.AutoFlush
internal static bool AutoFlush => false; // the default
// setting for TraceInternal.UseGlobalLock
internal static bool UseGlobalLock => true; // the default
// setting for TraceInternal.IndentSize
internal static int IndentSize => 4; // the default
internal static bool AssertUIEnabled => true; // the default
internal static string LogFileName => string.Empty; // the default
}
}

View File

@@ -0,0 +1,36 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace System.Diagnostics
{
public class EventTypeFilter : TraceFilter
{
private SourceLevels _level;
public EventTypeFilter(SourceLevels level)
{
_level = level;
}
public override bool ShouldTrace(TraceEventCache cache, string source, TraceEventType eventType, int id, string formatOrMessage,
object[] args, object data1, object[] data)
{
return ((int)eventType & (int)_level) != 0;
}
public SourceLevels EventType
{
get
{
return _level;
}
set
{
_level = value;
}
}
}
}

View File

@@ -0,0 +1,43 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections;
namespace System.Diagnostics
{
public class SourceFilter : TraceFilter
{
private string _src;
public SourceFilter(string source)
{
Source = source;
}
public override bool ShouldTrace(TraceEventCache cache, string source, TraceEventType eventType, int id, string formatOrMessage,
object[] args, object data1, object[] data)
{
if (source == null)
throw new ArgumentNullException(nameof(source));
return String.Equals(_src, source);
}
public String Source
{
get
{
return _src;
}
set
{
if (value == null)
throw new ArgumentNullException(nameof(Source));
_src = value;
}
}
}
}

View File

@@ -0,0 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ComponentModel;
namespace System.Diagnostics
{
[Flags]
public enum SourceLevels
{
Off = 0,
Critical = 0x01,
Error = 0x03,
Warning = 0x07,
Information = 0x0F,
Verbose = 0x1F,
[EditorBrowsable(EditorBrowsableState.Advanced)]
ActivityTracing = 0xFF00,
All = unchecked((int)0xFFFFFFFF),
}
}

View File

@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections;
namespace System.Diagnostics
{
public class SourceSwitch : Switch
{
public SourceSwitch(string name) : base(name, String.Empty) { }
public SourceSwitch(string displayName, string defaultSwitchValue)
: base(displayName, String.Empty, defaultSwitchValue)
{ }
public SourceLevels Level
{
get
{
return (SourceLevels)SwitchSetting;
}
set
{
SwitchSetting = (int)value;
}
}
public bool ShouldTrace(TraceEventType eventType)
{
return (SwitchSetting & (int)eventType) != 0;
}
protected override void OnValueChanged()
{
SwitchSetting = (int)Enum.Parse(typeof(SourceLevels), Value, true);
}
}
}

View File

@@ -0,0 +1,261 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Threading;
using System.Runtime.InteropServices;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
namespace System.Diagnostics
{
/// <devdoc>
/// <para>Provides an <see langword='abstract '/>base class to
/// create new debugging and tracing switches.</para>
/// </devdoc>
public abstract class Switch
{
private readonly string _description;
private readonly string _displayName;
private int _switchSetting = 0;
private volatile bool _initialized = false;
private bool _initializing = false;
private volatile string _switchValueString = String.Empty;
private string _defaultValue;
private object _intializedLock;
private static List<WeakReference> s_switches = new List<WeakReference>();
private static int s_LastCollectionCount;
private StringDictionary _attributes;
private object IntializedLock
{
[SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "Reviewed for thread-safety")]
get
{
if (_intializedLock == null)
{
Object o = new Object();
Interlocked.CompareExchange<Object>(ref _intializedLock, o, null);
}
return _intializedLock;
}
}
/// <devdoc>
/// <para>Initializes a new instance of the <see cref='System.Diagnostics.Switch'/>
/// class.</para>
/// </devdoc>
protected Switch(string displayName, string description) : this(displayName, description, "0")
{
}
protected Switch(string displayName, string description, string defaultSwitchValue)
{
// displayName is used as a hashtable key, so it can never
// be null.
if (displayName == null) displayName = string.Empty;
_displayName = displayName;
_description = description;
// Add a weakreference to this switch and cleanup invalid references
lock (s_switches)
{
_pruneCachedSwitches();
s_switches.Add(new WeakReference(this));
}
_defaultValue = defaultSwitchValue;
}
private static void _pruneCachedSwitches()
{
lock (s_switches)
{
if (s_LastCollectionCount != GC.CollectionCount(2))
{
List<WeakReference> buffer = new List<WeakReference>(s_switches.Count);
for (int i = 0; i < s_switches.Count; i++)
{
Switch s = ((Switch)s_switches[i].Target);
if (s != null)
{
buffer.Add(s_switches[i]);
}
}
if (buffer.Count < s_switches.Count)
{
s_switches.Clear();
s_switches.AddRange(buffer);
s_switches.TrimExcess();
}
s_LastCollectionCount = GC.CollectionCount(2);
}
}
}
/// <devdoc>
/// <para>Gets a name used to identify the switch.</para>
/// </devdoc>
public string DisplayName
{
get
{
return _displayName;
}
}
/// <devdoc>
/// <para>Gets a description of the switch.</para>
/// </devdoc>
public string Description
{
get
{
return (_description == null) ? string.Empty : _description;
}
}
public StringDictionary Attributes
{
get
{
Initialize();
if (_attributes == null)
_attributes = new StringDictionary();
return _attributes;
}
}
/// <devdoc>
/// <para>
/// Indicates the current setting for this switch.
/// </para>
/// </devdoc>
protected int SwitchSetting
{
[SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "reviewed for thread-safety")]
get
{
if (!_initialized)
{
if (InitializeWithStatus())
OnSwitchSettingChanged();
}
return _switchSetting;
}
[SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "reviewed for thread-safety")]
set
{
bool didUpdate = false;
lock (IntializedLock)
{
_initialized = true;
if (_switchSetting != value)
{
_switchSetting = value;
didUpdate = true;
}
}
if (didUpdate)
{
OnSwitchSettingChanged();
}
}
}
protected internal virtual string[] GetSupportedAttributes() => null;
protected string Value
{
get
{
Initialize();
return _switchValueString;
}
set
{
Initialize();
_switchValueString = value;
OnValueChanged();
}
}
private void Initialize()
{
InitializeWithStatus();
}
private bool InitializeWithStatus()
{
if (!_initialized)
{
lock (IntializedLock)
{
if (_initialized || _initializing)
{
return false;
}
// This method is re-entrent during initialization, since calls to OnValueChanged() in subclasses could end up having InitializeWithStatus()
// called again, we don't want to get caught in an infinite loop.
_initializing = true;
_switchValueString = _defaultValue;
OnValueChanged();
_initialized = true;
_initializing = false;
}
}
return true;
}
/// <devdoc>
/// This method is invoked when a switch setting has been changed. It will
/// be invoked the first time a switch reads its value from the registry
/// or environment, and then it will be invoked each time the switch's
/// value is changed.
/// </devdoc>
protected virtual void OnSwitchSettingChanged()
{
}
protected virtual void OnValueChanged()
{
SwitchSetting = Int32.Parse(Value, CultureInfo.InvariantCulture);
}
internal static void RefreshAll()
{
lock (s_switches)
{
_pruneCachedSwitches();
for (int i = 0; i < s_switches.Count; i++)
{
Switch swtch = ((Switch)s_switches[i].Target);
if (swtch != null)
{
swtch.Refresh();
}
}
}
}
internal void Refresh()
{
lock (IntializedLock)
{
_initialized = false;
Initialize();
}
}
}
}

View File

@@ -0,0 +1,92 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Reflection;
using System.Collections.Generic;
namespace System.Diagnostics
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor |
AttributeTargets.Event | AttributeTargets.Method | AttributeTargets.Property)]
public sealed class SwitchAttribute : Attribute
{
private Type _type;
private string _name;
public SwitchAttribute(string switchName, Type switchType)
{
SwitchName = switchName;
SwitchType = switchType;
}
public string SwitchName
{
get { return _name; }
set
{
if (value == null)
throw new ArgumentNullException(nameof(value));
if (value.Length == 0)
throw new ArgumentException(SR.Format(SR.InvalidNullEmptyArgument, nameof(value)), nameof(value));
_name = value;
}
}
public Type SwitchType
{
get { return _type; }
set
{
if (value == null)
throw new ArgumentNullException(nameof(value));
_type = value;
}
}
public string SwitchDescription { get; set; }
public static SwitchAttribute[] GetAll(Assembly assembly)
{
if (assembly == null)
throw new ArgumentNullException(nameof(assembly));
List<object> switchAttribs = new List<object>();
object[] attribs = assembly.GetCustomAttributes(typeof(SwitchAttribute), false);
switchAttribs.AddRange(attribs);
foreach (Type type in assembly.GetTypes())
{
GetAllRecursive(type, switchAttribs);
}
SwitchAttribute[] ret = new SwitchAttribute[switchAttribs.Count];
switchAttribs.CopyTo(ret, 0);
return ret;
}
static void GetAllRecursive(Type type, List<object> switchAttribs)
{
GetAllRecursive((MemberInfo)type, switchAttribs);
MemberInfo[] members = type.GetMembers(BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.DeclaredOnly | BindingFlags.Instance |
BindingFlags.Static);
foreach (MemberInfo member in members)
{
// ignore Types here. They will get covered by the top level assembly.GetTypes
if (!(member is Type))
GetAllRecursive(member, switchAttribs);
}
}
static void GetAllRecursive(MemberInfo member, List<object> switchAttribs)
{
object[] attribs = member.GetCustomAttributes(typeof(SwitchAttribute), false);
switchAttribs.AddRange(attribs);
}
}
}

View File

@@ -0,0 +1,29 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace System.Diagnostics
{
[AttributeUsage(AttributeTargets.Class)]
public sealed class SwitchLevelAttribute : Attribute
{
private Type _type;
public SwitchLevelAttribute(Type switchLevelType)
{
SwitchLevelType = switchLevelType;
}
public Type SwitchLevelType
{
get { return _type; }
set
{
if (value == null)
throw new ArgumentNullException(nameof(value));
_type = value;
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More