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
- StringTraceRecord.cs
- PropertyEmitter.cs
- ActivityDesigner.cs
- ClientOperationFormatterProvider.cs
- LayoutInformation.cs
- BlurBitmapEffect.cs
- ElapsedEventArgs.cs
- IISUnsafeMethods.cs
- IsolatedStorageException.cs
- RemotingConfigParser.cs
- DynamicUpdateCommand.cs
- FileAuthorizationModule.cs
- DataContractSerializerMessageContractImporter.cs
- Metadata.cs
- Lease.cs
- InternalSafeNativeMethods.cs
- bindurihelper.cs
- WebDisplayNameAttribute.cs
- TextWriterTraceListener.cs
- SmtpDigestAuthenticationModule.cs
- XmlILTrace.cs
- DataFormats.cs
- CustomCategoryAttribute.cs
- SelectingProviderEventArgs.cs
- AxHost.cs
- SupportingTokenParameters.cs
- TypeConstant.cs
- AutomationIdentifier.cs
- Object.cs
- PerspectiveCamera.cs
- ObjRef.cs
- DecimalAnimation.cs
- OutOfMemoryException.cs
- Membership.cs
- ValidateNames.cs
- JumpPath.cs
- ViewEventArgs.cs
- WsdlHelpGeneratorElement.cs
- TCPListener.cs
- WebPartConnectionsConnectVerb.cs
- BrowserCapabilitiesFactoryBase.cs
- PropertyChangingEventArgs.cs
- Renderer.cs
- DbParameterHelper.cs
- RTLAwareMessageBox.cs
- TableColumnCollectionInternal.cs
- ViewManager.cs
- unsafenativemethodstextservices.cs
- FontNamesConverter.cs
- ComboBoxItem.cs
- ProgressPage.cs
- FileClassifier.cs
- SafeHandles.cs
- AppDomainManager.cs
- rsa.cs
- httpserverutility.cs
- QueryAccessibilityHelpEvent.cs
- StaticSiteMapProvider.cs
- BitmapFrameEncode.cs
- WindowClosedEventArgs.cs
- ManagedWndProcTracker.cs
- ValidatorCompatibilityHelper.cs
- DataGridToolTip.cs
- MissingManifestResourceException.cs
- SoapBinding.cs
- TabItem.cs
- RightsManagementEncryptionTransform.cs
- OperationInfo.cs
- SqlErrorCollection.cs
- FileChangesMonitor.cs
- AuthorizationSection.cs
- ClientOptions.cs
- MessageEventSubscriptionService.cs
- MarshalByRefObject.cs
- ConfigurationManagerInternalFactory.cs
- VisualBrush.cs
- NameObjectCollectionBase.cs
- DataTableNewRowEvent.cs
- SqlUtil.cs
- SafePointer.cs
- GeometryModel3D.cs
- TypedElement.cs
- TableCell.cs
- UserThread.cs
- ToolBarTray.cs
- StaticFileHandler.cs
- SHA384.cs
- DecoratedNameAttribute.cs
- SrgsElement.cs
- FontInfo.cs
- DateTimeEditor.cs
- DefaultTraceListener.cs
- OleAutBinder.cs
- Page.cs
- SvcMapFileLoader.cs
- GridItemCollection.cs
- SqlParameterizer.cs
- DataControlButton.cs
- BitmapEffect.cs
- SafeFileHandle.cs