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
- RelationshipEnd.cs
- Decimal.cs
- HandlerBase.cs
- DataGridHelper.cs
- KeyedCollection.cs
- StylusButton.cs
- PropertyInformation.cs
- InvalidCommandTreeException.cs
- ModelItemKeyValuePair.cs
- HtmlDocument.cs
- Object.cs
- MonthChangedEventArgs.cs
- NetworkInformationPermission.cs
- ProtocolsConfigurationHandler.cs
- OpenTypeLayout.cs
- KnownAssembliesSet.cs
- ToolboxItemAttribute.cs
- PersonalizationStateQuery.cs
- DropTarget.cs
- DataGridViewDataErrorEventArgs.cs
- XmlSchemaFacet.cs
- MD5.cs
- Polygon.cs
- SchemaNotation.cs
- DomNameTable.cs
- HostVisual.cs
- ConstructorBuilder.cs
- PageFunction.cs
- RadioButtonFlatAdapter.cs
- CodeNamespace.cs
- CanonicalXml.cs
- ProgressChangedEventArgs.cs
- RuleEngine.cs
- PageAsyncTaskManager.cs
- BindingMemberInfo.cs
- Rotation3DAnimationBase.cs
- ReturnValue.cs
- TcpProcessProtocolHandler.cs
- RadialGradientBrush.cs
- ZoomPercentageConverter.cs
- ColumnReorderedEventArgs.cs
- CopyNodeSetAction.cs
- XmlDeclaration.cs
- VersionedStream.cs
- JsonSerializer.cs
- WmfPlaceableFileHeader.cs
- CallbackCorrelationInitializer.cs
- MinimizableAttributeTypeConverter.cs
- OledbConnectionStringbuilder.cs
- CurrencyManager.cs
- DynamicDocumentPaginator.cs
- SaveRecipientRequest.cs
- Wizard.cs
- SqlUnionizer.cs
- ContainerFilterService.cs
- iisPickupDirectory.cs
- EventLogException.cs
- AncillaryOps.cs
- MulticastNotSupportedException.cs
- TraceSection.cs
- SystemUnicastIPAddressInformation.cs
- ControlOperationBehavior.cs
- WindowsToolbarItemAsMenuItem.cs
- WCFBuildProvider.cs
- ResourceDictionaryCollection.cs
- HostingEnvironmentSection.cs
- UnsafeNativeMethods.cs
- SqlBulkCopyColumnMapping.cs
- UnicodeEncoding.cs
- ResetableIterator.cs
- WindowsSecurityToken.cs
- Int64AnimationUsingKeyFrames.cs
- StructuredTypeEmitter.cs
- CellLabel.cs
- DataGridViewCellPaintingEventArgs.cs
- FormViewRow.cs
- DesignSurface.cs
- XmlWrappingWriter.cs
- ContextBase.cs
- entityreference_tresulttype.cs
- Int64Storage.cs
- CollectionView.cs
- RelatedView.cs
- IDReferencePropertyAttribute.cs
- DrawingContextDrawingContextWalker.cs
- XXXOnTypeBuilderInstantiation.cs
- COSERVERINFO.cs
- CodePageUtils.cs
- ProviderCollection.cs
- Floater.cs
- URLString.cs
- MethodBody.cs
- XmlSchemaSimpleType.cs
- DataComponentGenerator.cs
- TextRenderingModeValidation.cs
- XPathNodePointer.cs
- SimpleNameService.cs
- TextChangedEventArgs.cs
- TreeNodeBindingCollection.cs
- DoubleAnimation.cs