static int set_AddingNew(IntPtr L)
    {
        try
        {
            Newtonsoft.Json.Linq.JContainer obj = (Newtonsoft.Json.Linq.JContainer)ToLua.CheckObject(L, 1, typeof(Newtonsoft.Json.Linq.JContainer));
            EventObject arg0 = null;

            if (LuaDLL.lua_isuserdata(L, 2) != 0)
            {
                arg0 = (EventObject)ToLua.ToObject(L, 2);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "The event 'Newtonsoft.Json.Linq.JContainer.AddingNew' can only appear on the left hand side of += or -= when used outside of the type 'Newtonsoft.Json.Linq.JContainer'"));
            }

            if (arg0.op == EventOp.Add)
            {
                Newtonsoft.Json.ObservableSupport.AddingNewEventHandler ev = (Newtonsoft.Json.ObservableSupport.AddingNewEventHandler)arg0.func;
                obj.AddingNew += ev;
            }
            else if (arg0.op == EventOp.Sub)
            {
                Newtonsoft.Json.ObservableSupport.AddingNewEventHandler ev = (Newtonsoft.Json.ObservableSupport.AddingNewEventHandler)arg0.func;
                obj.AddingNew -= ev;
            }

            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Пример #2
0
        /// <summary>
        /// Raises the <see cref="AddingNew"/> event.
        /// </summary>
        /// <param name="e">The <see cref="System.ComponentModel.AddingNewEventArgs"/> instance containing the event data.</param>
        protected virtual void OnAddingNew(AddingNewEventArgs e)
        {
            AddingNewEventHandler handler = AddingNew;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Пример #3
0
    public Newtonsoft.Json.ObservableSupport.AddingNewEventHandler Newtonsoft_Json_ObservableSupport_AddingNewEventHandler(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            Newtonsoft.Json.ObservableSupport.AddingNewEventHandler fn = delegate(object param0, Newtonsoft.Json.ObservableSupport.AddingNewEventArgs param1) { };
            return(fn);
        }

        if (!flag)
        {
            Newtonsoft_Json_ObservableSupport_AddingNewEventHandler_Event target = new Newtonsoft_Json_ObservableSupport_AddingNewEventHandler_Event(func);
            Newtonsoft.Json.ObservableSupport.AddingNewEventHandler       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            Newtonsoft_Json_ObservableSupport_AddingNewEventHandler_Event target = new Newtonsoft_Json_ObservableSupport_AddingNewEventHandler_Event(func, self);
            Newtonsoft.Json.ObservableSupport.AddingNewEventHandler       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }
Пример #4
0
 void Push_Newtonsoft_Json_ObservableSupport_AddingNewEventHandler(IntPtr L, Newtonsoft.Json.ObservableSupport.AddingNewEventHandler o)
 {
     ToLua.Push(L, o);
 }