Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- UiaCoreTypesApi.cs
- DesignTimeDataBinding.cs
- TransmissionStrategy.cs
- EditorAttribute.cs
- PartialCachingControl.cs
- DescriptionAttribute.cs
- ApplicationSecurityInfo.cs
- DocumentReferenceCollection.cs
- TreeViewAutomationPeer.cs
- SQLBytes.cs
- TableLayoutCellPaintEventArgs.cs
- PassportIdentity.cs
- FamilyTypeface.cs
- DesignObjectWrapper.cs
- Point4D.cs
- CacheMemory.cs
- TreePrinter.cs
- WebPartCancelEventArgs.cs
- TemplateManager.cs
- GenericTypeParameterBuilder.cs
- XmlProcessingInstruction.cs
- EventData.cs
- SystemIPInterfaceStatistics.cs
- SoapSchemaExporter.cs
- ConfigurationSection.cs
- ReturnValue.cs
- ErrorsHelper.cs
- DataControlPagerLinkButton.cs
- SelfIssuedAuthRSACryptoProvider.cs
- BamlLocalizationDictionary.cs
- Transactions.cs
- XamlWrappingReader.cs
- TextElement.cs
- BaseCodePageEncoding.cs
- ComponentEditorForm.cs
- CreateRefExpr.cs
- PolyLineSegmentFigureLogic.cs
- RelationalExpressions.cs
- ProfileInfo.cs
- ContentFilePart.cs
- VisualStyleElement.cs
- UInt32Converter.cs
- WebBrowserPermission.cs
- ServiceHost.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- SafePipeHandle.cs
- HotSpot.cs
- WebPartAuthorizationEventArgs.cs
- SQLMoneyStorage.cs
- HitTestDrawingContextWalker.cs
- ListViewSortEventArgs.cs
- TerminatorSinks.cs
- AuthenticodeSignatureInformation.cs
- AncestorChangedEventArgs.cs
- XPathConvert.cs
- StrongBox.cs
- CommittableTransaction.cs
- NativeActivityMetadata.cs
- DirectionalLight.cs
- HttpPostedFile.cs
- RelativeSource.cs
- Size.cs
- DocumentApplication.cs
- BlockingCollection.cs
- MediaScriptCommandRoutedEventArgs.cs
- DataGridHeaderBorder.cs
- DesignerLoader.cs
- RoleGroup.cs
- Normalization.cs
- EditorOptionAttribute.cs
- FontFamilyIdentifier.cs
- WindowsRegion.cs
- RegexWriter.cs
- NameNode.cs
- MetadataItemEmitter.cs
- QilPatternVisitor.cs
- TagPrefixAttribute.cs
- ReaderWriterLockSlim.cs
- ProxyFragment.cs
- HttpRuntime.cs
- PerfCounterSection.cs
- PassportAuthentication.cs
- WebRequestModuleElementCollection.cs
- Rotation3DAnimation.cs
- Activation.cs
- LogicalTreeHelper.cs
- ObjectStorage.cs
- MTConfigUtil.cs
- WindowClosedEventArgs.cs
- OperationAbortedException.cs
- FormsAuthenticationCredentials.cs
- CheckBox.cs
- ListViewCancelEventArgs.cs
- DataFormats.cs
- Int16AnimationUsingKeyFrames.cs
- DefaultValidator.cs
- SecurityTokenResolver.cs
- DataSpaceManager.cs
- ImplicitInputBrush.cs
- CodeBlockBuilder.cs