ParameterToken.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

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

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 
/*============================================================
** 
** Class:  ParameterToken 
**
** [....] 
**
**
** Purpose: metadata tokens for a parameter
** 
**
===========================================================*/ 
namespace System.Reflection.Emit { 

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

    // The ParameterToken class is an opaque representation of the Token returned 
    // by the Metadata to represent the parameter.
    [Serializable] 
    [System.Runtime.InteropServices.ComVisible(true)] 
    public struct ParameterToken {
 
        public static readonly ParameterToken Empty = new ParameterToken();
        internal int m_tkParameter;

#if false 
        public ParameterToken() {
            m_tkParameter=0; 
        } 
#endif
 
        internal ParameterToken(int tkParam) {
            m_tkParameter = tkParam;
        }
 
        public int Token {
            get { return m_tkParameter; } 
        } 

        public override int GetHashCode() 
        {
            return m_tkParameter;
        }
 
        public override bool Equals(Object obj)
        { 
            if (obj is ParameterToken) 
                return Equals((ParameterToken)obj);
            else 
                return false;
        }

        public bool Equals(ParameterToken obj) 
        {
            return obj.m_tkParameter == m_tkParameter; 
        } 

        public static bool operator ==(ParameterToken a, ParameterToken b) 
        {
            return a.Equals(b);
        }
 
        public static bool operator !=(ParameterToken a, ParameterToken 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