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
- SizeAnimationUsingKeyFrames.cs
- ProcessModelInfo.cs
- AttributeData.cs
- XmlHierarchyData.cs
- DesignerUtility.cs
- CaseStatement.cs
- RightsManagementResourceHelper.cs
- BamlTreeMap.cs
- BamlCollectionHolder.cs
- ProcessHostMapPath.cs
- WebPartHeaderCloseVerb.cs
- HopperCache.cs
- PageBorderless.cs
- ExtendedPropertyDescriptor.cs
- StringValidatorAttribute.cs
- HashCodeCombiner.cs
- HostingEnvironmentException.cs
- IndentedWriter.cs
- ToolboxItemFilterAttribute.cs
- DockAndAnchorLayout.cs
- X509SecurityToken.cs
- ListViewContainer.cs
- Authorization.cs
- HitTestWithPointDrawingContextWalker.cs
- TransformCollection.cs
- HttpInputStream.cs
- ThousandthOfEmRealDoubles.cs
- FixedTextBuilder.cs
- FreezableOperations.cs
- CssClassPropertyAttribute.cs
- NonSerializedAttribute.cs
- Int32RectConverter.cs
- SafeEventHandle.cs
- GC.cs
- QueryProcessor.cs
- File.cs
- OutArgument.cs
- ReceiveContent.cs
- ReaderWriterLock.cs
- RegisteredExpandoAttribute.cs
- TaskDesigner.cs
- CatalogZone.cs
- PermissionAttributes.cs
- TypeSchema.cs
- TextEndOfLine.cs
- Line.cs
- XmlValidatingReaderImpl.cs
- SoapHttpTransportImporter.cs
- DynamicArgumentDialog.cs
- ClientTargetSection.cs
- DeviceFilterDictionary.cs
- SqlNotificationRequest.cs
- ViewBox.cs
- HostSecurityManager.cs
- ExpressionCopier.cs
- ISAPIApplicationHost.cs
- FontConverter.cs
- MultiAsyncResult.cs
- Image.cs
- TiffBitmapEncoder.cs
- SiteOfOriginPart.cs
- ProviderException.cs
- CopyOnWriteList.cs
- FormatException.cs
- Crc32.cs
- InputReport.cs
- PriorityRange.cs
- UserMapPath.cs
- Literal.cs
- IssuedTokenParametersEndpointAddressElement.cs
- EditorZoneDesigner.cs
- XmlEntity.cs
- UInt32Storage.cs
- IISMapPath.cs
- LogicalChannel.cs
- PerfService.cs
- ParallelQuery.cs
- EdmProperty.cs
- DataGridViewControlCollection.cs
- TemplateNameScope.cs
- JapaneseLunisolarCalendar.cs
- CommentGlyph.cs
- SmiMetaDataProperty.cs
- RepeatButton.cs
- LazyTextWriterCreator.cs
- XmlDataCollection.cs
- SimpleBitVector32.cs
- TextLineBreak.cs
- XmlNodeChangedEventManager.cs
- compensatingcollection.cs
- EastAsianLunisolarCalendar.cs
- TextTreeDeleteContentUndoUnit.cs
- Random.cs
- VirtualizingStackPanel.cs
- UriParserTemplates.cs
- Int32RectValueSerializer.cs
- CustomLineCap.cs
- ToolStripContainer.cs
- ObjectConverter.cs
- MenuItemAutomationPeer.cs