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
- FileSystemWatcher.cs
- Types.cs
- ChildTable.cs
- TransformedBitmap.cs
- XmlBaseReader.cs
- ObsoleteAttribute.cs
- StreamFormatter.cs
- TrackingRecord.cs
- PropertyPathWorker.cs
- BoolExpr.cs
- AdvancedBindingPropertyDescriptor.cs
- PhysicalAddress.cs
- Grid.cs
- DesignerCategoryAttribute.cs
- ShutDownListener.cs
- VerbConverter.cs
- SplitterCancelEvent.cs
- StorageFunctionMapping.cs
- PropertyItem.cs
- CheckedListBox.cs
- ProfileParameter.cs
- MessageHeaderT.cs
- ApplicationHost.cs
- CompensationDesigner.cs
- PageEventArgs.cs
- SequentialOutput.cs
- ToolBarButton.cs
- OdbcFactory.cs
- CodeMethodInvokeExpression.cs
- coordinatorscratchpad.cs
- DbMetaDataColumnNames.cs
- XmlNamespaceDeclarationsAttribute.cs
- RepeatInfo.cs
- InternalTypeHelper.cs
- SHA1Managed.cs
- URLString.cs
- CodeGeneratorOptions.cs
- SoapAttributeOverrides.cs
- indexingfiltermarshaler.cs
- TextMetrics.cs
- MaterialGroup.cs
- EntityDesignerBuildProvider.cs
- LinqDataSourceHelper.cs
- ToolStripRenderer.cs
- TypeConvertions.cs
- Run.cs
- UnsafeNativeMethods.cs
- ExtractorMetadata.cs
- HtmlControlPersistable.cs
- QilNode.cs
- HtmlControlAdapter.cs
- AsyncCompletedEventArgs.cs
- DecodeHelper.cs
- DoubleAnimationBase.cs
- NotifyCollectionChangedEventArgs.cs
- SHA384Managed.cs
- InProcStateClientManager.cs
- UriWriter.cs
- StringAnimationUsingKeyFrames.cs
- Propagator.cs
- StrongNameSignatureInformation.cs
- ChannelSinkStacks.cs
- HtmlElement.cs
- Aggregates.cs
- ComAdminInterfaces.cs
- DtdParser.cs
- StoryFragments.cs
- PropertyCollection.cs
- CheckBoxField.cs
- NullPackagingPolicy.cs
- RichTextBoxConstants.cs
- ChangeConflicts.cs
- ApplicationBuildProvider.cs
- DateTimeConstantAttribute.cs
- baseaxisquery.cs
- TextDecoration.cs
- IndentedWriter.cs
- AccessedThroughPropertyAttribute.cs
- SessionStateUtil.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- QueryableDataSourceEditData.cs
- ApplicationCommands.cs
- Fx.cs
- ScriptReference.cs
- FontResourceCache.cs
- HostingEnvironmentException.cs
- Typography.cs
- IODescriptionAttribute.cs
- HighlightVisual.cs
- SimpleRecyclingCache.cs
- AccessKeyManager.cs
- AppDomainEvidenceFactory.cs
- UIServiceHelper.cs
- OutArgumentConverter.cs
- GroupByQueryOperator.cs
- MultiPropertyDescriptorGridEntry.cs
- Point3D.cs
- LoginName.cs
- ParameterBuilder.cs
- PriorityQueue.cs