Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventKeyword.cs / 1305376 / EventKeyword.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventKeyword ** ** Purpose: ** This public class describes the metadata for a specific Keyword ** defined by a Provider. An instance of this class is obtained from ** a ProviderMetadata object. ** ============================================================*/ using System.Collections.Generic; namespace System.Diagnostics.Eventing.Reader { ////// Describes the metadata for a specific Keyword defined by a Provider. /// An instance of this class is obtained from a ProviderMetadata object. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventKeyword { private long value; private string name; private string displayName; private bool dataReady; ProviderMetadata pmReference; object syncObject; //called from EventMetadata internal EventKeyword(long value, ProviderMetadata pmReference) { this.value = value; this.pmReference = pmReference; this.syncObject = new object(); } //called from ProviderMetadata internal EventKeyword(string name, long value, string displayName) { this.value = value; this.name = name; this.displayName = displayName; this.dataReady = true; this.syncObject = new object(); } internal void PrepareData() { if (dataReady == true) return; lock (syncObject) { if (dataReady == true) return; IEnumerableresult = pmReference.Keywords; this.name = null; this.displayName = null; this.dataReady = true; foreach (EventKeyword key in result) { if (key.Value == this.value) { this.name = key.Name; this.displayName = key.DisplayName; break; } } } } public string Name { get { PrepareData(); return this.name; } } public long Value { get { return this.value; } } public string DisplayName { get { PrepareData(); return this.displayName; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventKeyword ** ** Purpose: ** This public class describes the metadata for a specific Keyword ** defined by a Provider. An instance of this class is obtained from ** a ProviderMetadata object. ** ============================================================*/ using System.Collections.Generic; namespace System.Diagnostics.Eventing.Reader { /// /// Describes the metadata for a specific Keyword defined by a Provider. /// An instance of this class is obtained from a ProviderMetadata object. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventKeyword { private long value; private string name; private string displayName; private bool dataReady; ProviderMetadata pmReference; object syncObject; //called from EventMetadata internal EventKeyword(long value, ProviderMetadata pmReference) { this.value = value; this.pmReference = pmReference; this.syncObject = new object(); } //called from ProviderMetadata internal EventKeyword(string name, long value, string displayName) { this.value = value; this.name = name; this.displayName = displayName; this.dataReady = true; this.syncObject = new object(); } internal void PrepareData() { if (dataReady == true) return; lock (syncObject) { if (dataReady == true) return; IEnumerableresult = pmReference.Keywords; this.name = null; this.displayName = null; this.dataReady = true; foreach (EventKeyword key in result) { if (key.Value == this.value) { this.name = key.Name; this.displayName = key.DisplayName; break; } } } } public string Name { get { PrepareData(); return this.name; } } public long Value { get { return this.value; } } public string DisplayName { get { PrepareData(); return this.displayName; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Accessible.cs
- XmlFileEditor.cs
- DrawingVisual.cs
- ItemList.cs
- ValidationVisibilityAttribute.cs
- ResourceContainer.cs
- EventLog.cs
- PageAdapter.cs
- XmlNavigatorStack.cs
- Visual3DCollection.cs
- ExceptionUtil.cs
- InstanceKeyCollisionException.cs
- CrossSiteScriptingValidation.cs
- PixelFormats.cs
- CodeAttributeDeclaration.cs
- CoTaskMemUnicodeSafeHandle.cs
- CorrelationManager.cs
- DeclaredTypeElementCollection.cs
- EdmMember.cs
- ListParagraph.cs
- ZipIOBlockManager.cs
- Point4D.cs
- DbConnectionPoolIdentity.cs
- SByte.cs
- ListControl.cs
- TypeUnloadedException.cs
- MessagePartProtectionMode.cs
- XmlUtil.cs
- BooleanFunctions.cs
- _OverlappedAsyncResult.cs
- ComponentConverter.cs
- DefaultBinder.cs
- ComplexObject.cs
- ExpressionsCollectionConverter.cs
- KeyMatchBuilder.cs
- StorageModelBuildProvider.cs
- MULTI_QI.cs
- GlyphRunDrawing.cs
- RegexCapture.cs
- AutoCompleteStringCollection.cs
- ManifestResourceInfo.cs
- FlowDecision.cs
- InfoCardKeyedHashAlgorithm.cs
- HttpProfileBase.cs
- AlternateView.cs
- MethodAccessException.cs
- HttpPostedFileWrapper.cs
- HttpCookieCollection.cs
- HttpRawResponse.cs
- EventData.cs
- DataIdProcessor.cs
- TextElementCollection.cs
- X509SecurityToken.cs
- PlanCompilerUtil.cs
- SqlDataSourceQueryConverter.cs
- ServicesSection.cs
- HttpRuntimeSection.cs
- WebRequestModulesSection.cs
- XmlAnyAttributeAttribute.cs
- ErrorFormatterPage.cs
- BinarySerializer.cs
- BinaryReader.cs
- SpellerHighlightLayer.cs
- ToolStripPanelCell.cs
- WebPermission.cs
- CompilerWrapper.cs
- TreeNodeCollection.cs
- TileBrush.cs
- FrameworkElementFactory.cs
- PeerCollaborationPermission.cs
- PartialArray.cs
- AnnotationResource.cs
- ValidatorUtils.cs
- EventProvider.cs
- VariableQuery.cs
- XmlEntity.cs
- ChildrenQuery.cs
- ScriptReferenceBase.cs
- PropertyEmitterBase.cs
- GcSettings.cs
- DelegatingTypeDescriptionProvider.cs
- StreamUpdate.cs
- ObjectQuery.cs
- DrawToolTipEventArgs.cs
- CryptoApi.cs
- CodeAttributeDeclarationCollection.cs
- View.cs
- WebBrowserNavigatedEventHandler.cs
- BackgroundFormatInfo.cs
- SystemNetworkInterface.cs
- CircleHotSpot.cs
- ISFTagAndGuidCache.cs
- StructuredTypeEmitter.cs
- NamespaceList.cs
- StringArrayEditor.cs
- NavigationService.cs
- ColorContextHelper.cs
- ReadOnlyPropertyMetadata.cs
- XmlFormatReaderGenerator.cs
- NTAccount.cs