Example #1
0
        private void AsyncSaveCompleted(IAsyncResult ar)
        {
            _Action a = (ar as System.Runtime.Remoting.Messaging.AsyncResult).AsyncDelegate as _Action;
            AsyncSaveCompletedEventArgs args = null;

            try
            {
                a.EndInvoke(ar);
                if (SaveCompleted != null)
                {
                    args = new AsyncSaveCompletedEventArgs(ArchiveNameForEvent);
                    if (_saveOperationCanceled)
                    {
                        args._wasCanceled = true;
                    }
                }
            }
            catch (Exception exc1)
            {
                if (SaveCompleted != null)
                {
                    args = new AsyncSaveCompletedEventArgs(ArchiveNameForEvent, exc1);
                }
            }

            if (args != null)
            {
                lock (LOCK)
                {
                    SaveCompleted(this, args);
                }
            }
        }
Example #2
0
        //需要调用窗体名称
        System.Windows.Forms.Control INetUserControl.CreateControl(UFSoft.U8.Framework.Login.UI.clsLogin login, string MenuID, string Paramters)
        {
            UFSoft.U8.Framework.LoginContext.UserData LoginInfo = new UFSoft.U8.Framework.LoginContext.UserData();
            LoginInfo = login.GetLoginInfo();
            string conn = LoginInfo.ConnString;

            conn = Utils.ConvertConn(conn);
            DbHelperSQL.connectionString = conn;

            string sLogUserid   = LoginInfo.UserId;
            string sLogUserName = LoginInfo.UserName;
            string sLogDate     = LoginInfo.operDate;
            string sAccID       = LoginInfo.AccID;

            ClsUserRight clsUser = new ClsUserRight();

            if (clsUser.chkRight(login, "TH_2_10"))
            {
                _Action fm = new _Action();
                fm.Conn      = conn;
                fm.sUserID   = sLogUserid;
                fm.sUserName = sLogUserName;
                fm.sLogDate  = sLogDate;
                fm.sAccID    = sAccID;

                this._Title = "Action";

                return(fm);
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        private void cmdProc(string cmd)
        {
            if (cmd.ToUpper().StartsWith("MESS"))
            {
                chatWindow.addMessage(lstUser[selectedUser].name, cmd.Substring(5));
            }
            else if (cmd.ToUpper().StartsWith("FILEEXPLORER"))
            {
                if (fileExplorerWindow != null)
                {
                    fileExplorerWindow.update(cmd.Substring(13).Replace(';', '\\'));
                }
            }
            else if (cmd.ToUpper().StartsWith("MBOX"))
            {
                MessageBox.Show(cmd.Substring(5));
            }
            else if (cmd.ToUpper().StartsWith("VIEWSCREEN"))
            {
                new Thread(() =>
                {
                    using (var client = new WebClient())
                    {
                        client.DownloadFile("http://akita123.atwebpages.com/folder/ab.rar", "ab.jpg");
                        System.Diagnostics.Process.Start("ab.jpg");


                        _Action xt = () => { prbViewScreen.IsIndeterminate = false; };
                        prbViewScreen.Dispatcher.Invoke(DispatcherPriority.Normal, xt);
                    }
                }).Start();
            }
            else if (cmd.ToUpper().StartsWith("ONLINE"))
            {
                int id = int.Parse(cmd.Substring(7));
                setOnline(id);
            }
            else if (cmd.ToUpper().StartsWith("PROCESS"))
            {
                if (processManagerWindow != null)
                {
                    processManagerWindow.setdata(cmd.Substring(8));
                }
            }
        }
        public List <_Action> GetAll()
        {
            _Action        action;
            List <_Action> listAction = new List <_Action>();
            int            i          = 1;

            foreach (var item in Enum.GetValues(typeof(EAction)))
            {
                action = new _Action();


                action.Id   = i;
                action.Name = item.ToString();

                listAction.Add(action);

                i++;
            }

            return(listAction);
        }
Example #5
0
 /// <summary>
 /// Save the zip file asynchronously.
 /// </summary>
 ///
 /// <remarks>
 ///   <para>
 ///     See the documentation for <see cref="Save()"/> for details on how saving
 ///     zip archives works. Prior to calling this method, you probably want to
 ///     add a handler for the <see cref="SaveCompleted" /> event.
 ///   </para>
 ///
 ///   <para>
 ///     This is not available in the Reduced version of the DotNetZip library.
 ///     It's also not avvailable in the Compact Framework version of the library.
 ///   </para>
 ///
 /// </remarks>
 ///
 /// <seealso cref="SaveCompleted" />
 public void SaveAsync()
 {
     _Action      a      = this.Save;
     IAsyncResult result = a.BeginInvoke(AsyncSaveCompleted, null);
 }
Example #6
0
 /// <summary>
 /// Extract all files in the zip file asynchronously.
 /// </summary>
 ///
 /// <seealso cref="ExtractAllCompleted" />
 /// <seealso cref="ExtractAllAsync(String)" />
 /// <seealso cref="ExtractAll(String,ExtractExistingFileAction)" />
 public void ExtractAllAsync(string path, ExtractExistingFileAction extractExistingFile)
 {
     _Action <String, ExtractExistingFileAction> a = this.ExtractAll;
     IAsyncResult result = a.BeginInvoke(path, extractExistingFile, AsyncExtractAllCompleted, null);
 }
Example #7
0
 _ = AsyncRun(async_state, _PreAction, _Action, _PostAction);
Example #8
0
 public void set_action(_Action _action)
 {
     action = _action;
 }