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
- ExpressionDumper.cs
- RegexCharClass.cs
- StateItem.cs
- TextChangedEventArgs.cs
- ErrorProvider.cs
- PtsHost.cs
- SchemaInfo.cs
- CodeDelegateCreateExpression.cs
- ToolStripItemBehavior.cs
- DataSourceHelper.cs
- StreamUpdate.cs
- EntityUtil.cs
- FixedFlowMap.cs
- ChtmlLinkAdapter.cs
- SafeFileMappingHandle.cs
- MembershipValidatePasswordEventArgs.cs
- WebPart.cs
- MonthChangedEventArgs.cs
- DataContext.cs
- AudioFormatConverter.cs
- IndicCharClassifier.cs
- TextBoxDesigner.cs
- DataGridViewToolTip.cs
- OutputCacheSection.cs
- SqlTopReducer.cs
- WindowsRichEditRange.cs
- ConfigXmlElement.cs
- EncodedStreamFactory.cs
- IsolatedStorage.cs
- Point3DConverter.cs
- TextFormatterHost.cs
- ScalarOps.cs
- ExecutionContext.cs
- ClientSettingsSection.cs
- QuaternionIndependentAnimationStorage.cs
- TextTreeDeleteContentUndoUnit.cs
- UpdateRecord.cs
- LoadRetryAsyncResult.cs
- SafeBuffer.cs
- MessageDecoder.cs
- SystemIcmpV6Statistics.cs
- UrlParameterReader.cs
- Crypto.cs
- AliasedSlot.cs
- ContractDescription.cs
- ExtractorMetadata.cs
- PeerInvitationResponse.cs
- WorkflowInstanceQuery.cs
- SafeBitVector32.cs
- TargetPerspective.cs
- MsdtcWrapper.cs
- Binding.cs
- PanelDesigner.cs
- ThemeDirectoryCompiler.cs
- JulianCalendar.cs
- UrlEncodedParameterWriter.cs
- FontInfo.cs
- MaterialGroup.cs
- ArrayWithOffset.cs
- MethodToken.cs
- CompoundFileIOPermission.cs
- ObjectTag.cs
- ReflectionServiceProvider.cs
- ResXResourceSet.cs
- TemplatedMailWebEventProvider.cs
- MarkupExtensionParser.cs
- HasCopySemanticsAttribute.cs
- ArrayHelper.cs
- HttpPostedFile.cs
- EdmType.cs
- NetworkCredential.cs
- VisualStyleRenderer.cs
- AssemblyName.cs
- HtmlAnchor.cs
- WindowsRichEdit.cs
- CollectionCodeDomSerializer.cs
- Win32.cs
- FilteredSchemaElementLookUpTable.cs
- LayoutEvent.cs
- RepeatButtonAutomationPeer.cs
- SoapObjectInfo.cs
- ObjectViewFactory.cs
- SwitchLevelAttribute.cs
- IODescriptionAttribute.cs
- XmlMemberMapping.cs
- ColorTransform.cs
- DataObjectAttribute.cs
- ObjectDataSource.cs
- autovalidator.cs
- Point3DKeyFrameCollection.cs
- CatalogZone.cs
- PreviewPrintController.cs
- ResourceContainer.cs
- RandomDelaySendsAsyncResult.cs
- HostVisual.cs
- UiaCoreProviderApi.cs
- ContextActivityUtils.cs
- TabPageDesigner.cs
- DtrList.cs
- WebPartTransformer.cs