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
- SmtpNetworkElement.cs
- SqlDataAdapter.cs
- SocketPermission.cs
- IERequestCache.cs
- ListItem.cs
- XmlSchemaException.cs
- NativeRecognizer.cs
- sortedlist.cs
- PathFigure.cs
- SqlInternalConnectionTds.cs
- HtmlHistory.cs
- ControlCollection.cs
- PageParser.cs
- codemethodreferenceexpression.cs
- TypefaceCollection.cs
- PersonalizationAdministration.cs
- XmlHelper.cs
- JsonGlobals.cs
- IODescriptionAttribute.cs
- VSDExceptions.cs
- GridViewRow.cs
- AndCondition.cs
- HttpCapabilitiesBase.cs
- TreeView.cs
- PasswordTextContainer.cs
- DataGridViewColumnHeaderCell.cs
- ResumeStoryboard.cs
- _SslState.cs
- SecurityHeaderLayout.cs
- Interlocked.cs
- HtmlControl.cs
- UIElement.cs
- BuildProvidersCompiler.cs
- CodeMemberMethod.cs
- oledbmetadatacolumnnames.cs
- FocusTracker.cs
- _ChunkParse.cs
- XsdCachingReader.cs
- EditorZoneBase.cs
- ToolStripComboBox.cs
- EventLogException.cs
- RemotingConfigParser.cs
- sapiproxy.cs
- CodeThrowExceptionStatement.cs
- ThaiBuddhistCalendar.cs
- CalendarDay.cs
- ObjectDataSourceEventArgs.cs
- DivideByZeroException.cs
- ObjectQuery.cs
- NumberSubstitution.cs
- MetadataProperty.cs
- PageParser.cs
- metrodevice.cs
- ImageUrlEditor.cs
- ReliabilityContractAttribute.cs
- WpfPayload.cs
- ZoneIdentityPermission.cs
- NativeMethods.cs
- HtmlTitle.cs
- WebPartMovingEventArgs.cs
- ServicePointManager.cs
- CalendarTable.cs
- UnmanagedMemoryStreamWrapper.cs
- ApplicationActivator.cs
- SecurityToken.cs
- XMLSchema.cs
- WeakReferenceKey.cs
- BStrWrapper.cs
- TabPage.cs
- HttpFileCollectionWrapper.cs
- XmlSerializerFormatAttribute.cs
- GroupBoxAutomationPeer.cs
- FlowLayoutPanelDesigner.cs
- HttpGetClientProtocol.cs
- SkinBuilder.cs
- DSASignatureFormatter.cs
- DataGridTextBox.cs
- TraceLevelStore.cs
- InsufficientMemoryException.cs
- Thickness.cs
- PropertyMetadata.cs
- SafeHandles.cs
- FusionWrap.cs
- LayoutManager.cs
- ParentControlDesigner.cs
- CompatibleIComparer.cs
- TreeNodeStyle.cs
- FileFormatException.cs
- ExpandoObject.cs
- DataColumnPropertyDescriptor.cs
- XmlAttributeAttribute.cs
- HtmlLink.cs
- PermissionSetEnumerator.cs
- PropertyGridEditorPart.cs
- VisualBrush.cs
- SafeLibraryHandle.cs
- DictionaryKeyPropertyAttribute.cs
- Subtree.cs
- XmlBuffer.cs
- Parsers.cs