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
- VisualProxy.cs
- Hashtable.cs
- ProtocolsConfigurationHandler.cs
- Stylesheet.cs
- TreeNode.cs
- HTTP_SERVICE_CONFIG_URLACL_KEY.cs
- BezierSegment.cs
- MimeFormatExtensions.cs
- VerticalConnector.xaml.cs
- ToolStripRendererSwitcher.cs
- ISAPIRuntime.cs
- ListViewGroupConverter.cs
- PrinterResolution.cs
- OpCellTreeNode.cs
- TypeSystem.cs
- ConstraintStruct.cs
- InputElement.cs
- DbInsertCommandTree.cs
- XmlLanguage.cs
- ConnectionPoint.cs
- HtmlForm.cs
- EntityTransaction.cs
- InputProcessorProfiles.cs
- connectionpool.cs
- CacheAxisQuery.cs
- OdbcError.cs
- PersistStreamTypeWrapper.cs
- StringValueSerializer.cs
- SizeKeyFrameCollection.cs
- AncestorChangedEventArgs.cs
- Predicate.cs
- HtmlFormParameterWriter.cs
- ObjectDisposedException.cs
- StreamMarshaler.cs
- IgnoreDeviceFilterElement.cs
- BoolExpressionVisitors.cs
- MatrixIndependentAnimationStorage.cs
- SslStream.cs
- Calendar.cs
- Graph.cs
- TextTreeInsertUndoUnit.cs
- StringStorage.cs
- TriggerBase.cs
- PriorityChain.cs
- ConditionalBranch.cs
- DbSetClause.cs
- _SecureChannel.cs
- WithParamAction.cs
- ToolStripHighContrastRenderer.cs
- QueueNameHelper.cs
- XmlSchemaValidator.cs
- SortedList.cs
- XmlNamespaceMappingCollection.cs
- NameScope.cs
- EntityDataSourceWrapperCollection.cs
- KeyValuePairs.cs
- TraceFilter.cs
- RowTypeElement.cs
- Attribute.cs
- TableLayoutStyle.cs
- TcpConnectionPoolSettings.cs
- CodeAttributeDeclarationCollection.cs
- UpdateProgress.cs
- PersistChildrenAttribute.cs
- ByteStreamMessageEncoderFactory.cs
- PropertyEntry.cs
- WebPartCloseVerb.cs
- OdbcPermission.cs
- CodeAttributeDeclarationCollection.cs
- SingleAnimationBase.cs
- XMLDiffLoader.cs
- DocumentScope.cs
- TableItemPattern.cs
- GenericRootAutomationPeer.cs
- InProcStateClientManager.cs
- XPathSelfQuery.cs
- SqlStream.cs
- RelationshipWrapper.cs
- ClipboardData.cs
- DeviceFiltersSection.cs
- UserThread.cs
- SafeTokenHandle.cs
- HTMLTagNameToTypeMapper.cs
- RecordsAffectedEventArgs.cs
- TextParagraphProperties.cs
- ErrorCodes.cs
- MultiTrigger.cs
- AlphaSortedEnumConverter.cs
- COAUTHINFO.cs
- SignatureHelper.cs
- TypeSystemHelpers.cs
- OrderedParallelQuery.cs
- ClassImporter.cs
- RoleBoolean.cs
- SiteMapSection.cs
- DataGridViewHitTestInfo.cs
- NameTable.cs
- CompiledQuery.cs
- SelectionRange.cs
- Cloud.cs