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
- Panel.cs
- counter.cs
- DEREncoding.cs
- UrlMappingCollection.cs
- OutputScopeManager.cs
- SingleAnimationBase.cs
- ToolStripDropDownClosedEventArgs.cs
- LinqDataSourceContextEventArgs.cs
- LinkedResourceCollection.cs
- QueryResults.cs
- WorkflowDefinitionDispenser.cs
- ActivityMarkupSerializationProvider.cs
- PropertyConverter.cs
- PrintEvent.cs
- SSmlParser.cs
- DispatcherHookEventArgs.cs
- PagesChangedEventArgs.cs
- StringFunctions.cs
- XPathChildIterator.cs
- XmlAttributeCollection.cs
- SmtpMail.cs
- CodeObjectCreateExpression.cs
- iisPickupDirectory.cs
- DataControlLinkButton.cs
- RawStylusSystemGestureInputReport.cs
- MediaContext.cs
- EventLog.cs
- Property.cs
- TransactedReceiveScope.cs
- Bits.cs
- TableItemProviderWrapper.cs
- KeyValueConfigurationCollection.cs
- CheckBoxBaseAdapter.cs
- WebConfigurationFileMap.cs
- SizeKeyFrameCollection.cs
- SMSvcHost.cs
- EmbossBitmapEffect.cs
- EncryptedKeyHashIdentifierClause.cs
- OutputBuffer.cs
- OdbcInfoMessageEvent.cs
- IfAction.cs
- TemplatePagerField.cs
- ResourceDescriptionAttribute.cs
- TemplateInstanceAttribute.cs
- DataGridViewCellStateChangedEventArgs.cs
- ConsoleTraceListener.cs
- CompositeScriptReference.cs
- RSAPKCS1SignatureFormatter.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DataStreams.cs
- SessionSymmetricTransportSecurityProtocolFactory.cs
- QilNode.cs
- DiagnosticTrace.cs
- SecurityTimestamp.cs
- CodeBinaryOperatorExpression.cs
- uribuilder.cs
- CollectionViewSource.cs
- RequestUriProcessor.cs
- Marshal.cs
- TreeNodeClickEventArgs.cs
- LineSegment.cs
- TextTreeDeleteContentUndoUnit.cs
- LinkConverter.cs
- SafeSecurityHandles.cs
- DirtyTextRange.cs
- InputManager.cs
- ParameterCollection.cs
- CodeGenHelper.cs
- FontSource.cs
- DataGridViewCheckBoxColumn.cs
- SessionState.cs
- OperandQuery.cs
- Storyboard.cs
- State.cs
- HttpMethodAttribute.cs
- MemberRelationshipService.cs
- DataSourceIDConverter.cs
- HwndProxyElementProvider.cs
- BlurEffect.cs
- DependencyPropertyKind.cs
- FreezableDefaultValueFactory.cs
- Int32Converter.cs
- UrlMappingsModule.cs
- PrePrepareMethodAttribute.cs
- CodePrimitiveExpression.cs
- BamlTreeMap.cs
- GeneralTransform3DGroup.cs
- CodeVariableDeclarationStatement.cs
- SamlConstants.cs
- XsltLibrary.cs
- IFlowDocumentViewer.cs
- FormatVersion.cs
- Perspective.cs
- ResourceDisplayNameAttribute.cs
- ElementNotEnabledException.cs
- FileIOPermission.cs
- ElementNotEnabledException.cs
- smtppermission.cs
- StylusTip.cs
- CompilationLock.cs