Esempio n. 1
0
        /// <summary>
        /// 从浏览器脚本发起的调用
        /// </summary>
        /// <param name="method"></param>
        /// <param name="args"></param>
        /// <returns></returns>
        public string ScriptCall(string method, string args)
        {
            var eventargs = new ScriptCallArgs { Method = method, Args = args };

             m_mainWindow.OnScriptCall(eventargs);
             return eventargs.Result.ToString();
        }
Esempio n. 2
0
        void app_ScriptCalling(object sender, ScriptCallArgs e)
        {
            if (e.Method == "PrintOrder")
            {
                //try
                //{
                //    var item = m_Repository.GetReceiveSmsContentAndPrisoner(e.Args);
                //    if (item != null)
                //    {
                //        SmsPrint sp = new SmsPrint();
                //        sp.PrintSms(item.Prisoner, item.Item, this);
                //        e.Result = "{success:true }";
                //    }
                //    else
                //    {
                //        e.Result = "{ success:false, error:\"该短信已经不存在!\" }";
                //    }
                //}
                //catch (System.Exception ex)
                //{
                //    e.Result = string.Format("{{success:false, error:'{0}' }}", ex.Message);
                //    AddLog(string.Format("{0}\r\n{1}", ex.Message, ex.StackTrace));
                //}

            }
        }
Esempio n. 3
0
 public object OnScriptCall(ScriptCallArgs e)
 {
     if (ScriptCalling != null)
         ScriptCalling(this, e);
     return e;
 }