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
- SuppressMergeCheckAttribute.cs
- LoadWorkflowCommand.cs
- RedistVersionInfo.cs
- SystemIPv4InterfaceProperties.cs
- EventHandlerService.cs
- WebCodeGenerator.cs
- SqlCaseSimplifier.cs
- BulletedList.cs
- Queue.cs
- TileBrush.cs
- Selection.cs
- Propagator.cs
- StrongNamePublicKeyBlob.cs
- Or.cs
- TypeUtil.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- DataContractSerializerSection.cs
- SqlCommandBuilder.cs
- ComPlusTypeLoader.cs
- SiteMapSection.cs
- UnsafeNativeMethodsTablet.cs
- TypeHelpers.cs
- QueryPageSettingsEventArgs.cs
- EventLogPropertySelector.cs
- EncodingConverter.cs
- View.cs
- NonPrimarySelectionGlyph.cs
- HandleExceptionArgs.cs
- Composition.cs
- RequestBringIntoViewEventArgs.cs
- RenameRuleObjectDialog.Designer.cs
- LogFlushAsyncResult.cs
- DesignerActionHeaderItem.cs
- Rect3D.cs
- OpenTypeCommon.cs
- DocumentAutomationPeer.cs
- TypeDescriptionProviderAttribute.cs
- UshortList2.cs
- TreeViewCancelEvent.cs
- NodeInfo.cs
- FileRegion.cs
- HMACSHA1.cs
- DrawingVisual.cs
- PropertyItem.cs
- DataServiceProviderWrapper.cs
- ComplexPropertyEntry.cs
- StorageEntityContainerMapping.cs
- ArglessEventHandlerProxy.cs
- GeneratedCodeAttribute.cs
- NativeMethods.cs
- EntitySqlQueryBuilder.cs
- HttpRuntime.cs
- DataGridColumnCollection.cs
- RegexWorker.cs
- PageClientProxyGenerator.cs
- ColorDialog.cs
- ViewGenerator.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- EdmConstants.cs
- PtsContext.cs
- AddInAdapter.cs
- PrimitiveCodeDomSerializer.cs
- DeflateEmulationStream.cs
- ListCardsInFileRequest.cs
- ParserHooks.cs
- FigureParaClient.cs
- ErrorFormatter.cs
- ListBoxItem.cs
- TagPrefixCollection.cs
- OdbcConnection.cs
- SubpageParaClient.cs
- DefaultValueConverter.cs
- ValueChangedEventManager.cs
- DockPanel.cs
- XNodeNavigator.cs
- SizeLimitedCache.cs
- RepeaterItem.cs
- EntityException.cs
- HWStack.cs
- TagNameToTypeMapper.cs
- IndexedEnumerable.cs
- FileVersionInfo.cs
- WS2007FederationHttpBinding.cs
- HtmlElementErrorEventArgs.cs
- NavigationPropertyAccessor.cs
- DataConnectionHelper.cs
- InkCanvas.cs
- SHA512CryptoServiceProvider.cs
- GridViewDeleteEventArgs.cs
- PersonalizationProvider.cs
- xamlnodes.cs
- BufferedGraphicsContext.cs
- TextRenderer.cs
- WindowsToolbarAsMenu.cs
- SoapFault.cs
- ControlBuilderAttribute.cs
- Path.cs
- LexicalChunk.cs
- ParseNumbers.cs
- DataGridRowAutomationPeer.cs