You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1,56 @@
|
||||
//----------------------------------------------------------------
|
||||
// <copyright company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.VisualStudio.Activities
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics.Eventing;
|
||||
|
||||
internal class VSDesignerPerfEventProvider
|
||||
{
|
||||
private EventProvider provider = null;
|
||||
|
||||
public VSDesignerPerfEventProvider()
|
||||
{
|
||||
try
|
||||
{
|
||||
this.provider = new EventProvider(new Guid("{92C79DA3-CA7D-43d6-BF20-BBD15E7A4E49}"));
|
||||
}
|
||||
catch (PlatformNotSupportedException)
|
||||
{
|
||||
this.provider = null;
|
||||
}
|
||||
}
|
||||
|
||||
internal void WriteEvent(VSDesignerPerfEvents perfEvent)
|
||||
{
|
||||
if (this.IsEnabled())
|
||||
{
|
||||
this.WriteEventHelper((int)perfEvent);
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsEnabled()
|
||||
{
|
||||
bool isEnabled = false;
|
||||
if (this.provider != null)
|
||||
{
|
||||
isEnabled = this.provider.IsEnabled();
|
||||
}
|
||||
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
private void WriteEventHelper(int eventId)
|
||||
{
|
||||
if (this.provider != null)
|
||||
{
|
||||
EventDescriptor descriptor = new EventDescriptor(eventId, 0, 0, 0, 0, 0, 0);
|
||||
this.provider.WriteEvent(ref descriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
//----------------------------------------------------------------
|
||||
// <copyright company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.VisualStudio.Activities
|
||||
{
|
||||
internal enum VSDesignerPerfEvents
|
||||
{
|
||||
XamlBuildTaskExecuteStart = 29,
|
||||
XamlBuildTaskExecuteEnd = 30,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user