Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventLevel.cs / 1305376 / EventLevel.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventLevel ** ** Purpose: ** This public class describes the metadata for a specific Level ** 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 Level defined by a Provider. /// An instance of this class is obtained from a ProviderMetadata object. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventLevel { private int value; private string name; private string displayName; private bool dataReady; ProviderMetadata pmReference; object syncObject; //called from EventMetadata internal EventLevel(int value, ProviderMetadata pmReference) { this.value = value; this.pmReference = pmReference; this.syncObject = new object(); } //called from ProviderMetadata internal EventLevel(string name, int 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.Levels; this.name = null; this.displayName = null; this.dataReady = true; foreach (EventLevel lev in result) { if (lev.Value == this.value) { this.name = lev.Name; this.displayName = lev.DisplayName; break; } } } } public string Name { get { PrepareData(); return this.name; } } public int 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
- ExecutionContext.cs
- DataKeyArray.cs
- DataGridViewCellPaintingEventArgs.cs
- SqlCacheDependencyDatabaseCollection.cs
- DataSourceXmlClassAttribute.cs
- CheckBoxField.cs
- BitmapData.cs
- PerformanceCounterPermission.cs
- SiteMap.cs
- InstanceContext.cs
- ApplicationGesture.cs
- PropertyStore.cs
- AuthenticatedStream.cs
- MediaTimeline.cs
- __ConsoleStream.cs
- Light.cs
- SymbolDocumentGenerator.cs
- UseLicense.cs
- WebPartConnectVerb.cs
- ContextActivityUtils.cs
- SortAction.cs
- HostVisual.cs
- TypeElementCollection.cs
- X509AsymmetricSecurityKey.cs
- ContainerUtilities.cs
- Effect.cs
- TemplateComponentConnector.cs
- XmlMapping.cs
- UriTemplateEquivalenceComparer.cs
- ChannelServices.cs
- ColorConvertedBitmap.cs
- PhysicalAddress.cs
- InstanceOwnerQueryResult.cs
- Rect3D.cs
- HitTestResult.cs
- ObjectAssociationEndMapping.cs
- TypeRefElement.cs
- NativeActivity.cs
- EndpointNameMessageFilter.cs
- DataFormats.cs
- ResourceDisplayNameAttribute.cs
- IndexerNameAttribute.cs
- SkipQueryOptionExpression.cs
- ToolStripContainer.cs
- TemplatedWizardStep.cs
- BidOverLoads.cs
- FaultException.cs
- SafeFileMapViewHandle.cs
- WindowsTokenRoleProvider.cs
- DiscoveryMessageSequence11.cs
- AuthenticationSection.cs
- Page.cs
- ChannelCacheSettings.cs
- PolyQuadraticBezierSegment.cs
- ViewValidator.cs
- InheritanceUI.cs
- _BufferOffsetSize.cs
- CFGGrammar.cs
- BindingExpressionBase.cs
- _HeaderInfo.cs
- FixedTextPointer.cs
- XmlWrappingWriter.cs
- _HeaderInfo.cs
- TimeManager.cs
- BindingExpressionBase.cs
- CompiledQuery.cs
- Int64.cs
- ELinqQueryState.cs
- ResXResourceReader.cs
- DocumentViewerHelper.cs
- CmsInterop.cs
- TrackPointCollection.cs
- basenumberconverter.cs
- ClockController.cs
- TextEmbeddedObject.cs
- Int64Animation.cs
- grammarelement.cs
- XPathNavigator.cs
- XmlBaseReader.cs
- MemberAccessException.cs
- Route.cs
- GPPOINT.cs
- PersistenceTypeAttribute.cs
- GroupedContextMenuStrip.cs
- BigInt.cs
- CacheHelper.cs
- DiscoveryVersion.cs
- diagnosticsswitches.cs
- AncillaryOps.cs
- Tokenizer.cs
- EmptyEnumerator.cs
- CompiledRegexRunnerFactory.cs
- SqlMethods.cs
- TextBoxBaseDesigner.cs
- MatrixAnimationBase.cs
- ListenerUnsafeNativeMethods.cs
- InvalidOleVariantTypeException.cs
- ItemCollectionEditor.cs
- QueueException.cs
- TrackingMemoryStream.cs