Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventTask.cs / 1305376 / EventTask.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventTask ** ** Purpose: ** This public class describes the metadata for a specific Task ** 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 Task defined by a Provider. /// An instance of this class is obtained from a ProviderMetadata object. /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class EventTask { private int value; private string name; private string displayName; private Guid guid; private bool dataReady; ProviderMetadata pmReference; object syncObject; //called from EventMetadata internal EventTask(int value, ProviderMetadata pmReference) { this.value = value; this.pmReference = pmReference; this.syncObject = new object(); } //called from ProviderMetadata internal EventTask(string name, int value, string displayName, Guid guid) { this.value = value; this.name = name; this.displayName = displayName; this.guid = guid; this.dataReady = true; this.syncObject = new object(); } internal void PrepareData() { lock (syncObject) { if (dataReady == true) return; IEnumerableresult = pmReference.Tasks; this.name = null; this.displayName = null; this.guid = Guid.Empty; this.dataReady = true; foreach (EventTask task in result) { if (task.Value == this.value) { this.name = task.Name; this.displayName = task.DisplayName; this.guid = task.EventGuid; this.dataReady = true; break; } } } } public string Name { get { PrepareData(); return this.name; } } public int Value { get { return this.value; } } public string DisplayName { get { PrepareData(); return this.displayName; } } public Guid EventGuid { get { PrepareData(); return this.guid; } } } } // 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
- ClientConvert.cs
- StreamReader.cs
- GeneralTransform3DCollection.cs
- New.cs
- BaseComponentEditor.cs
- SslStream.cs
- IsolatedStorageFileStream.cs
- AppDomainManager.cs
- EventLogPermissionAttribute.cs
- PropertyDescriptorComparer.cs
- HtmlHistory.cs
- RectangleF.cs
- WebConfigurationHostFileChange.cs
- EntityViewGenerator.cs
- NominalTypeEliminator.cs
- ConnectionsZone.cs
- DateTimeOffset.cs
- ApplicationServicesHostFactory.cs
- DispatchChannelSink.cs
- SetterTriggerConditionValueConverter.cs
- CollectionChangedEventManager.cs
- BaseComponentEditor.cs
- XmlWrappingReader.cs
- HeaderUtility.cs
- DataShape.cs
- ControlIdConverter.cs
- LicenseContext.cs
- TrackPoint.cs
- _DigestClient.cs
- SqlMetaData.cs
- UserControlBuildProvider.cs
- CodeStatement.cs
- CellCreator.cs
- _NestedMultipleAsyncResult.cs
- SubstitutionList.cs
- DataGridViewCheckBoxCell.cs
- DecimalFormatter.cs
- AccessibilityHelperForVista.cs
- InvalidFilterCriteriaException.cs
- XmlSchemaSimpleContentRestriction.cs
- PackageDigitalSignatureManager.cs
- JumpList.cs
- XmlSchemaAnnotation.cs
- RequestCachingSection.cs
- TextRangeAdaptor.cs
- Int32.cs
- DataSourceControlBuilder.cs
- DataRowCollection.cs
- SoapExtensionStream.cs
- OleDbPropertySetGuid.cs
- PagesChangedEventArgs.cs
- PeerApplication.cs
- RC2CryptoServiceProvider.cs
- DataFormat.cs
- AddInAdapter.cs
- ProtectedConfigurationSection.cs
- DesignParameter.cs
- LinkedResourceCollection.cs
- SoapMessage.cs
- XmlNodeList.cs
- TimeoutHelper.cs
- ImageButton.cs
- Attributes.cs
- WindowsServiceCredential.cs
- ScaleTransform.cs
- XmlWrappingReader.cs
- MethodAccessException.cs
- ViewSimplifier.cs
- InputScopeNameConverter.cs
- DebugManager.cs
- Compiler.cs
- TokenizerHelper.cs
- ScriptingWebServicesSectionGroup.cs
- OracleDateTime.cs
- XmlSchemaAppInfo.cs
- CalendarAutoFormat.cs
- SymbolType.cs
- ServiceChannelProxy.cs
- ExplicitDiscriminatorMap.cs
- CodeAssignStatement.cs
- MenuItemAutomationPeer.cs
- HttpServerVarsCollection.cs
- Environment.cs
- Selection.cs
- Form.cs
- KeyGestureValueSerializer.cs
- TextRangeAdaptor.cs
- ValueType.cs
- TaskHelper.cs
- CompModSwitches.cs
- DispatcherHookEventArgs.cs
- XsdCachingReader.cs
- Preprocessor.cs
- CharEntityEncoderFallback.cs
- ParseNumbers.cs
- TableParaClient.cs
- XmlSchemaComplexContentExtension.cs
- SqlCacheDependency.cs
- LabelAutomationPeer.cs
- WebHttpEndpoint.cs