Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / clr / src / BCL / System / Reflection / Emit / FieldToken.cs / 1 / FieldToken.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: FieldToken ** ** ** Purpose: Represents a Field to the ILGenerator Class ** ** ===========================================================*/ namespace System.Reflection.Emit { using System; using System.Reflection; using System.Security.Permissions; // The FieldToken class is an opaque representation of the Token returned // by the Metadata to represent the field. FieldTokens are generated by // Module.GetFieldToken(). There are no meaningful accessors on this class, // but it can be passed to ILGenerator which understands it's internals. [Serializable()] [System.Runtime.InteropServices.ComVisible(true)] public struct FieldToken { public static readonly FieldToken Empty = new FieldToken(); internal int m_fieldTok; internal Object m_class; // Creates an empty FieldToken. A publicly visible constructor so that // it can be created on the stack. //public FieldToken() { // m_fieldTok=0; // m_attributes=0; // m_class=null; //} // The actual constructor. Sets the field, attributes and class // variables internal FieldToken (int field, Type fieldClass) { m_fieldTok=field; m_class = fieldClass; } public int Token { get { return m_fieldTok; } } // Generates the hash code for this field. public override int GetHashCode() { return (m_fieldTok); } // Returns true if obj is an instance of FieldToken and is // equal to this instance. public override bool Equals(Object obj) { if (obj is FieldToken) return Equals((FieldToken)obj); else return false; } public bool Equals(FieldToken obj) { return obj.m_fieldTok == m_fieldTok && obj.m_class == m_class; } public static bool operator ==(FieldToken a, FieldToken b) { return a.Equals(b); } public static bool operator !=(FieldToken a, FieldToken b) { return !(a == b); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== /*============================================================ ** ** Class: FieldToken ** ** ** Purpose: Represents a Field to the ILGenerator Class ** ** ===========================================================*/ namespace System.Reflection.Emit { using System; using System.Reflection; using System.Security.Permissions; // The FieldToken class is an opaque representation of the Token returned // by the Metadata to represent the field. FieldTokens are generated by // Module.GetFieldToken(). There are no meaningful accessors on this class, // but it can be passed to ILGenerator which understands it's internals. [Serializable()] [System.Runtime.InteropServices.ComVisible(true)] public struct FieldToken { public static readonly FieldToken Empty = new FieldToken(); internal int m_fieldTok; internal Object m_class; // Creates an empty FieldToken. A publicly visible constructor so that // it can be created on the stack. //public FieldToken() { // m_fieldTok=0; // m_attributes=0; // m_class=null; //} // The actual constructor. Sets the field, attributes and class // variables internal FieldToken (int field, Type fieldClass) { m_fieldTok=field; m_class = fieldClass; } public int Token { get { return m_fieldTok; } } // Generates the hash code for this field. public override int GetHashCode() { return (m_fieldTok); } // Returns true if obj is an instance of FieldToken and is // equal to this instance. public override bool Equals(Object obj) { if (obj is FieldToken) return Equals((FieldToken)obj); else return false; } public bool Equals(FieldToken obj) { return obj.m_fieldTok == m_fieldTok && obj.m_class == m_class; } public static bool operator ==(FieldToken a, FieldToken b) { return a.Equals(b); } public static bool operator !=(FieldToken a, FieldToken b) { return !(a == b); } } } // 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
- ClrProviderManifest.cs
- DataTableNewRowEvent.cs
- ExpressionBuilder.cs
- Stackframe.cs
- StructuredProperty.cs
- XmlNodeList.cs
- ReliabilityContractAttribute.cs
- InputBindingCollection.cs
- Int32.cs
- Rotation3D.cs
- ComponentDispatcherThread.cs
- TdsParserSafeHandles.cs
- AspNetCompatibilityRequirementsMode.cs
- LineBreak.cs
- AutoResetEvent.cs
- CodeTypeOfExpression.cs
- ToolTipService.cs
- DoubleLinkListEnumerator.cs
- DataSourceSerializationException.cs
- DecoratedNameAttribute.cs
- SSmlParser.cs
- FilterQuery.cs
- ConfigurationStrings.cs
- XmlTextAttribute.cs
- Stylus.cs
- XmlEntity.cs
- BitmapFrameDecode.cs
- GenerateHelper.cs
- CustomAttributeSerializer.cs
- CatalogPartCollection.cs
- UnsafeNativeMethodsCLR.cs
- FontDialog.cs
- TdsParser.cs
- StickyNoteAnnotations.cs
- XmlSchemaImporter.cs
- WrappedReader.cs
- ToolStrip.cs
- GroupBox.cs
- EncodingStreamWrapper.cs
- Run.cs
- AnimationException.cs
- MemberAccessException.cs
- ShaperBuffers.cs
- initElementDictionary.cs
- UshortList2.cs
- ToolStripSettings.cs
- SQLBytesStorage.cs
- ItemDragEvent.cs
- TypeSystem.cs
- xsdvalidator.cs
- ObjectList.cs
- NetworkStream.cs
- WebPartDisplayModeEventArgs.cs
- BindingValueChangedEventArgs.cs
- UtilityExtension.cs
- ReflectionTypeLoadException.cs
- RectKeyFrameCollection.cs
- XmlExceptionHelper.cs
- ProgressBarAutomationPeer.cs
- XmlILIndex.cs
- ImageAttributes.cs
- TextPointerBase.cs
- contentDescriptor.cs
- LayoutEvent.cs
- ByteAnimation.cs
- ModelTreeEnumerator.cs
- SliderAutomationPeer.cs
- EntityEntry.cs
- IteratorDescriptor.cs
- DashStyle.cs
- Property.cs
- TextWriter.cs
- TableLayoutSettings.cs
- Stylesheet.cs
- ListViewEditEventArgs.cs
- GcHandle.cs
- ProfileInfo.cs
- MenuBase.cs
- FormatterConverter.cs
- EllipticalNodeOperations.cs
- MaterialGroup.cs
- BitmapSourceSafeMILHandle.cs
- ItemList.cs
- Token.cs
- ExpressionBindingCollection.cs
- _CacheStreams.cs
- RenderData.cs
- IntegrationExceptionEventArgs.cs
- DrawingAttributeSerializer.cs
- ZoneLinkButton.cs
- AgileSafeNativeMemoryHandle.cs
- HttpServerProtocol.cs
- XmlSchemaImport.cs
- Pen.cs
- QilPatternFactory.cs
- Variant.cs
- JumpList.cs
- XmlILConstructAnalyzer.cs
- GestureRecognizer.cs
- ResourceDescriptionAttribute.cs