Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 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,
}
}