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
- DataFormats.cs
- PolyLineSegment.cs
- ChangeConflicts.cs
- CommandConverter.cs
- ConfigurationProperty.cs
- FileUtil.cs
- SystemNetworkInterface.cs
- SwitchElementsCollection.cs
- HuffModule.cs
- BinaryParser.cs
- Iis7Helper.cs
- ThaiBuddhistCalendar.cs
- UpnEndpointIdentity.cs
- DataListItem.cs
- OdbcFactory.cs
- VerticalAlignConverter.cs
- XdrBuilder.cs
- TabPage.cs
- FragmentQuery.cs
- PropertyGridEditorPart.cs
- CodeLinePragma.cs
- RegexCaptureCollection.cs
- NativeMethods.cs
- XmlAttributeCollection.cs
- DataException.cs
- DbConnectionHelper.cs
- BaseCollection.cs
- SafeNativeMethods.cs
- PathGradientBrush.cs
- Logging.cs
- ProxyHelper.cs
- ExpandSegmentCollection.cs
- DbConnectionPoolOptions.cs
- XmlTextReaderImpl.cs
- TraceUtils.cs
- PropertyPathConverter.cs
- XmlSchemaSequence.cs
- BamlCollectionHolder.cs
- ToolStripSeparator.cs
- OdbcConnectionFactory.cs
- PostBackTrigger.cs
- CriticalFileToken.cs
- XamlStackWriter.cs
- Graph.cs
- PriorityQueue.cs
- SlipBehavior.cs
- DataGridViewLinkColumn.cs
- TagPrefixCollection.cs
- DateTimeOffsetConverter.cs
- Polygon.cs
- storepermission.cs
- XmlSchemaInfo.cs
- WebPartDescriptionCollection.cs
- selecteditemcollection.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- __ComObject.cs
- PaintValueEventArgs.cs
- Menu.cs
- ModelItemDictionary.cs
- BufferedResponseStream.cs
- SoapHeaders.cs
- CookieProtection.cs
- NameObjectCollectionBase.cs
- PersistenceProviderBehavior.cs
- TextRangeEditLists.cs
- PrtTicket_Public_Simple.cs
- EditorZoneBase.cs
- PerformanceCounterManager.cs
- SoapMessage.cs
- InputReferenceExpression.cs
- TokenBasedSetEnumerator.cs
- MouseOverProperty.cs
- SemanticBasicElement.cs
- EdgeProfileValidation.cs
- DesignerAdRotatorAdapter.cs
- SystemWebCachingSectionGroup.cs
- UnaryExpressionHelper.cs
- ClientFormsAuthenticationMembershipProvider.cs
- StructuredProperty.cs
- BitmapDownload.cs
- Byte.cs
- ExceptionHelpers.cs
- SchemaInfo.cs
- ElementAction.cs
- GcSettings.cs
- SupportingTokenDuplexChannel.cs
- BoundsDrawingContextWalker.cs
- SoapSchemaExporter.cs
- DocumentPage.cs
- ObjectQueryState.cs
- FixedSOMLineCollection.cs
- BaseDataList.cs
- MetadataCache.cs
- BamlResourceContent.cs
- SingleKeyFrameCollection.cs
- FocusManager.cs
- AddInDeploymentState.cs
- StreamSecurityUpgradeAcceptorBase.cs
- BaseDataBoundControlDesigner.cs
- DirtyTextRange.cs