예제 #1
0
            public int Compare(ScriptingValue x, ScriptingValue y)
            {
                switch (ScriptingLibrary.Compare(x, y))
                {
                case CompareResult.EqualTo: return(0);

                case CompareResult.GreaterThan: return(1);

                case CompareResult.LessThan: return(-1);

                default: throw new InvalidOperationException(string.Format("{0}和{1}无法进行比较。", x, y));
                }
            }
예제 #2
0
 public bool Equals(ScriptingValue x, ScriptingValue y)
 {
     return(ScriptingLibrary.Compare(x, y) == CompareResult.EqualTo);
 }