Inheritance: System.EventArgs
Beispiel #1
0
        internal virtual void OnSubmit(SubmitEventArgs e)
        {
            SubmitEventHandler handler = (SubmitEventHandler)Events[EventSubmit];

            if (handler != null)
            {
                handler(this, e);
            }
        }
 private void _treePanelRight_Submit(object sender, SubmitEventArgs e)
 {
     List<SubmittedNode> children = e.RootNode.Children;
     foreach (SubmittedNode node in children)
     {
         Ext.Net.Node node2 = new Ext.Net.Node
         {
             NodeID = node.NodeID,
             Text = node.Text,
             Leaf = true
         };
         this._treePanelLeft.GetRootNode().InsertChild(0, node2);
         this._treePanelRight.GetNodeById(node.NodeID).Remove();
         this._selectedIds.Remove(ConvertHelper.ToInt32(node.NodeID));
     }
 }
Beispiel #3
0
        public void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams)
        {
            bool   success = true;
            string msg     = null;

            Response response = new Response();

            try
            {
                if (eventArgument.IsEmpty())
                {
                    throw new ArgumentNullException("eventArgument");
                }

                XmlNode xmlData = this.SubmitConfig;
                string  data    = null;

                if (xmlData != null)
                {
                    XmlNode serviceNode = xmlData.SelectSingleNode("config/serviceParams");

                    if (serviceNode != null)
                    {
                        data = serviceNode.InnerText;
                    }
                }

                switch (eventArgument)
                {
                case "nodeload":
                    NodeLoadEventArgs e      = new NodeLoadEventArgs(extraParams);
                    PageTreeLoader    loader = (PageTreeLoader)this.Loader.Primary;
                    loader.OnNodeLoad(e);
                    TreeNodeCollection nodes = e.Nodes;
                    success       = e.Success;
                    msg           = e.ErrorMessage;
                    response.Data = nodes != null?nodes.ToJson() : null;

                    break;

                case "submit":
                    SubmitEventArgs se = new SubmitEventArgs(extraParams, JSON.Deserialize <SubmittedNode>(data, new CamelCasePropertyNamesContractResolver()));
                    this.OnSubmit(se);
                    break;

                case "raRename":
                    RemoteRenameEventArgs rr = new RemoteRenameEventArgs(data, extraParams);
                    this.OnRemoteRename(rr);
                    success = rr.Accept;
                    msg     = rr.RefusalMessage;
                    break;

                case "raRemove":
                    RemoteActionEventArgs rrm = new RemoteActionEventArgs(data, extraParams);
                    this.OnRemoteRemove(rrm);
                    success = rrm.Accept;
                    msg     = rrm.RefusalMessage;
                    break;

                case "raInsert":
                case "raAppend":
                    RemoteAppendEventArgs ra = new RemoteAppendEventArgs(eventArgument == "raInsert", data, extraParams);
                    this.OnRemoteAppend(ra);
                    success = ra.Accept;
                    msg     = ra.RefusalMessage;
                    break;

                case "raMove":
                    RemoteMoveEventArgs rm = new RemoteMoveEventArgs(data, extraParams);
                    this.OnRemoteMove(rm);
                    success = rm.Accept;
                    msg     = rm.RefusalMessage;
                    break;
                }
            }
            catch (Exception ex)
            {
                success = false;
                msg     = this.IsDebugging ? ex.ToString() : ex.Message;

                if (this.ResourceManager.RethrowAjaxExceptions)
                {
                    throw;
                }
            }

            response.Success = success;
            response.Message = msg;

            ResourceManager.ServiceResponse = response;
        }
Beispiel #4
0
        public void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams)
        {
            bool   success = true;
            string msg     = null;

            Response response = new Response();

            try
            {
                if (eventArgument.IsEmpty())
                {
                    throw new ArgumentNullException("eventArgument");
                }

                string data = null;

                if (this.DirectConfig != null)
                {
                    JToken serviceToken = this.DirectConfig.SelectToken("config.serviceParams", false);

                    if (serviceToken != null)
                    {
                        data = JSON.ToString(serviceToken);
                    }
                }

                switch (eventArgument)
                {
                case "submit":
                    SubmitEventArgs se = new SubmitEventArgs(extraParams, JSON.Deserialize <SubmittedNode>(data, new CamelCasePropertyNamesContractResolver()));
                    this.OnSubmit(se);
                    break;

                case "raEdit":
                    RemoteEditEventArgs rr = new RemoteEditEventArgs(data, extraParams);
                    this.OnRemoteEdit(rr);
                    success = rr.Accept;
                    msg     = rr.RefusalMessage;
                    break;

                case "raRemove":
                    RemoteRemoveEventArgs rrm = new RemoteRemoveEventArgs(data, extraParams);
                    this.OnRemoteRemove(rrm);
                    success = rrm.Accept;
                    msg     = rrm.RefusalMessage;
                    break;

                case "raInsert":
                case "raAppend":
                    RemoteAppendEventArgs ra = new RemoteAppendEventArgs(eventArgument == "raInsert", data, extraParams);
                    this.OnRemoteAppend(ra);
                    success = ra.Accept;
                    msg     = ra.RefusalMessage;
                    break;

                case "raMove":
                    RemoteMoveEventArgs rm = new RemoteMoveEventArgs(data, extraParams);
                    this.OnRemoteMove(rm);
                    success = rm.Accept;
                    msg     = rm.RefusalMessage;
                    break;
                }
            }
            catch (Exception ex)
            {
                success = false;
                msg     = this.IsDebugging ? ex.ToString() : ex.Message;

                if (this.ResourceManager.RethrowAjaxExceptions)
                {
                    throw;
                }
            }

            response.Success = success;
            response.Message = msg;

            ResourceManager.ServiceResponse = response;
        }
Beispiel #5
0
        public void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams)
        {
            bool success = true;
            string msg = null;

            Response response = new Response();

            try
            {
                if (eventArgument.IsEmpty())
                {
                    throw new ArgumentNullException("eventArgument");
                }

                string data = null;

                if (this.DirectConfig != null)
                {
                    JToken serviceToken = this.DirectConfig.SelectToken("config.serviceParams", false);

                    if (serviceToken != null)
                    {
                        data = JSON.ToString(serviceToken);
                    }
                }

                switch(eventArgument)
                {
                    case "submit":
                        SubmitEventArgs se = new SubmitEventArgs(extraParams, JSON.Deserialize<SubmittedNode>(data, new CamelCasePropertyNamesContractResolver()));
                        this.OnSubmit(se);
                        break;
                    case "raEdit":
                        RemoteEditEventArgs rr = new RemoteEditEventArgs(data,extraParams);
                        this.OnRemoteEdit(rr);
                        success = rr.Accept;
                        msg = rr.RefusalMessage;
                        break;
                    case "raRemove":
                        RemoteRemoveEventArgs rrm = new RemoteRemoveEventArgs(data, extraParams);
                        this.OnRemoteRemove(rrm);
                        success = rrm.Accept;
                        msg = rrm.RefusalMessage;
                        break;
                    case "raInsert":
                    case "raAppend":
                        RemoteAppendEventArgs ra = new RemoteAppendEventArgs(eventArgument == "raInsert", data, extraParams);
                        this.OnRemoteAppend(ra);
                        success = ra.Accept;
                        msg = ra.RefusalMessage;
                        break;
                    case "raMove":
                        RemoteMoveEventArgs rm = new RemoteMoveEventArgs(data, extraParams);
                        this.OnRemoteMove(rm);
                        success = rm.Accept;
                        msg = rm.RefusalMessage;
                        break;
                }
            }
            catch (Exception ex)
            {
                success = false;
                msg = this.IsDebugging ? ex.ToString() : ex.Message;

                if (this.ResourceManager.RethrowAjaxExceptions)
                {
                    throw;
                }
            }

            response.Success = success;
            response.Message = msg;

            ResourceManager.ServiceResponse = response;
        }
Beispiel #6
0
        internal virtual void OnSubmit(SubmitEventArgs e)
        {
            SubmitEventHandler handler = (SubmitEventHandler)Events[EventSubmit];

            if (handler != null)
            {
                handler(this, e);
            }
        }
Beispiel #7
0
        public void RaiseAjaxPostBackEvent(string eventArgument, ParameterCollection extraParams)
        {
            bool success = true;
            string msg = null;

            Response response = new Response();

            try
            {
                if (eventArgument.IsEmpty())
                {
                    throw new ArgumentNullException("eventArgument");
                }

                XmlNode xmlData = this.SubmitConfig;
                string data = null;

                if (xmlData != null)
                {
                    XmlNode serviceNode = xmlData.SelectSingleNode("config/serviceParams");

                    if (serviceNode != null)
                    {
                        data = serviceNode.InnerText;
                    }
                }

                switch(eventArgument)
                {
                    case "nodeload":
                        NodeLoadEventArgs e = new NodeLoadEventArgs(extraParams);
                        PageTreeLoader loader = (PageTreeLoader) this.Loader.Primary;
                        loader.OnNodeLoad(e);
                        TreeNodeCollection nodes = e.Nodes;
                        success = e.Success;
                        msg = e.ErrorMessage;
                        response.Data = nodes != null ? nodes.ToJson() : null;
                        break;
                    case "submit":
                        SubmitEventArgs se = new SubmitEventArgs(extraParams, JSON.Deserialize<SubmittedNode>(data, new CamelCasePropertyNamesContractResolver()));
                        this.OnSubmit(se);
                        break;
                    case "raRename":
                        RemoteRenameEventArgs rr = new RemoteRenameEventArgs(data,extraParams);
                        this.OnRemoteRename(rr);
                        success = rr.Accept;
                        msg = rr.RefusalMessage;
                        break;
                    case "raRemove":
                        RemoteActionEventArgs rrm = new RemoteActionEventArgs(data, extraParams);
                        this.OnRemoteRemove(rrm);
                        success = rrm.Accept;
                        msg = rrm.RefusalMessage;
                        break;
                    case "raInsert":
                    case "raAppend":
                        RemoteAppendEventArgs ra = new RemoteAppendEventArgs(eventArgument == "raInsert", data, extraParams);
                        this.OnRemoteAppend(ra);
                        success = ra.Accept;
                        msg = ra.RefusalMessage;
                        break;
                    case "raMove":
                        RemoteMoveEventArgs rm = new RemoteMoveEventArgs(data, extraParams);
                        this.OnRemoteMove(rm);
                        success = rm.Accept;
                        msg = rm.RefusalMessage;
                        break;
                }
            }
            catch (Exception ex)
            {
                success = false;
                msg = this.IsDebugging ? ex.ToString() : ex.Message;

                if (this.ResourceManager.RethrowAjaxExceptions)
                {
                    throw;
                }
            }

            response.Success = success;
            response.Message = msg;

            ResourceManager.ServiceResponse = response;
        }