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)); } }
public bool Equals(ScriptingValue x, ScriptingValue y) { return(ScriptingLibrary.Compare(x, y) == CompareResult.EqualTo); }