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
- NavigationPropertyEmitter.cs
- QuaternionRotation3D.cs
- WinCategoryAttribute.cs
- RegistryConfigurationProvider.cs
- DataGridItemCollection.cs
- Transactions.cs
- HitTestResult.cs
- DataGridTableStyleMappingNameEditor.cs
- StateValidator.cs
- CompositeTypefaceMetrics.cs
- ReliableMessagingVersionConverter.cs
- NullableConverter.cs
- Italic.cs
- StrokeNodeData.cs
- SafeRightsManagementHandle.cs
- IsolatedStoragePermission.cs
- DataGrid.cs
- DatatypeImplementation.cs
- PermissionSet.cs
- DocumentViewerAutomationPeer.cs
- DeviceSpecificDialogCachedState.cs
- SafeHandles.cs
- COMException.cs
- MemberListBinding.cs
- X509CertificateValidator.cs
- ResourceExpressionEditor.cs
- SQLDateTimeStorage.cs
- PingReply.cs
- DPTypeDescriptorContext.cs
- BitmapEffectRenderDataResource.cs
- WebControlParameterProxy.cs
- WebPartConnectVerb.cs
- HtmlPageAdapter.cs
- TextRange.cs
- TimeSpanParse.cs
- SignatureToken.cs
- Vector3DCollectionValueSerializer.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- ThemeInfoAttribute.cs
- CompModSwitches.cs
- BitmapImage.cs
- ToolStripDropDownButton.cs
- TypedLocationWrapper.cs
- ObjectSecurity.cs
- System.Data.OracleClient_BID.cs
- Utils.cs
- DbParameterCollection.cs
- AutomationPropertyInfo.cs
- FakeModelPropertyImpl.cs
- SqlParameterCollection.cs
- GeometryConverter.cs
- ProfileGroupSettings.cs
- BooleanSwitch.cs
- DateTimeSerializationSection.cs
- OracleConnectionString.cs
- XhtmlBasicValidationSummaryAdapter.cs
- CaseInsensitiveOrdinalStringComparer.cs
- ContainerUtilities.cs
- GetLastErrorDetailsRequest.cs
- GenericEnumConverter.cs
- SafeNativeMethods.cs
- SubstitutionList.cs
- CounterSampleCalculator.cs
- CodeIterationStatement.cs
- AddressHeader.cs
- SymmetricAlgorithm.cs
- ButtonStandardAdapter.cs
- AssociatedControlConverter.cs
- Token.cs
- WorkflowInstanceContextProvider.cs
- PageAsyncTaskManager.cs
- DataBoundControlParameterTarget.cs
- LinkTarget.cs
- ScriptIgnoreAttribute.cs
- ListBoxItemWrapperAutomationPeer.cs
- XmlCharCheckingWriter.cs
- IBuiltInEvidence.cs
- CorePropertiesFilter.cs
- MenuScrollingVisibilityConverter.cs
- LeaseManager.cs
- HttpProfileBase.cs
- ChangePassword.cs
- SetterBase.cs
- AudienceUriMode.cs
- ContractSearchPattern.cs
- XmlEncodedRawTextWriter.cs
- ThumbAutomationPeer.cs
- DataControlCommands.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- XLinq.cs
- MouseButtonEventArgs.cs
- FederatedMessageSecurityOverHttpElement.cs
- XsdDataContractImporter.cs
- StructuredTypeEmitter.cs
- EdmType.cs
- SamlAdvice.cs
- EndEvent.cs
- MetadataProperty.cs
- PagedDataSource.cs
- QilVisitor.cs