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
- StringOutput.cs
- ExchangeUtilities.cs
- parserscommon.cs
- DbMetaDataCollectionNames.cs
- DataServiceContext.cs
- ContractMapping.cs
- EmissiveMaterial.cs
- PreservationFileWriter.cs
- CmsInterop.cs
- MouseActionValueSerializer.cs
- RemoteWebConfigurationHostStream.cs
- DotNetATv1WindowsLogEntryDeserializer.cs
- SBCSCodePageEncoding.cs
- RoleGroupCollection.cs
- SettingsBindableAttribute.cs
- JournalEntryListConverter.cs
- SystemResourceHost.cs
- EUCJPEncoding.cs
- CaseInsensitiveHashCodeProvider.cs
- GridViewRowEventArgs.cs
- PartialCachingAttribute.cs
- CodeFieldReferenceExpression.cs
- SimpleWorkerRequest.cs
- Attributes.cs
- ManagedIStream.cs
- AsyncCompletedEventArgs.cs
- HtmlButton.cs
- ValidationPropertyAttribute.cs
- HttpListenerTimeoutManager.cs
- GridView.cs
- ProxyGenerator.cs
- TraceContextRecord.cs
- ListenerConnectionDemuxer.cs
- ResourceSetExpression.cs
- TransformDescriptor.cs
- RectangleHotSpot.cs
- MSHTMLHost.cs
- FormsAuthentication.cs
- Or.cs
- MessageQueueConverter.cs
- IsolatedStorageFile.cs
- ContextMenuStrip.cs
- CodeTypeReference.cs
- RawStylusInputReport.cs
- UrlMappingsModule.cs
- DiffuseMaterial.cs
- FamilyTypeface.cs
- DataGridViewToolTip.cs
- ProtocolsConfigurationEntry.cs
- CryptoConfig.cs
- StdValidatorsAndConverters.cs
- WebServiceResponse.cs
- UInt16Storage.cs
- TimelineCollection.cs
- EmptyQuery.cs
- Binding.cs
- BuilderPropertyEntry.cs
- ListBox.cs
- ServiceProviders.cs
- SelectionRangeConverter.cs
- DependencyStoreSurrogate.cs
- connectionpool.cs
- DoWhileDesigner.xaml.cs
- PersonalizationState.cs
- QilFactory.cs
- RotateTransform.cs
- SecurityUtils.cs
- DecoratedNameAttribute.cs
- InstanceKeyCompleteException.cs
- HttpStreamMessage.cs
- MemoryMappedFileSecurity.cs
- OutOfMemoryException.cs
- PersistenceMetadataNamespace.cs
- ToolStripLabel.cs
- TypeForwardedFromAttribute.cs
- UpdatableGenericsFeature.cs
- FastPropertyAccessor.cs
- StoreContentChangedEventArgs.cs
- HttpApplication.cs
- ComplexBindingPropertiesAttribute.cs
- NavigationPropertyEmitter.cs
- UIPropertyMetadata.cs
- PathFigureCollectionValueSerializer.cs
- CreateUserWizardStep.cs
- HtmlInputSubmit.cs
- InputReport.cs
- SizeChangedEventArgs.cs
- FlowNode.cs
- ValidatedControlConverter.cs
- ValuePattern.cs
- WindowsListViewSubItem.cs
- Polygon.cs
- Imaging.cs
- DeobfuscatingStream.cs
- SqlVersion.cs
- StringFreezingAttribute.cs
- DataViewManager.cs
- DataGridColumnCollection.cs
- ThreadPool.cs
- Transform3DGroup.cs