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
- ProfileGroupSettingsCollection.cs
- StylusTouchDevice.cs
- AutomationEvent.cs
- AttributeCollection.cs
- CodeTypeDeclaration.cs
- SHA384Managed.cs
- ToolStripSplitStackLayout.cs
- __TransparentProxy.cs
- SafeSystemMetrics.cs
- StorageBasedPackageProperties.cs
- EntityContainer.cs
- MissingMemberException.cs
- MetafileHeaderWmf.cs
- SizeConverter.cs
- controlskin.cs
- HtmlHistory.cs
- NotifyInputEventArgs.cs
- templategroup.cs
- ImageCollectionCodeDomSerializer.cs
- HostingPreferredMapPath.cs
- BitmapEffectInput.cs
- DiagnosticTraceSource.cs
- ImageAnimator.cs
- ApplicationHost.cs
- XmlSignatureProperties.cs
- XmlSchemaIdentityConstraint.cs
- XPathMultyIterator.cs
- ContentFilePart.cs
- CreateUserWizardStep.cs
- DataGridViewAutoSizeModeEventArgs.cs
- StateBag.cs
- LogRecordSequence.cs
- BrowserCapabilitiesFactory.cs
- ZipIOLocalFileBlock.cs
- CodeComment.cs
- UndoManager.cs
- XmlCustomFormatter.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- NTAccount.cs
- StrongNamePublicKeyBlob.cs
- HandlerFactoryWrapper.cs
- ButtonField.cs
- ObjectMemberMapping.cs
- SelectorAutomationPeer.cs
- DbProviderFactories.cs
- Rect3DConverter.cs
- ImmutableObjectAttribute.cs
- CachedPathData.cs
- PtsContext.cs
- DependencyStoreSurrogate.cs
- OraclePermission.cs
- Propagator.Evaluator.cs
- ExpressionVisitor.cs
- SecurityChannelListener.cs
- NullableBoolConverter.cs
- DataTableReader.cs
- DisplayNameAttribute.cs
- ExternalDataExchangeService.cs
- XmlSerializerSection.cs
- AssociationSetMetadata.cs
- MILUtilities.cs
- SubMenuStyleCollection.cs
- ParameterBuilder.cs
- OracleInfoMessageEventArgs.cs
- StrokeCollection.cs
- EventRouteFactory.cs
- Stacktrace.cs
- EncodingNLS.cs
- DesignerPerfEventProvider.cs
- CodeIterationStatement.cs
- PageStatePersister.cs
- FocusManager.cs
- ClientSettingsStore.cs
- PreviewKeyDownEventArgs.cs
- RequestStatusBarUpdateEventArgs.cs
- ObjectReaderCompiler.cs
- ColorAnimationBase.cs
- HtmlTernaryTree.cs
- loginstatus.cs
- BamlWriter.cs
- ControlPersister.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- KeyInfo.cs
- EntityDataSourceChangingEventArgs.cs
- ContractCodeDomInfo.cs
- storepermission.cs
- BuildProviderCollection.cs
- QualifierSet.cs
- UrlMappingsModule.cs
- Int16AnimationBase.cs
- HandlerBase.cs
- WebPartPersonalization.cs
- XpsManager.cs
- HtmlElementEventArgs.cs
- ShapingEngine.cs
- DispatcherFrame.cs
- CultureTable.cs
- PrintDialog.cs
- ListViewItem.cs
- TextDecorationLocationValidation.cs