Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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
- SqlCrossApplyToCrossJoin.cs
- TableLayoutSettings.cs
- UserNamePasswordValidator.cs
- CommonDialog.cs
- SiteMapNodeItemEventArgs.cs
- RC2.cs
- Ticks.cs
- cryptoapiTransform.cs
- StaticFileHandler.cs
- MenuBase.cs
- Model3D.cs
- ComPlusContractBehavior.cs
- ButtonColumn.cs
- RowToParametersTransformer.cs
- WorkflowCreationContext.cs
- Point3DCollectionConverter.cs
- ListViewInsertionMark.cs
- nulltextcontainer.cs
- TypedReference.cs
- Convert.cs
- Point3D.cs
- ToolStripInSituService.cs
- ConnectionPointCookie.cs
- wmiprovider.cs
- HtmlControl.cs
- IDictionary.cs
- linebase.cs
- EntityKey.cs
- GeneralTransform3DCollection.cs
- ListBindingHelper.cs
- EntityDesignerUtils.cs
- DelegatedStream.cs
- XmlSchemaChoice.cs
- LocalizableAttribute.cs
- WebPartEditVerb.cs
- SynchronizedInputPattern.cs
- PieceDirectory.cs
- FunctionImportMapping.ReturnTypeRenameMapping.cs
- CallId.cs
- TypeNameHelper.cs
- XPathAncestorQuery.cs
- OleDbConnectionInternal.cs
- StatusBarPanel.cs
- VectorCollectionValueSerializer.cs
- CommittableTransaction.cs
- PartitionResolver.cs
- SmiContextFactory.cs
- ExtensionWindowResizeGrip.cs
- ByteArrayHelperWithString.cs
- ExecutionContext.cs
- Pair.cs
- TypeUtil.cs
- HandlerBase.cs
- RuleSettings.cs
- Int16Storage.cs
- XmlAttributeOverrides.cs
- SafeRightsManagementSessionHandle.cs
- XmlAutoDetectWriter.cs
- XmlEncApr2001.cs
- Array.cs
- TextRunCache.cs
- CurrentChangingEventArgs.cs
- EmbeddedMailObjectsCollection.cs
- RelationshipNavigation.cs
- EntityProviderFactory.cs
- ConfigurationValidatorAttribute.cs
- CompoundFileStreamReference.cs
- StyleXamlParser.cs
- FactoryGenerator.cs
- WebConfigurationHost.cs
- DataFormat.cs
- PolicyStatement.cs
- TogglePatternIdentifiers.cs
- GeometryModel3D.cs
- TextElementEnumerator.cs
- Validator.cs
- Brush.cs
- SqlCacheDependencyDatabase.cs
- RuntimeEnvironment.cs
- DynamicValidator.cs
- SafeRightsManagementQueryHandle.cs
- GenericAuthenticationEventArgs.cs
- HtmlTableCellCollection.cs
- ButtonRenderer.cs
- XmlBinaryReader.cs
- WebScriptEndpoint.cs
- XmlChildNodes.cs
- PackWebRequest.cs
- Attributes.cs
- GridItemPatternIdentifiers.cs
- HandlerWithFactory.cs
- QilInvoke.cs
- EncoderBestFitFallback.cs
- XmlSchemaValidationException.cs
- ListViewGroupConverter.cs
- TypeUtils.cs
- Misc.cs
- BamlLocalizer.cs
- ReaderWriterLockSlim.cs
- HttpRequestTraceRecord.cs