示例#1
0
        /// <summary>
        /// mvvm action
        /// </summary>
        /// <param name="json"></param>
        protected virtual void action(string json = "")
        {
            try
            {
                //GC.Collect();
                if (_Dispose)
                {
                    return;
                }

                if (this.InvokeRequired)
                {
                    doActionDelegate d = new doActionDelegate(doAction);
                    this.BeginInvoke(d, json);
                }
                else
                {
                    if (_Busy)
                    {
                        return;
                    }
                    try
                    {
                        _Busy = true;
                        doAction(json);
                    }
                    finally
                    {
                        _Busy = false;
                    }
                }
            }
            catch { }
        }
示例#2
0
 /// <summary>
 /// mvvm action
 /// </summary>
 /// <param name="json"></param>
 protected virtual void action(string json = "")
 {
     if (this.InvokeRequired)
     {
         doActionDelegate d = new doActionDelegate(doAction);
         this.BeginInvoke(d, json);
     }
     else
     {
         doAction(json);
     }
 }