Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@@ -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);
}
}
}
}

View File

@@ -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,
}
}