CompareTo() public method

public CompareTo ( Object target ) : int
target Object
return int
示例#1
0
        public override void Draw()
        {
            if (_data != null)
            {
                Enum tmp_data = _data;
                _data = EView.EnumPopup(_world_pos, _data);

                if (_data.CompareTo(tmp_data) != 0 && change_action != null)
                {
                    change_action(_data);
                }
            }
        }
示例#2
0
 static int CompareTo(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         System.Enum obj  = (System.Enum)ToLua.CheckObject <System.Enum>(L, 1);
         object      arg0 = ToLua.ToVarObject(L, 2);
         int         o    = obj.CompareTo(arg0);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#3
0
    static int CompareTo(IntPtr L)
    {
        ToLua.CheckArgsCount(L, 2);
        System.Enum obj  = (System.Enum)ToLua.CheckObject(L, 1, typeof(System.Enum));
        object      arg0 = ToLua.ToVarObject(L, 2);
        int         o;

        try
        {
            o = obj.CompareTo(arg0);
        }
        catch (Exception e)
        {
            return(LuaDLL.luaL_error(L, e.Message));
        }

        LuaDLL.lua_pushinteger(L, o);
        return(1);
    }
        static StackObject *CompareTo_8(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Object @target = (System.Object) typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Enum instance_of_this_method = (System.Enum) typeof(System.Enum).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.CompareTo(@target);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value      = result_of_this_method;
            return(__ret + 1);
        }
示例#5
0
 public static void CompareTo(Enum e, object target, int expected)
 {
     Assert.Equal(expected, Math.Sign(e.CompareTo(target)));
 }