Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataServiceQuery.cs
- ExpressionList.cs
- XmlDictionaryWriter.cs
- MbpInfo.cs
- DuplicateWaitObjectException.cs
- DataRecordInfo.cs
- RectangleGeometry.cs
- AggregateNode.cs
- HttpModuleActionCollection.cs
- DisposableCollectionWrapper.cs
- WebPartConnectionsConfigureVerb.cs
- SelectedPathEditor.cs
- SpellerStatusTable.cs
- DataRowComparer.cs
- MappingException.cs
- ExpanderAutomationPeer.cs
- TraceContext.cs
- control.ime.cs
- HttpCookiesSection.cs
- HostingEnvironment.cs
- InkCanvasFeedbackAdorner.cs
- SharedPerformanceCounter.cs
- DateTimeFormat.cs
- LazyTextWriterCreator.cs
- UnsignedPublishLicense.cs
- LogicalChannel.cs
- Registration.cs
- DbMetaDataCollectionNames.cs
- connectionpool.cs
- MailHeaderInfo.cs
- DataTableReader.cs
- Simplifier.cs
- TextServicesDisplayAttribute.cs
- DbResourceAllocator.cs
- HtmlInputButton.cs
- TemplateInstanceAttribute.cs
- mil_commands.cs
- SequenceDesigner.cs
- ToolStripSystemRenderer.cs
- PreProcessInputEventArgs.cs
- Pair.cs
- SqlTriggerContext.cs
- SqlDataReader.cs
- TextMetrics.cs
- EdmComplexPropertyAttribute.cs
- LocatorManager.cs
- Effect.cs
- CombinedGeometry.cs
- CollectionChangedEventManager.cs
- RtfNavigator.cs
- MemberListBinding.cs
- GetParentChain.cs
- ToolStripSystemRenderer.cs
- WS2007FederationHttpBindingCollectionElement.cs
- HashStream.cs
- SessionChannels.cs
- SafeEventLogWriteHandle.cs
- XmlDataProvider.cs
- Int32Animation.cs
- UIElementIsland.cs
- ProcessInputEventArgs.cs
- CodeSnippetTypeMember.cs
- DetailsViewUpdateEventArgs.cs
- MessageFilter.cs
- XmlAttribute.cs
- FrameworkPropertyMetadata.cs
- TimeoutConverter.cs
- RoleService.cs
- ConstNode.cs
- Translator.cs
- SQLInt64Storage.cs
- Pens.cs
- DocumentViewerBaseAutomationPeer.cs
- GenericWebPart.cs
- SmiMetaDataProperty.cs
- OdbcUtils.cs
- SqlTopReducer.cs
- XsltArgumentList.cs
- ToolStripContainer.cs
- RepeatBehavior.cs
- AsymmetricAlgorithm.cs
- GridEntryCollection.cs
- HttpDebugHandler.cs
- DataGridItemEventArgs.cs
- SymbolPair.cs
- Identity.cs
- Win32MouseDevice.cs
- PointAnimationClockResource.cs
- FramingEncoders.cs
- HelpKeywordAttribute.cs
- HttpCachePolicyElement.cs
- SqlUdtInfo.cs
- CodeTypeReferenceCollection.cs
- WebPartDesigner.cs
- CodeBinaryOperatorExpression.cs
- QuadraticBezierSegment.cs
- BidOverLoads.cs
- WebResourceUtil.cs
- Command.cs
- XmlSchemaType.cs