public async Task ShowMessageBox()
 {
     var options = new ShowMessageBoxOptions
     {
         Title = "TEST"
     };
     await _electronService.Dialog.ShowMessageBox(options);
 }
Пример #2
0
 public async Task SubscribeCloseAsync()
 {
     ActionId = await _electronService.MainWindow.SubscribeCloseAsync(async() =>
     {
         var buttons = new List <string> {
             "Ok", "Cancel"
         };
         var options = new ShowMessageBoxOptions
         {
             Title   = "Are you sure",
             Buttons = buttons
         };
         var result = await _electronService.Dialog.ShowMessageBox(options);
         if (buttons[result] == "Ok")
         {
             await _electronService.MainWindow.UnSubscribeEventAsync(ActionId);
             await _electronService.MainWindow.CloseAsync();
         }
     }, true);
 }
Пример #3
0
        public async Task <int> ShowMessageBox(ShowMessageBoxOptions options = null)
        {
            var result = await SendActionAsync(arguments : options);

            return(result.ToObject <int>());
        }