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
- WindowsFormsSynchronizationContext.cs
- CodeBinaryOperatorExpression.cs
- WindowsBrush.cs
- DispatchChannelSink.cs
- ManagementException.cs
- StaticExtension.cs
- ComponentManagerBroker.cs
- TimeStampChecker.cs
- CurrentChangedEventManager.cs
- ADMembershipProvider.cs
- __ComObject.cs
- MarkupWriter.cs
- DefaultEventAttribute.cs
- ObjectQuery.cs
- DbConnectionFactory.cs
- GenericAuthenticationEventArgs.cs
- CalendarSelectionChangedEventArgs.cs
- Rectangle.cs
- SpnegoTokenAuthenticator.cs
- WsrmTraceRecord.cs
- SmiRecordBuffer.cs
- SubqueryRules.cs
- ViewStateModeByIdAttribute.cs
- FixedSOMGroup.cs
- RewritingProcessor.cs
- DataGridViewSelectedCellCollection.cs
- CellPartitioner.cs
- OSFeature.cs
- BamlBinaryReader.cs
- WebBrowserEvent.cs
- XmlSerializerNamespaces.cs
- BindingBase.cs
- LoaderAllocator.cs
- FixedSOMContainer.cs
- GridViewSortEventArgs.cs
- AdjustableArrowCap.cs
- XmlSchemaAny.cs
- FormsAuthenticationCredentials.cs
- SafeProcessHandle.cs
- RewritingSimplifier.cs
- TrayIconDesigner.cs
- TextSelectionHelper.cs
- CompilationRelaxations.cs
- SqlCaseSimplifier.cs
- _BufferOffsetSize.cs
- Wildcard.cs
- SvcFileManager.cs
- EventLogPermission.cs
- TextBoxAutoCompleteSourceConverter.cs
- XmlSerializerFactory.cs
- AuthenticationException.cs
- Graphics.cs
- SerTrace.cs
- AspCompat.cs
- ResolveMatchesMessageCD1.cs
- TagPrefixCollection.cs
- MetadataArtifactLoaderCompositeResource.cs
- ProxyFragment.cs
- NavigationHelper.cs
- PaperSize.cs
- ReturnType.cs
- ButtonFlatAdapter.cs
- ArgumentException.cs
- BindingListCollectionView.cs
- TokenBasedSetEnumerator.cs
- StringReader.cs
- ToolStripManager.cs
- ManualResetEvent.cs
- CodePageUtils.cs
- ServiceBuildProvider.cs
- BitmapCodecInfo.cs
- FilteredAttributeCollection.cs
- MemberInfoSerializationHolder.cs
- DataSpaceManager.cs
- ToolStripSeparator.cs
- TypePropertyEditor.cs
- SymbolEqualComparer.cs
- ConnectionPoolManager.cs
- EncryptedData.cs
- ListBindingHelper.cs
- SystemPens.cs
- CatalogZoneBase.cs
- OutputCacheSettings.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- AppSettingsReader.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- GlobalEventManager.cs
- _HeaderInfo.cs
- WebPartHeaderCloseVerb.cs
- NoPersistProperty.cs
- dataSvcMapFileLoader.cs
- TextServicesDisplayAttributePropertyRanges.cs
- TextTreeRootNode.cs
- WorkflowMarkupSerializationProvider.cs
- TemplateEditingFrame.cs
- ExpressionPrefixAttribute.cs
- TabControlCancelEvent.cs
- Focus.cs
- Executor.cs
- OrderedDictionary.cs