System.Security.PermissionTokenKeyComparer.Compare C# (CSharp) Method

Compare() public method

public Compare ( Object a, Object b ) : int
a Object
b Object
return int
        public int Compare( Object a, Object b )
        {
            String strA = a as String;
            String strB = b as String;

            // if it's not a string then we just call the object comparer
            if (strA == null || strB == null)
                return _caseSensitiveComparer.Compare(a,b);

            int i = _caseSensitiveComparer.Compare(a,b);
            if (i == 0)
                return 0;

            if (SecurityManager._IsSameType( strA, strB ))
                return 0;
            
            return i;
        }