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
- RepeaterItem.cs
- TextRangeEditLists.cs
- FrameSecurityDescriptor.cs
- EntityDescriptor.cs
- ComplexTypeEmitter.cs
- TextRangeBase.cs
- ClientConvert.cs
- DataColumnCollection.cs
- ProxyWebPartManagerDesigner.cs
- PermissionRequestEvidence.cs
- StateElement.cs
- DecimalKeyFrameCollection.cs
- Directory.cs
- Hashtable.cs
- SafeSecurityHelper.cs
- PreProcessor.cs
- AdRotatorDesigner.cs
- OpenFileDialog.cs
- DecoderFallback.cs
- WebScriptMetadataMessage.cs
- GridErrorDlg.cs
- GuidTagList.cs
- UnsafeMethods.cs
- SafeHandle.cs
- XmlSchemaProviderAttribute.cs
- DataTableMappingCollection.cs
- FocusManager.cs
- InputBinder.cs
- SerialPort.cs
- AudioException.cs
- ResourceCodeDomSerializer.cs
- DBCommandBuilder.cs
- RadioButtonList.cs
- ExceptionUtil.cs
- ApplicationException.cs
- DrawListViewColumnHeaderEventArgs.cs
- ObjectConverter.cs
- SmtpMail.cs
- AssemblyInfo.cs
- ServiceInfoCollection.cs
- MaskedTextBoxTextEditor.cs
- EntityDataSourceDesigner.cs
- EndpointDispatcherTable.cs
- ScrollData.cs
- GifBitmapEncoder.cs
- EndOfStreamException.cs
- URL.cs
- BooleanExpr.cs
- PasswordDeriveBytes.cs
- Attribute.cs
- DesignerWithHeader.cs
- SelectionProcessor.cs
- IdentityHolder.cs
- NullableFloatMinMaxAggregationOperator.cs
- DataGridViewLayoutData.cs
- InstanceNormalEvent.cs
- Operators.cs
- DataGridViewTextBoxColumn.cs
- ServiceHandle.cs
- InsufficientExecutionStackException.cs
- Transform3DGroup.cs
- JsonReaderDelegator.cs
- WindowsPen.cs
- SqlFactory.cs
- AnimationStorage.cs
- Debug.cs
- OutputWindow.cs
- MissingMemberException.cs
- ObjectNavigationPropertyMapping.cs
- SqlMethodAttribute.cs
- WriteableBitmap.cs
- LicenseContext.cs
- PkcsMisc.cs
- ScriptReference.cs
- DataMemberConverter.cs
- GridItemPattern.cs
- SpeakCompletedEventArgs.cs
- HTMLTextWriter.cs
- PropertySourceInfo.cs
- NavigationWindowAutomationPeer.cs
- DetectEofStream.cs
- DictionarySectionHandler.cs
- CodeCommentStatementCollection.cs
- ProcessInfo.cs
- ChangeInterceptorAttribute.cs
- AutomationEvent.cs
- OraclePermission.cs
- ToolStripDropDownItemDesigner.cs
- MetadataArtifactLoaderFile.cs
- ImageClickEventArgs.cs
- ILGenerator.cs
- CancelRequestedRecord.cs
- ScrollBarRenderer.cs
- HttpEncoderUtility.cs
- IncrementalCompileAnalyzer.cs
- InheritanceUI.cs
- SqlUserDefinedTypeAttribute.cs
- MasterPageCodeDomTreeGenerator.cs
- MailWebEventProvider.cs
- EDesignUtil.cs