Ref.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 / fx / src / Xml / System / Xml / Ref.cs / 1305376 / Ref.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
//-----------------------------------------------------------------------------
 
using System.Diagnostics; 

namespace System.Xml { 

    /// 
    /// Ref class is used to verify string atomization in debug mode.
    ///  
    internal static class Ref {
        public static bool Equal(string strA, string strB) { 
        #if DEBUG 
            if (((object) strA != (object) strB) && string.Equals(strA, strB))
                Debug.Assert(false, "Ref.Equal: Object comparison used for non-atomized string '" + strA + "'"); 
        #endif
            return (object) strA == (object) strB;
        }
 
        // Prevent typos. If someone uses Ref.Equals instead of Ref.Equal,
        // the program would not compile. 
        public static new void Equals(object objA, object objB) { 
        }
    } 
}

// 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