Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / Reader / EventOpcode.cs / 1305376 / EventOpcode.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: EventOpcode ** ** Purpose: ** This public class describes the metadata for a specific Opcode ** defined by a Provider. An instance of this class is obtained from ** a ProviderMetadata object. ** ============================================================*/ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; namespace System.Diagnostics.Eventing.Reader { [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] public sealed class EventOpcode { private int value; private string name; private string displayName; private bool dataReady; ProviderMetadata pmReference; object syncObject; //call from EventMetadata internal EventOpcode(int value, ProviderMetadata pmReference) { this.value = value; this.pmReference = pmReference; this.syncObject = new object(); } //call from ProviderMetadata internal EventOpcode(string name, int value, string displayName) { this.value = value; this.name = name; this.displayName = displayName; this.dataReady = true; this.syncObject = new object(); } internal void PrepareData() { lock (syncObject) { if (dataReady == true) return; // get the data IEnumerableresult = pmReference.Opcodes; //set the names and display names to null this.name = null; this.displayName = null; this.dataReady = true; foreach (EventOpcode op in result) { if (op.Value == this.value) { this.name = op.Name; this.displayName = op.DisplayName; this.dataReady = true; break; } } } }//End Prepare Data public string Name { get { PrepareData(); return this.name; } } public int Value { get { return this.value; } } public string DisplayName { get { PrepareData(); return this.displayName; } } } } // 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
- Geometry.cs
- BulletChrome.cs
- XmlILStorageConverter.cs
- ByteAnimationUsingKeyFrames.cs
- AssemblyAttributesGoHere.cs
- DetailsViewUpdateEventArgs.cs
- DataStreams.cs
- CompilerGlobalScopeAttribute.cs
- BuildProvider.cs
- UnknownBitmapDecoder.cs
- DefaultTraceListener.cs
- FixedDocumentSequencePaginator.cs
- AdornedElementPlaceholder.cs
- PromptStyle.cs
- XmlAttributeAttribute.cs
- UnauthorizedWebPart.cs
- RuleRef.cs
- PingReply.cs
- TimeZone.cs
- Rule.cs
- OrderedDictionary.cs
- xmlsaver.cs
- SyndicationElementExtension.cs
- EntityTypeEmitter.cs
- QuaternionRotation3D.cs
- LabelLiteral.cs
- Menu.cs
- IResourceProvider.cs
- MetadataItemSerializer.cs
- CommonProperties.cs
- SqlClientWrapperSmiStream.cs
- DataServiceHost.cs
- PasswordTextContainer.cs
- IDReferencePropertyAttribute.cs
- MDIControlStrip.cs
- HMACRIPEMD160.cs
- CompilerInfo.cs
- ListViewGroupConverter.cs
- ComplusEndpointConfigContainer.cs
- DrawingVisual.cs
- ColorConverter.cs
- _NativeSSPI.cs
- KeyProperty.cs
- ConnectorEditor.cs
- OleDbError.cs
- HandlerMappingMemo.cs
- CommandField.cs
- EntityReference.cs
- BinHexEncoding.cs
- HttpRequest.cs
- MetaChildrenColumn.cs
- MarkupObject.cs
- DbProviderConfigurationHandler.cs
- SqlExpander.cs
- StringStorage.cs
- DbConnectionPool.cs
- CommandLibraryHelper.cs
- SamlConstants.cs
- WebBaseEventKeyComparer.cs
- SecurityContext.cs
- COM2PictureConverter.cs
- PlatformCulture.cs
- DataGridAddNewRow.cs
- ColorMatrix.cs
- XmlTextReaderImpl.cs
- SiteMap.cs
- BinaryMethodMessage.cs
- NullableBoolConverter.cs
- DecimalAnimationBase.cs
- ContextProperty.cs
- SchemaNames.cs
- ApplicationCommands.cs
- FormViewRow.cs
- DataTablePropertyDescriptor.cs
- PackagePart.cs
- Transform.cs
- AutomationPatternInfo.cs
- adornercollection.cs
- EventLogEntry.cs
- DefaultAssemblyResolver.cs
- RunClient.cs
- MenuItemStyle.cs
- PublisherIdentityPermission.cs
- XmlLangPropertyAttribute.cs
- ControlIdConverter.cs
- WebContext.cs
- XmlAttribute.cs
- PrincipalPermission.cs
- Screen.cs
- EnumerableRowCollectionExtensions.cs
- Types.cs
- Point3D.cs
- PersonalizationStateQuery.cs
- InertiaTranslationBehavior.cs
- NeutralResourcesLanguageAttribute.cs
- SectionVisual.cs
- FontWeights.cs
- RolePrincipal.cs
- RowUpdatingEventArgs.cs
- ExceptionWrapper.cs