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
- PageBuildProvider.cs
- RSAPKCS1KeyExchangeFormatter.cs
- DateTimePickerDesigner.cs
- SafeMemoryMappedViewHandle.cs
- ListControl.cs
- SmiGettersStream.cs
- SchemaTableOptionalColumn.cs
- FontEditor.cs
- ViewStateModeByIdAttribute.cs
- GeneratedView.cs
- SqlStream.cs
- XamlSerializerUtil.cs
- BitmapEncoder.cs
- FaultReasonText.cs
- PEFileReader.cs
- ListItemCollection.cs
- VectorConverter.cs
- GeometryDrawing.cs
- AutoGeneratedFieldProperties.cs
- DynamicPropertyHolder.cs
- PropertyGridView.cs
- OpCodes.cs
- dbdatarecord.cs
- TypedTableBaseExtensions.cs
- Fx.cs
- ButtonColumn.cs
- RealProxy.cs
- GridView.cs
- X509Utils.cs
- UInt64Converter.cs
- QilExpression.cs
- InkCanvasFeedbackAdorner.cs
- RuleInfoComparer.cs
- GacUtil.cs
- DataGridItemAutomationPeer.cs
- SignatureGenerator.cs
- ServiceBehaviorElement.cs
- newinstructionaction.cs
- ProfilePropertySettings.cs
- Speller.cs
- ContainerFilterService.cs
- TimeSpanConverter.cs
- ModuleBuilderData.cs
- BooleanStorage.cs
- TreeSet.cs
- EntityDataSourceQueryBuilder.cs
- InstallerTypeAttribute.cs
- BufferedReadStream.cs
- Label.cs
- Pen.cs
- ByteRangeDownloader.cs
- ObjectQueryExecutionPlan.cs
- NumberFormatInfo.cs
- SpeechDetectedEventArgs.cs
- PropertyCollection.cs
- BitmapData.cs
- FormViewPageEventArgs.cs
- Stylesheet.cs
- DataBindingExpressionBuilder.cs
- MemberPathMap.cs
- Empty.cs
- StringAttributeCollection.cs
- TemplateControlBuildProvider.cs
- CompilationLock.cs
- DataViewManagerListItemTypeDescriptor.cs
- Control.cs
- Executor.cs
- DataGridViewSelectedColumnCollection.cs
- Table.cs
- GC.cs
- CapacityStreamGeometryContext.cs
- XmlParserContext.cs
- Vector3dCollection.cs
- OracleLob.cs
- Cursor.cs
- WebBrowserHelper.cs
- CollectionsUtil.cs
- PageContentCollection.cs
- InternalConfigEventArgs.cs
- NameValueConfigurationElement.cs
- UnknownWrapper.cs
- CompiledIdentityConstraint.cs
- DataServiceQueryException.cs
- TrustManagerPromptUI.cs
- BitmapImage.cs
- IdentityModelStringsVersion1.cs
- Win32MouseDevice.cs
- ProfileGroupSettings.cs
- RefreshEventArgs.cs
- HttpServerProtocol.cs
- ObjectContextServiceProvider.cs
- ObjectItemCollection.cs
- WebDescriptionAttribute.cs
- HelpEvent.cs
- SqlUtils.cs
- ConcurrentBag.cs
- EdmFunctions.cs
- ColumnProvider.cs
- XmlWrappingWriter.cs
- WSSecurityOneDotZeroReceiveSecurityHeader.cs