public void RunProject() { messageBoxService.ShowMessage("Project started..."); var calculationResults = from pair in parts.Select((part, index) => new { part, value = index + 1 }) select pair.part.DoCalculations(pair.value); var result = calculationResults.Sum(); messageBoxService.ShowMessage( string.Format("Project finished with magic result {0}", result)); }
private async void DoRestart() { var message = new ConfirmationMessage(Resource.ConfirmationNeeded, Resource.DoYouWantToRestartApplication); var res = await _MessageBox.ShowMessage(message); if (res) { _Application.Restart(); } }
public async void OnClosing(CancelEventArgs cancelEvent) { cancelEvent.Cancel = true; var confirmationMessage = new ConfirmationMessage(Resource.ConfirmationNeeded, Resource.DoYouWantToCloseApplication, Resource.Ok, Resource.Cancel); var close = await _MessageBox.ShowMessage(confirmationMessage); if (close) { _Application.ForceClose(); } }
public int DoCalculations(int myParam) { messageBoxService.ShowMessage("Hardly working 1..."); return(this.decoratee.DoCalculations(myParam)); }