Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Shared / MS / Utility / PerfService.cs / 1 / PerfService.cs
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description: Implements the Service class for perf diagnostics
//
// History
// 05/25/06 kiranku Created
//
//---------------------------------------------------------------------------
using System;
using System.Text;
using System.Windows;
using Microsoft.Win32;
using MS.Internal;
using MS.Utility;
using MS.Internal.PresentationCore;
namespace MS.Utility
{
///
/// PerfService loads the PerfDiagnosisHelp.dll and launchs the service.
///
[FriendAccessAllowed]
static internal class PerfService
{
#region internal Properties
///
/// Perfservice uses this property to uniquely identfy each element in the tree.
/// this ID gets traced with ETW traces and gets mapped to the element in the tool
/// value is valid only if the service is running
///
internal static long GetPerfElementID(UIElement element)
{
if ((PerfElementIDProperty != null) && (element != null))
{
return (long)element.GetValue(PerfElementIDProperty);
}
return 0;
}
///
/// Perfservice uses this property to uniquely identfy each element in the tree.
/// this ID gets traced with ETW traces and gets mapped to the element in the tool
/// value is valid only if the service is running
///
internal static void SetPerfElementID(UIElement element, long value)
{
if ((PerfElementIDProperty != null) && (element != null))
{
element.SetValue(PerfElementIDProperty, value);
}
return ;
}
#endregion internal Properties
internal static readonly DependencyProperty PerfElementIDProperty = DependencyProperty.RegisterAttached(
"PerfElementID",
typeof(long),
typeof(PerfService),
new PropertyMetadata((long)0));
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
//
// Description: Implements the Service class for perf diagnostics
//
// History
// 05/25/06 kiranku Created
//
//---------------------------------------------------------------------------
using System;
using System.Text;
using System.Windows;
using Microsoft.Win32;
using MS.Internal;
using MS.Utility;
using MS.Internal.PresentationCore;
namespace MS.Utility
{
///
/// PerfService loads the PerfDiagnosisHelp.dll and launchs the service.
///
[FriendAccessAllowed]
static internal class PerfService
{
#region internal Properties
///
/// Perfservice uses this property to uniquely identfy each element in the tree.
/// this ID gets traced with ETW traces and gets mapped to the element in the tool
/// value is valid only if the service is running
///
internal static long GetPerfElementID(UIElement element)
{
if ((PerfElementIDProperty != null) && (element != null))
{
return (long)element.GetValue(PerfElementIDProperty);
}
return 0;
}
///
/// Perfservice uses this property to uniquely identfy each element in the tree.
/// this ID gets traced with ETW traces and gets mapped to the element in the tool
/// value is valid only if the service is running
///
internal static void SetPerfElementID(UIElement element, long value)
{
if ((PerfElementIDProperty != null) && (element != null))
{
element.SetValue(PerfElementIDProperty, value);
}
return ;
}
#endregion internal Properties
internal static readonly DependencyProperty PerfElementIDProperty = DependencyProperty.RegisterAttached(
"PerfElementID",
typeof(long),
typeof(PerfService),
new PropertyMetadata((long)0));
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CLSCompliantAttribute.cs
- CompiledRegexRunnerFactory.cs
- AppDomainCompilerProxy.cs
- DataBoundLiteralControl.cs
- LoginNameDesigner.cs
- LinqDataSource.cs
- ContainerParagraph.cs
- ZoneButton.cs
- DataGridViewControlCollection.cs
- CheckBoxPopupAdapter.cs
- ConnectivityStatus.cs
- TransactionalPackage.cs
- UpdatePanelControlTrigger.cs
- XmlSchemaComplexContentExtension.cs
- VisualStyleElement.cs
- TextParagraph.cs
- Utils.cs
- DbConnectionFactory.cs
- LocatorBase.cs
- ControlEvent.cs
- FontSourceCollection.cs
- AutomationIdentifierGuids.cs
- FamilyTypeface.cs
- OleDbError.cs
- SafeRightsManagementPubHandle.cs
- HtmlTableRowCollection.cs
- Validator.cs
- SslStream.cs
- ReflectEventDescriptor.cs
- XmlSchemaInfo.cs
- SurrogateEncoder.cs
- DataSetMappper.cs
- SecureConversationServiceElement.cs
- BaseCollection.cs
- TimerEventSubscriptionCollection.cs
- PackWebRequestFactory.cs
- SchemaConstraints.cs
- _SSPISessionCache.cs
- SystemWebCachingSectionGroup.cs
- StrokeCollectionDefaultValueFactory.cs
- VirtualDirectoryMappingCollection.cs
- CardSpaceSelector.cs
- ElementHostAutomationPeer.cs
- EnterpriseServicesHelper.cs
- StringConverter.cs
- ListView.cs
- PngBitmapEncoder.cs
- WorkerRequest.cs
- OneOfScalarConst.cs
- IriParsingElement.cs
- SemanticResultKey.cs
- ProcessHost.cs
- StatusCommandUI.cs
- ColorBuilder.cs
- CompositeActivityTypeDescriptorProvider.cs
- OuterGlowBitmapEffect.cs
- MouseCaptureWithinProperty.cs
- Serializer.cs
- ExpandableObjectConverter.cs
- SocketPermission.cs
- GridViewPageEventArgs.cs
- StrongName.cs
- GACMembershipCondition.cs
- ListViewDeleteEventArgs.cs
- SystemWebSectionGroup.cs
- BulletedListEventArgs.cs
- TextBoxView.cs
- SID.cs
- TabControl.cs
- RenderTargetBitmap.cs
- TextRenderer.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- WindowInteractionStateTracker.cs
- WsdlInspector.cs
- Parameter.cs
- PieceNameHelper.cs
- SmtpReplyReader.cs
- COM2ComponentEditor.cs
- HwndSubclass.cs
- ReturnValue.cs
- DbConvert.cs
- HttpListenerElement.cs
- ExpanderAutomationPeer.cs
- StringToken.cs
- FileDialogPermission.cs
- TaiwanLunisolarCalendar.cs
- LocatorManager.cs
- InsufficientExecutionStackException.cs
- DataFormats.cs
- SourceFilter.cs
- ObjectListSelectEventArgs.cs
- TreeNodeBinding.cs
- DataGridLengthConverter.cs
- SizeKeyFrameCollection.cs
- Executor.cs
- DecimalAnimationUsingKeyFrames.cs
- ToolStripItemTextRenderEventArgs.cs
- XmlWrappingReader.cs
- WindowsAltTab.cs
- ObjectDesignerDataSourceView.cs