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
- ContainerFilterService.cs
- PolyQuadraticBezierSegment.cs
- UrlPath.cs
- SqlInternalConnectionTds.cs
- ProgressiveCrcCalculatingStream.cs
- DataControlFieldHeaderCell.cs
- HwndAppCommandInputProvider.cs
- ClientSideQueueItem.cs
- LogLogRecord.cs
- TouchEventArgs.cs
- sqlcontext.cs
- COM2ComponentEditor.cs
- UxThemeWrapper.cs
- EntityContainerRelationshipSetEnd.cs
- NativeMethods.cs
- EncryptedKeyIdentifierClause.cs
- FileSystemWatcher.cs
- StringDictionary.cs
- UpdateManifestForBrowserApplication.cs
- XPathNodeIterator.cs
- SystemIPv4InterfaceProperties.cs
- SqlCrossApplyToCrossJoin.cs
- EditorResources.cs
- ResXFileRef.cs
- SecurityUniqueId.cs
- SourceSwitch.cs
- Events.cs
- XmlCharCheckingReader.cs
- ObjectDisposedException.cs
- HwndKeyboardInputProvider.cs
- DynamicAttribute.cs
- XPathItem.cs
- FillRuleValidation.cs
- UpdateException.cs
- JapaneseCalendar.cs
- XmlComplianceUtil.cs
- SharedPersonalizationStateInfo.cs
- ComplexTypeEmitter.cs
- ControlIdConverter.cs
- EllipseGeometry.cs
- TargetFrameworkAttribute.cs
- DataServiceHostWrapper.cs
- CollectionConverter.cs
- WSTransactionSection.cs
- ParserContext.cs
- IQueryable.cs
- GridView.cs
- StringSource.cs
- DataGridPagerStyle.cs
- BitmapDownload.cs
- RuleSetCollection.cs
- XmlSchemas.cs
- storepermission.cs
- Visitor.cs
- BindingCollection.cs
- ColorAnimation.cs
- OciEnlistContext.cs
- FixedFindEngine.cs
- ContentControl.cs
- DbConnectionPoolIdentity.cs
- ThreadStateException.cs
- KeyFrames.cs
- HtmlInputCheckBox.cs
- ChtmlTextBoxAdapter.cs
- SqlTypesSchemaImporter.cs
- UserNameSecurityTokenAuthenticator.cs
- BitStack.cs
- xmlglyphRunInfo.cs
- RegistryHandle.cs
- ToggleButton.cs
- EffectiveValueEntry.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- TrustLevelCollection.cs
- Image.cs
- COM2ComponentEditor.cs
- FixedSOMGroup.cs
- ProtocolsInstallComponent.cs
- Section.cs
- TypeGenericEnumerableViewSchema.cs
- xmlsaver.cs
- ConfigPathUtility.cs
- BindingMAnagerBase.cs
- GeometryConverter.cs
- XmlTextEncoder.cs
- XmlNamedNodeMap.cs
- CodeCompiler.cs
- ServiceChannel.cs
- SqlDataSource.cs
- CodeTypeOfExpression.cs
- AdornerDecorator.cs
- UInt32Converter.cs
- CommandDevice.cs
- CheckBox.cs
- PathSegment.cs
- ConversionHelper.cs
- ObjectComplexPropertyMapping.cs
- BypassElementCollection.cs
- SharedUtils.cs
- SoapConverter.cs
- EDesignUtil.cs