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
- DataSourceXmlSerializer.cs
- TimeManager.cs
- CodeMemberEvent.cs
- Expr.cs
- CodeGeneratorOptions.cs
- TypeBuilderInstantiation.cs
- ObjectRef.cs
- LogEntrySerializationException.cs
- DynamicEntity.cs
- ClosableStream.cs
- HelloMessageCD1.cs
- peernodeimplementation.cs
- SrgsNameValueTag.cs
- EventBuilder.cs
- CommandEventArgs.cs
- ScaleTransform3D.cs
- InputBinding.cs
- FileNameEditor.cs
- ExecutionContext.cs
- BlurBitmapEffect.cs
- ImpersonationContext.cs
- ContextStaticAttribute.cs
- UnmanagedMemoryAccessor.cs
- UInt64Converter.cs
- CommandBindingCollection.cs
- GridPatternIdentifiers.cs
- CodeIndexerExpression.cs
- Matrix3DConverter.cs
- MimeTypePropertyAttribute.cs
- SurrogateEncoder.cs
- TimelineCollection.cs
- RoleGroup.cs
- ContentPosition.cs
- ProgressBarAutomationPeer.cs
- DbDataReader.cs
- OAVariantLib.cs
- ToolStripDropDownButton.cs
- DescendantQuery.cs
- CodeBlockBuilder.cs
- TraceSection.cs
- TcpTransportManager.cs
- DataPagerFieldCollection.cs
- BindingFormattingDialog.cs
- InstanceCompleteException.cs
- ExtendedProtectionPolicyTypeConverter.cs
- ClientFormsAuthenticationCredentials.cs
- Scheduling.cs
- BindingList.cs
- XamlTypeWithExplicitNamespace.cs
- SqlClientWrapperSmiStreamChars.cs
- ActivitySurrogate.cs
- Message.cs
- Shared.cs
- CompilationLock.cs
- GeneralTransform2DTo3DTo2D.cs
- CollectionType.cs
- SkewTransform.cs
- COM2IProvidePropertyBuilderHandler.cs
- IncrementalReadDecoders.cs
- ScriptingAuthenticationServiceSection.cs
- ListComponentEditorPage.cs
- shaperfactoryquerycacheentry.cs
- PolicyLevel.cs
- WindowsImpersonationContext.cs
- Action.cs
- CriticalHandle.cs
- BorderGapMaskConverter.cs
- NewExpression.cs
- ServiceDescription.cs
- CustomAttributeBuilder.cs
- ChooseAction.cs
- ThemeDirectoryCompiler.cs
- RadioButtonBaseAdapter.cs
- ConstraintConverter.cs
- ScriptResourceHandler.cs
- VectorAnimation.cs
- DbConnectionHelper.cs
- Literal.cs
- DataServiceStreamResponse.cs
- ConfigXmlText.cs
- EventWaitHandleSecurity.cs
- WebPartDisplayModeEventArgs.cs
- DateTimeUtil.cs
- ellipse.cs
- LinqDataSourceSelectEventArgs.cs
- CommonRemoteMemoryBlock.cs
- VisualStates.cs
- DataError.cs
- _BaseOverlappedAsyncResult.cs
- Touch.cs
- ProjectionPruner.cs
- PenLineJoinValidation.cs
- TreeNodeCollection.cs
- RSAPKCS1KeyExchangeFormatter.cs
- ToolboxItemCollection.cs
- HtmlInputImage.cs
- DetailsViewPageEventArgs.cs
- ICspAsymmetricAlgorithm.cs
- CommandBinding.cs
- RenderTargetBitmap.cs