/// <summary> /// OK button /// </summary> /// <param name="sender">Sender of event</param> /// <param name="e">Event arguments</param> protected async void OK_Click(object sender, RoutedEventArgs e) { OkCancel.StartProcessing(); Result = await this.Process(sender, e); OkCancel.StopProcessing(this.Result); }
/// <summary> /// Sets model data, binds to controls and handles event that introduce new model data to page /// </summary> /// <param name="sender">Sender of event</param> /// <param name="e">Event arguments</param> protected override void Page_ModelReceived(object sender, NewModelReceivedEventArgs e) { OkCancel.StartProcessing("Loading data..."); var model = e.NewModelData.CastOrFill <CustomerModel>(); BindModel(model); OkCancel.CancelProcessing(); }
/// <summary> /// Cancel Button /// </summary> /// <param name="sender">Sender of event</param> /// <param name="e">Event arguments</param> protected void Cancel_Click(object sender, RoutedEventArgs e) { OkCancel.CancelProcessing(); Cancel(sender, e); }
static void Main(string[] args) { for (int i = 0; i < args.Length; i++) { if (hlpF.check(ref i, args)) { usage(); } else if (dbgF.check(ref i, args)) { ; } else if (vF.check(ref i, args)) { ; } else if (logLvl.check(ref i, args)) { ; } else if (nm.check(ref i, args)) { ; } else if (num.check(ref i, args)) { ; } } string field = "input data"; string variable = "first field1 "; //Param DateTime st = DateTime.Now; int ii = 1; string title = ""; using (LOGGER l = new LOGGER(LOGGER.uitoLvl(logLvl))){ l.cnslLvl = IMPORTANCELEVEL.Debug; l.WriteLine(IMPORTANCELEVEL.Spam, "cycle was started"); { if (vF) { l.cnslLvl = IMPORTANCELEVEL.Stats; } OkCancel f = new OkCancel("exit the application?"); dd: DialogResult rc = f.ShowDialog(); if (rc == DialogResult.OK) { l.WriteLine(IMPORTANCELEVEL.Info, "You've pressed OK"); } else { l.WriteLine(IMPORTANCELEVEL.Info, "You've pressed Cancel. Press yet more"); goto dd; } } DateTime fn = DateTime.Now; Process curProc = Process.GetCurrentProcess(); l.WriteLine(IMPORTANCELEVEL.Stats, "time of work/memory are {0} secs/{1} kBytes" , (fn - st).TotalSeconds, curProc.PeakVirtualMemorySize64 / 1024); } }