Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- XmlUnspecifiedAttribute.cs
- NetPipeSection.cs
- ExtractorMetadata.cs
- SchemaImporter.cs
- TraceHandler.cs
- LocatorPart.cs
- HtmlLabelAdapter.cs
- Subtree.cs
- WindowsGraphics2.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MDIClient.cs
- PaperSource.cs
- MatchingStyle.cs
- LinqDataSourceDeleteEventArgs.cs
- _DigestClient.cs
- WebPartsPersonalizationAuthorization.cs
- DataGridViewAutoSizeModeEventArgs.cs
- SystemWebSectionGroup.cs
- EastAsianLunisolarCalendar.cs
- RenamedEventArgs.cs
- TextEndOfParagraph.cs
- GlobalizationSection.cs
- XmlComplianceUtil.cs
- xsdvalidator.cs
- SchemaImporter.cs
- XmlSchemaProviderAttribute.cs
- GridViewHeaderRowPresenter.cs
- ExceptionHandler.cs
- TraceXPathNavigator.cs
- PerformanceCountersElement.cs
- XmlRawWriter.cs
- ImportCatalogPart.cs
- CircleHotSpot.cs
- UserValidatedEventArgs.cs
- WsatTransactionInfo.cs
- ToolStripDropDownClosedEventArgs.cs
- HtmlFormWrapper.cs
- XmlElementAttributes.cs
- DeflateStream.cs
- PasswordDeriveBytes.cs
- CombinedTcpChannel.cs
- WebProxyScriptElement.cs
- SafeNativeMemoryHandle.cs
- PeerApplication.cs
- NumberFormatter.cs
- WebDisplayNameAttribute.cs
- DbTransaction.cs
- XsltConvert.cs
- SimpleType.cs
- Table.cs
- EventRouteFactory.cs
- ColorPalette.cs
- DesignerInterfaces.cs
- GuidelineSet.cs
- ScriptReferenceEventArgs.cs
- WebPartEventArgs.cs
- ConversionContext.cs
- DeadCharTextComposition.cs
- RoleGroupCollection.cs
- FlowLayoutSettings.cs
- TitleStyle.cs
- ModifiableIteratorCollection.cs
- ValidatingReaderNodeData.cs
- ElementHostAutomationPeer.cs
- ConfigLoader.cs
- HttpVersion.cs
- CollectionViewGroupRoot.cs
- StringUtil.cs
- HttpContext.cs
- PageThemeBuildProvider.cs
- ValueTypeFixupInfo.cs
- SchemaImporterExtension.cs
- Util.cs
- DataTableClearEvent.cs
- Popup.cs
- DocumentAutomationPeer.cs
- SecurityPolicySection.cs
- DesignTimeTemplateParser.cs
- DataObjectPastingEventArgs.cs
- UnionExpr.cs
- SiteMapNode.cs
- RtType.cs
- DataGridView.cs
- XamlReader.cs
- precedingsibling.cs
- IdentityModelStringsVersion1.cs
- XslNumber.cs
- InternalResources.cs
- compensatingcollection.cs
- TableSectionStyle.cs
- CodeTypeOfExpression.cs
- ColumnPropertiesGroup.cs
- EventWaitHandleSecurity.cs
- TypeListConverter.cs
- Tokenizer.cs
- SelectionChangedEventArgs.cs
- MethodRental.cs
- CreateBookmarkScope.cs
- DataTableExtensions.cs
- FamilyTypefaceCollection.cs