Ejemplo n.º 1
0
 public static async Task MainAsync(string[] commandLineArgs, RunCallback callback = default)
 {
     if (!(callback is null))
     {
         await callback(state : null);
     }
 }
 public RenameController(RunModel runModel, RunCallback runCallback)
 {
     this._runModel    = runModel;
     this._runCallback = runCallback;
     _fileHelper       = new FileHelper();
     loadListKeywordRemove();
 }
Ejemplo n.º 3
0
 public Command(string text, RunCallback run, string usage, string description)
 {
     this.Text        = text;
     this.Run         = run;
     this.Usage       = usage;
     this.Description = description;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Internally starts the asynchronous delegate that will drive the Form's message pump on a background thread
        /// </summary>
        /// <param name="args">An array of object arguments to be passed to the Run method</param>
        /// <returns></returns>
        protected bool Start(object[] args)
        {
            try
            {
                _windowOk = false;
                _started  = new ManualResetEvent(false);

                RunCallback callback = new RunCallback(this.Run);

                IAsyncResult ar = callback.BeginInvoke(args, new AsyncCallback(OnRunEnd), this);
                if (ar != null)
                {
                    _started.WaitOne();
                    return(true);
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
            }
            return(false);
        }
Ejemplo n.º 5
0
        public void RunGame(String host, Int16 port)
        {
            if (this.pictureBoxTotalBar.InvokeRequired)
            {
                RunCallback d = new RunCallback(RunGame);
                this.Invoke(d, new object[] { host, port });
            }
            else
            {
                string  AuthServer = host + ":" + port.ToString();
                Process TabulaRasa = new Process();
                TabulaRasa.StartInfo.FileName  = TabulaRasaExe;
                TabulaRasa.StartInfo.Arguments = TabulaRasaParams + AuthServer;

                try {
                    TabulaRasa.Start();
                }
                catch (Exception)
                {
                    MessageBox.Show("Error starting " + TabulaRasaExe, "Wait");
                }
                this.Close();
            }
        }
Ejemplo n.º 6
0
		/// <summary>
		/// Internally starts the asynchronous delegate that will drive the Form's message pump on a background thread
		/// </summary>
		/// <param name="args">An array of object arguments to be passed to the Run method</param>
		/// <returns></returns>
		protected bool Start(object[] args)
		{
			try
			{
				_windowOk = false;
				_started = new ManualResetEvent(false);

				RunCallback callback = new RunCallback(this.Run);

				IAsyncResult ar = callback.BeginInvoke(args, new AsyncCallback(OnRunEnd), this);
				if (ar != null)
				{
					_started.WaitOne();
					return true;
				}
			}
			catch(Exception ex)
			{
				Trace.WriteLine(ex);
			}
			return false;
		}