コード例 #1
0
 public static async Task MainAsync(string[] commandLineArgs, RunCallback callback = default)
 {
     if (!(callback is null))
     {
         await callback(state : null);
     }
 }
コード例 #2
0
 public RenameController(RunModel runModel, RunCallback runCallback)
 {
     this._runModel    = runModel;
     this._runCallback = runCallback;
     _fileHelper       = new FileHelper();
     loadListKeywordRemove();
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: TheLegendOfMataNui/VS-OSI
 public Command(string text, RunCallback run, string usage, string description)
 {
     this.Text        = text;
     this.Run         = run;
     this.Usage       = usage;
     this.Description = description;
 }
コード例 #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);
        }
コード例 #5
0
ファイル: FormLauncher.cs プロジェクト: InfiniteRasa/Launcher
        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();
            }
        }
コード例 #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;
		}