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
- RoleService.cs
- DataPagerFieldCommandEventArgs.cs
- FindProgressChangedEventArgs.cs
- TextEvent.cs
- DesignerLabelAdapter.cs
- GridViewColumnHeaderAutomationPeer.cs
- PageContentCollection.cs
- PrintEvent.cs
- InvokeGenerator.cs
- SettingsBindableAttribute.cs
- ColumnTypeConverter.cs
- Connection.cs
- TransformCryptoHandle.cs
- RelativeSource.cs
- DataGrid.cs
- MergeEnumerator.cs
- ValidatingReaderNodeData.cs
- EntityContainerEmitter.cs
- ApplicationContext.cs
- Directory.cs
- ObjectRef.cs
- EventRoute.cs
- ChangeInterceptorAttribute.cs
- ColorContext.cs
- ExternalException.cs
- NetTcpBinding.cs
- SimpleHandlerFactory.cs
- LifetimeMonitor.cs
- RegexStringValidatorAttribute.cs
- XmlStringTable.cs
- Workspace.cs
- CreateRefExpr.cs
- Renderer.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- RemotingException.cs
- EndOfStreamException.cs
- XPathEmptyIterator.cs
- FileUpload.cs
- TextRunTypographyProperties.cs
- EventPropertyMap.cs
- lengthconverter.cs
- DbProviderSpecificTypePropertyAttribute.cs
- FontDialog.cs
- LiteralControl.cs
- HiddenField.cs
- SqlOuterApplyReducer.cs
- ImageSource.cs
- ActivityBuilderHelper.cs
- HMACSHA384.cs
- Style.cs
- TextDecorationCollectionConverter.cs
- CompositeControl.cs
- NodeInfo.cs
- GroupBox.cs
- ConfigurationManagerInternal.cs
- SqlWebEventProvider.cs
- ProxyWebPartConnectionCollection.cs
- UrlMapping.cs
- DecimalKeyFrameCollection.cs
- OrderPreservingSpoolingTask.cs
- ProtocolInformationWriter.cs
- GroupBoxAutomationPeer.cs
- XmlReturnReader.cs
- _TimerThread.cs
- DefaultEventAttribute.cs
- CreateUserErrorEventArgs.cs
- Deserializer.cs
- MeshGeometry3D.cs
- XmlIlGenerator.cs
- SupportingTokenDuplexChannel.cs
- ComponentCommands.cs
- CodeCatchClauseCollection.cs
- FixedTextBuilder.cs
- XamlGridLengthSerializer.cs
- PageFunction.cs
- InvalidPrinterException.cs
- ExtendedPropertyCollection.cs
- SpotLight.cs
- TextRunProperties.cs
- WindowsScrollBar.cs
- Attributes.cs
- SafeHandles.cs
- HTTPRemotingHandler.cs
- EventManager.cs
- ContextQuery.cs
- TypeConverterAttribute.cs
- HebrewCalendar.cs
- PersianCalendar.cs
- Simplifier.cs
- FormsAuthenticationUserCollection.cs
- SafeNativeMethods.cs
- ButtonFieldBase.cs
- ActionFrame.cs
- ObjectContext.cs
- FixedSOMTable.cs
- ReservationCollection.cs
- StylusPointDescription.cs
- TypeUsage.cs
- DeclarativeCatalogPart.cs
- ReferencedCategoriesDocument.cs