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
- RankException.cs
- HttpRawResponse.cs
- ControlCachePolicy.cs
- PointCollectionValueSerializer.cs
- QuadTree.cs
- ScriptingAuthenticationServiceSection.cs
- QueryOperator.cs
- WebExceptionStatus.cs
- SerializableAttribute.cs
- ZipIOModeEnforcingStream.cs
- SafeFileMapViewHandle.cs
- TickBar.cs
- CompositeCollection.cs
- ProxyAttribute.cs
- ScriptComponentDescriptor.cs
- FixedPosition.cs
- TreeNodeCollection.cs
- BrowserCapabilitiesFactoryBase.cs
- FileCodeGroup.cs
- PeerCollaboration.cs
- StartUpEventArgs.cs
- SourceCollection.cs
- NetworkAddressChange.cs
- RenderData.cs
- COAUTHINFO.cs
- SoapIgnoreAttribute.cs
- AccessDataSource.cs
- X509PeerCertificateAuthenticationElement.cs
- GridView.cs
- ColorTranslator.cs
- DataFormats.cs
- PathNode.cs
- OleDbDataAdapter.cs
- NullableDoubleSumAggregationOperator.cs
- SerializationHelper.cs
- NegatedCellConstant.cs
- DBSqlParserTableCollection.cs
- BamlResourceContent.cs
- UTF32Encoding.cs
- cookiecollection.cs
- SqlXml.cs
- QueryableDataSourceEditData.cs
- DesignTable.cs
- MultipleViewProviderWrapper.cs
- EventLogPermission.cs
- TypeToken.cs
- WsdlEndpointConversionContext.cs
- SHA384Managed.cs
- EDesignUtil.cs
- XmlSyndicationContent.cs
- TextParaLineResult.cs
- FilterElement.cs
- WebPartConnectionsDisconnectVerb.cs
- PassportAuthenticationEventArgs.cs
- HttpChannelBindingToken.cs
- CollectionType.cs
- ExtensionWindowResizeGrip.cs
- VectorCollectionValueSerializer.cs
- FullTextBreakpoint.cs
- MatrixCamera.cs
- TableItemStyle.cs
- SerializationEventsCache.cs
- Queue.cs
- AnnotationMap.cs
- XmlSerializerAssemblyAttribute.cs
- WebPartTracker.cs
- QuaternionAnimation.cs
- SimpleTextLine.cs
- _ShellExpression.cs
- BStrWrapper.cs
- ExtensionMethods.cs
- PolicyLevel.cs
- XsdDuration.cs
- shaperfactoryquerycacheentry.cs
- PublisherIdentityPermission.cs
- FamilyTypeface.cs
- Viewport3DAutomationPeer.cs
- UnhandledExceptionEventArgs.cs
- ResourceDisplayNameAttribute.cs
- StrokeNodeData.cs
- Triplet.cs
- SqlVersion.cs
- CodeSubDirectoriesCollection.cs
- AutoGeneratedField.cs
- AnnotationComponentManager.cs
- CultureInfoConverter.cs
- BackgroundFormatInfo.cs
- SmtpMail.cs
- WebPartMenu.cs
- CompilerParameters.cs
- ImageUrlEditor.cs
- PropertyBuilder.cs
- followingsibling.cs
- Expander.cs
- Underline.cs
- SecuritySessionClientSettings.cs
- TemplateBindingExpression.cs
- FileUpload.cs
- TextModifier.cs
- activationcontext.cs