Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Diagnostics / Eventing / EventDescriptor.cs / 1305376 / EventDescriptor.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; namespace System.Diagnostics.Eventing { [StructLayout(LayoutKind.Explicit, Size = 16)] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public struct EventDescriptor { [FieldOffset(0)] private ushort m_id; [FieldOffset(2)] private byte m_version; [FieldOffset(3)] private byte m_channel; [FieldOffset(4)] private byte m_level; [FieldOffset(5)] private byte m_opcode; [FieldOffset(6)] private ushort m_task; [FieldOffset(8)] private long m_keywords; [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] public EventDescriptor( int id, byte version, byte channel, byte level, byte opcode, int task, long keywords ) { if (id < 0) { throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNum)); } if (id > ushort.MaxValue) { throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } m_id = (ushort)id; m_version = version; m_channel = channel; m_level = level; m_opcode = opcode; m_keywords = keywords; if (task < 0) { throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNum)); } if (task > ushort.MaxValue) { throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } m_task = (ushort)task; } public int EventId { get { return m_id; } } public byte Version { get { return m_version; } } public byte Channel { get { return m_channel; } } public byte Level { get { return m_level; } } [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] public byte Opcode { get { return m_opcode; } } public int Task { get { return m_task; } } public long Keywords { get { return m_keywords; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Runtime.InteropServices; using System.Diagnostics.CodeAnalysis; namespace System.Diagnostics.Eventing { [StructLayout(LayoutKind.Explicit, Size = 16)] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public struct EventDescriptor { [FieldOffset(0)] private ushort m_id; [FieldOffset(2)] private byte m_version; [FieldOffset(3)] private byte m_channel; [FieldOffset(4)] private byte m_level; [FieldOffset(5)] private byte m_opcode; [FieldOffset(6)] private ushort m_task; [FieldOffset(8)] private long m_keywords; [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] public EventDescriptor( int id, byte version, byte channel, byte level, byte opcode, int task, long keywords ) { if (id < 0) { throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNum)); } if (id > ushort.MaxValue) { throw new ArgumentOutOfRangeException("id", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } m_id = (ushort)id; m_version = version; m_channel = channel; m_level = level; m_opcode = opcode; m_keywords = keywords; if (task < 0) { throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedNonNegNum)); } if (task > ushort.MaxValue) { throw new ArgumentOutOfRangeException("task", SR.GetString(SR.ArgumentOutOfRange_NeedValidId, 1, ushort.MaxValue)); } m_task = (ushort)task; } public int EventId { get { return m_id; } } public byte Version { get { return m_version; } } public byte Channel { get { return m_channel; } } public byte Level { get { return m_level; } } [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] public byte Opcode { get { return m_opcode; } } public int Task { get { return m_task; } } public long Keywords { get { return m_keywords; } } } } // 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
- NumberSubstitution.cs
- DataGridItemCollection.cs
- OracleDateTime.cs
- RSAPKCS1SignatureFormatter.cs
- DbDataSourceEnumerator.cs
- AccessibleObject.cs
- XslAstAnalyzer.cs
- TransformGroup.cs
- PropertyEmitter.cs
- SqlWriter.cs
- PhysicalOps.cs
- ButtonPopupAdapter.cs
- CommandEventArgs.cs
- TextViewElement.cs
- ListView.cs
- GestureRecognitionResult.cs
- ModelItemDictionaryImpl.cs
- PolicyImporterElementCollection.cs
- PerformanceCounterManager.cs
- PublisherMembershipCondition.cs
- printdlgexmarshaler.cs
- XamlSerializationHelper.cs
- CapabilitiesUse.cs
- DrawingServices.cs
- CompensationToken.cs
- StdRegProviderWrapper.cs
- TreeNodeEventArgs.cs
- FileSystemInfo.cs
- XmlSchemaInclude.cs
- ValidationError.cs
- InvalidDataException.cs
- DataGridViewRowPostPaintEventArgs.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- GenericsNotImplementedException.cs
- ValidatingPropertiesEventArgs.cs
- InvalidPrinterException.cs
- LinearGradientBrush.cs
- EntityCodeGenerator.cs
- SecurityMode.cs
- HttpWriter.cs
- BamlRecordReader.cs
- GridViewRowEventArgs.cs
- SelectedGridItemChangedEvent.cs
- FunctionCommandText.cs
- SqlExpander.cs
- ImageConverter.cs
- TextBoxView.cs
- XmlILModule.cs
- DateBoldEvent.cs
- _Connection.cs
- PropertyGroupDescription.cs
- ToolStripTextBox.cs
- ListControl.cs
- CurrentTimeZone.cs
- FileDialog_Vista.cs
- SectionUpdates.cs
- SmtpNegotiateAuthenticationModule.cs
- MeshGeometry3D.cs
- XmlSerializerFactory.cs
- FixedSOMGroup.cs
- DrawingVisual.cs
- UIElementCollection.cs
- ThumbButtonInfo.cs
- KeyEventArgs.cs
- cookieexception.cs
- HashSet.cs
- EntityKey.cs
- DynamicResourceExtensionConverter.cs
- DbProviderFactories.cs
- ExpandableObjectConverter.cs
- Parser.cs
- Hashtable.cs
- SqlProfileProvider.cs
- DbParameterHelper.cs
- BulletedListEventArgs.cs
- WSSecureConversationDec2005.cs
- MarkupCompilePass1.cs
- Dictionary.cs
- LinqDataSourceSelectEventArgs.cs
- FirstQueryOperator.cs
- ValueTable.cs
- DataGridViewSortCompareEventArgs.cs
- PeerApplicationLaunchInfo.cs
- AutomationProperty.cs
- XmlHelper.cs
- StateBag.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- RawStylusInput.cs
- columnmapfactory.cs
- TypeNameConverter.cs
- DBBindings.cs
- CommandHelpers.cs
- Stack.cs
- OrthographicCamera.cs
- PrimitiveSchema.cs
- BasicCellRelation.cs
- DynamicDataExtensions.cs
- TimelineGroup.cs
- ActiveXContainer.cs
- XmlEnumAttribute.cs