Code:
/ 4.0 / 4.0 / 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. // ==++== // // 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 IEnumerable result = 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
- Marshal.cs
- FixedSOMTableCell.cs
- Decoder.cs
- ByteStream.cs
- QueryOperator.cs
- ConditionalAttribute.cs
- ListenUriMode.cs
- ISessionStateStore.cs
- Int16AnimationUsingKeyFrames.cs
- DataServiceRequest.cs
- CustomAttributeSerializer.cs
- PageStatePersister.cs
- TaskDesigner.cs
- WeakReferenceEnumerator.cs
- FillRuleValidation.cs
- TextBreakpoint.cs
- ActivationServices.cs
- CodeMethodReturnStatement.cs
- ADMembershipUser.cs
- RangeExpression.cs
- IndexedString.cs
- WaitForChangedResult.cs
- GifBitmapDecoder.cs
- DurableMessageDispatchInspector.cs
- XmlIlTypeHelper.cs
- HwndSource.cs
- RulePatternOps.cs
- OuterProxyWrapper.cs
- WindowsButton.cs
- WebPartVerb.cs
- HScrollProperties.cs
- LinqDataSourceDisposeEventArgs.cs
- SessionParameter.cs
- Rights.cs
- DefaultSerializationProviderAttribute.cs
- ElementAction.cs
- Debug.cs
- TypeCacheManager.cs
- SingleConverter.cs
- safelink.cs
- SmtpNtlmAuthenticationModule.cs
- Triplet.cs
- PlacementWorkspace.cs
- LoggedException.cs
- CollectionViewSource.cs
- AnimationClock.cs
- RewritingValidator.cs
- ItemCheckEvent.cs
- ClientTargetCollection.cs
- LinqDataSourceInsertEventArgs.cs
- TypeBuilderInstantiation.cs
- XamlToRtfWriter.cs
- SpecialTypeDataContract.cs
- SQLDecimal.cs
- Compiler.cs
- TrackingAnnotationCollection.cs
- MetaTableHelper.cs
- DependencyProperty.cs
- isolationinterop.cs
- SchemaElementLookUpTableEnumerator.cs
- Propagator.ExtentPlaceholderCreator.cs
- InfoCardArgumentException.cs
- WindowsSlider.cs
- UnmanagedMemoryStream.cs
- Aggregates.cs
- BypassElementCollection.cs
- PropVariant.cs
- GridViewColumnCollection.cs
- PeerNearMe.cs
- HandleCollector.cs
- MsmqIntegrationElement.cs
- HttpRuntime.cs
- TreeNodeStyle.cs
- EncryptedType.cs
- WorkflowOperationContext.cs
- ReplyAdapterChannelListener.cs
- ListViewItemEventArgs.cs
- FloatUtil.cs
- StylusPointCollection.cs
- CompilationUtil.cs
- RotateTransform3D.cs
- WorkflowRuntimeEndpoint.cs
- PrintingPermissionAttribute.cs
- X509SecurityTokenProvider.cs
- DbException.cs
- MenuBase.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- ChangeTracker.cs
- ControlPaint.cs
- WindowsStatic.cs
- WebPartConnectionsCancelEventArgs.cs
- base64Transforms.cs
- SqlDataRecord.cs
- FlowDocumentPageViewerAutomationPeer.cs
- CalendarTable.cs
- StyleReferenceConverter.cs
- XmlSchemaExporter.cs
- DataRecord.cs
- TransformCollection.cs
- OracleFactory.cs