Token.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 / Diagnostics / SymbolStore / Token.cs / 1305376 / Token.cs

                            // ==++== 
//
//   Copyright (c) Microsoft Corporation.  All rights reserved.
//
// ==--== 
/*============================================================
** 
** Class:  SymbolToken 
**
** Small value class used by the SymbolStore package for passing 
** around metadata tokens.
**
===========================================================*/
namespace System.Diagnostics.SymbolStore { 

    using System; 
    using System.Runtime.InteropServices; 

    [ComVisible(true)] 
    public struct SymbolToken
    {
        internal int m_token;
 
        public SymbolToken(int val) {m_token=val;}
 
        public int GetToken() {return m_token;} 

        public override int GetHashCode() {return m_token;} 

        public override bool Equals(Object obj)
        {
            if (obj is SymbolToken) 
                return Equals((SymbolToken)obj);
            else 
                return false; 
        }
 
        public bool Equals(SymbolToken obj)
        {
            return obj.m_token == m_token;
        } 

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

        public static bool operator !=(SymbolToken a, SymbolToken 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