Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Adding support for HttpHandlerDiagnosticListener. #18101

Merged
merged 6 commits into from
Apr 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public virtual void Dispose() { }
public bool IsEnabled() { throw null; }
public override bool IsEnabled(string name) { throw null; }
public override bool IsEnabled(string name, object arg1, object arg2 = null) { throw null; }
public System.IDisposable Subscribe(System.IObserver<System.Collections.Generic.KeyValuePair<string, object>> observer) { throw null; }
public virtual System.IDisposable Subscribe(System.IObserver<System.Collections.Generic.KeyValuePair<string, object>> observer) { throw null; }
public virtual System.IDisposable Subscribe(System.IObserver<System.Collections.Generic.KeyValuePair<string, object>> observer, System.Predicate<string> isEnabled) { throw null; }
public virtual System.IDisposable Subscribe(System.IObserver<System.Collections.Generic.KeyValuePair<string, object>> observer, System.Func<string, object, object, bool> isEnabled) { throw null; }
public override void Write(string name, object parameters) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<PropertyGroup Condition="'$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'net46' OR '$(TargetGroup)' == 'netfx'">
<DefineConstants>$(DefineConstants);ALLOW_PARTIALLY_TRUSTED_CALLERS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'net46'">
<DefineConstants>$(DefineConstants);NET46</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)' == 'netfx'">
<DefineConstants>$(DefineConstants);NETFX</DefineConstants>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net45-Windows_NT-Release|AnyCPU'" />
Expand Down Expand Up @@ -58,6 +64,9 @@
<ItemGroup Condition=" '$(TargetGroup)' == 'netcoreapp' OR '$(TargetGroup)' == 'netstandard' OR '$(TargetGroup)' == 'net45' OR '$(TargetGroup)' == 'net46' OR '$(TargetGroup)' == 'netfx'">
<Compile Include="System\Diagnostics\Activity.Id.MachineName.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'net46' OR '$(TargetGroup)' == 'netfx'">
<Compile Include="System\Diagnostics\HttpHandlerDiagnosticListener.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'net46' AND '$(TargetGroup)' != 'netfx'">
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Debug" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public static IObservable<DiagnosticListener> AllListeners
{
get
{
#if NET46 || NETFX
GC.KeepAlive(HttpHandlerDiagnosticListener.s_instance);
#endif

if (s_allListenerObservable == null)
{
s_allListenerObservable = new AllListenerObservable();
Expand Down Expand Up @@ -91,7 +95,7 @@ public virtual IDisposable Subscribe(IObserver<KeyValuePair<string, object>> obs
/// <summary>
/// Same as other Subscribe overload where the predicate is assumed to always return true.
/// </summary>
public IDisposable Subscribe(IObserver<KeyValuePair<string, object>> observer)
public virtual IDisposable Subscribe(IObserver<KeyValuePair<string, object>> observer)
{
return SubscribeInternal(observer, null, null);
}
Expand Down
Loading