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
- ACE.cs
- ImageDrawing.cs
- DefaultHttpHandler.cs
- Item.cs
- _HeaderInfo.cs
- AttachedPropertyInfo.cs
- WebPartHeaderCloseVerb.cs
- ArrayMergeHelper.cs
- DesignerTransactionCloseEvent.cs
- RequestCachingSection.cs
- ToolStripItemTextRenderEventArgs.cs
- ImageClickEventArgs.cs
- SoapIncludeAttribute.cs
- SplayTreeNode.cs
- ConfigXmlCDataSection.cs
- UpdateException.cs
- NCryptNative.cs
- IgnoreSectionHandler.cs
- SystemWebCachingSectionGroup.cs
- SelectorAutomationPeer.cs
- AsymmetricKeyExchangeFormatter.cs
- DropSource.cs
- DataKeyArray.cs
- TextEndOfParagraph.cs
- UnmanagedHandle.cs
- IIS7UserPrincipal.cs
- RoleBoolean.cs
- SqlServer2KCompatibilityAnnotation.cs
- KeyFrames.cs
- AdornerHitTestResult.cs
- GradientSpreadMethodValidation.cs
- _LocalDataStore.cs
- DPCustomTypeDescriptor.cs
- RoutedEventConverter.cs
- TabControl.cs
- LeaseManager.cs
- ParserContext.cs
- ControlSerializer.cs
- MembershipUser.cs
- SynchronizationScope.cs
- Timeline.cs
- TraceContextRecord.cs
- TextEditorContextMenu.cs
- DetailsViewRowCollection.cs
- EdmComplexTypeAttribute.cs
- ViewCellRelation.cs
- ThreadStartException.cs
- Rotation3DAnimationUsingKeyFrames.cs
- CurrentChangingEventManager.cs
- SqlDataSourceCache.cs
- VisualProxy.cs
- ArraySortHelper.cs
- ColorConverter.cs
- KeyEvent.cs
- ProtocolsConfigurationHandler.cs
- cookiecontainer.cs
- MultitargetUtil.cs
- DesignBinding.cs
- PrimitiveXmlSerializers.cs
- InvokePatternIdentifiers.cs
- LocalizableAttribute.cs
- EventlogProvider.cs
- XmlSerializerSection.cs
- UnaryNode.cs
- DecimalStorage.cs
- TimeSpanConverter.cs
- Point3DAnimationBase.cs
- RenderDataDrawingContext.cs
- ProxyWebPartConnectionCollection.cs
- SoapHeaderAttribute.cs
- XslTransformFileEditor.cs
- ConfigXmlText.cs
- ThreadPool.cs
- FileLoadException.cs
- MsmqChannelFactory.cs
- SinglePhaseEnlistment.cs
- SqlMetaData.cs
- WebPartTracker.cs
- CellRelation.cs
- PackageDigitalSignatureManager.cs
- CheckBox.cs
- VisualStyleTypesAndProperties.cs
- Content.cs
- Repeater.cs
- CacheMemory.cs
- MasterPageCodeDomTreeGenerator.cs
- PauseStoryboard.cs
- MD5.cs
- BinaryMethodMessage.cs
- COM2TypeInfoProcessor.cs
- Enum.cs
- RunWorkerCompletedEventArgs.cs
- StyleXamlParser.cs
- WCFBuildProvider.cs
- BaseCodeDomTreeGenerator.cs
- CopyOfAction.cs
- ByeMessageApril2005.cs
- AppSettingsExpressionBuilder.cs
- SelectionProviderWrapper.cs
- BrowserCapabilitiesFactory35.cs