SignatureToken.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Reflection / Emit / SignatureToken.cs / 1305376 / SignatureToken.cs

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 
/*============================================================
** 
** Signature:  SignatureToken 
**
** [....] 
**
**
** Purpose: Represents a Signature to the ILGenerator signature.
** 
**
===========================================================*/ 
namespace System.Reflection.Emit { 

    using System; 
    using System.Reflection;
    using System.Security.Permissions;

    [System.Runtime.InteropServices.ComVisible(true)] 
    public struct SignatureToken {
 
        public static readonly SignatureToken Empty = new SignatureToken(); 

        internal int m_signature; 
        internal ModuleBuilder m_moduleBuilder;

        internal SignatureToken(int str, ModuleBuilder mod) {
            m_signature=str; 
            m_moduleBuilder = mod;
        } 
 
        public int Token {
            get { return m_signature; } 
        }

        public override int GetHashCode()
        { 
            return m_signature;
        } 
 
        public override bool Equals(Object obj)
        { 
            if (obj is SignatureToken)
                return Equals((SignatureToken)obj);
            else
                return false; 
        }
 
        public bool Equals(SignatureToken obj) 
        {
            return obj.m_signature == m_signature; 
        }

        public static bool operator ==(SignatureToken a, SignatureToken b)
        { 
            return a.Equals(b);
        } 
 
        public static bool operator !=(SignatureToken a, SignatureToken b)
        { 
            return !(a == b);
        }

    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 
/*============================================================
** 
** Signature:  SignatureToken 
**
** [....] 
**
**
** Purpose: Represents a Signature to the ILGenerator signature.
** 
**
===========================================================*/ 
namespace System.Reflection.Emit { 

    using System; 
    using System.Reflection;
    using System.Security.Permissions;

    [System.Runtime.InteropServices.ComVisible(true)] 
    public struct SignatureToken {
 
        public static readonly SignatureToken Empty = new SignatureToken(); 

        internal int m_signature; 
        internal ModuleBuilder m_moduleBuilder;

        internal SignatureToken(int str, ModuleBuilder mod) {
            m_signature=str; 
            m_moduleBuilder = mod;
        } 
 
        public int Token {
            get { return m_signature; } 
        }

        public override int GetHashCode()
        { 
            return m_signature;
        } 
 
        public override bool Equals(Object obj)
        { 
            if (obj is SignatureToken)
                return Equals((SignatureToken)obj);
            else
                return false; 
        }
 
        public bool Equals(SignatureToken obj) 
        {
            return obj.m_signature == m_signature; 
        }

        public static bool operator ==(SignatureToken a, SignatureToken b)
        { 
            return a.Equals(b);
        } 
 
        public static bool operator !=(SignatureToken a, SignatureToken b)
        { 
            return !(a == b);
        }

    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK