当前位置: 首页>>代码示例>>C#>>正文


C# IMessageBoxService.Show方法代码示例

本文整理汇总了C#中IMessageBoxService.Show方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageBoxService.Show方法的具体用法?C# IMessageBoxService.Show怎么用?C# IMessageBoxService.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMessageBoxService的用法示例。


在下文中一共展示了IMessageBoxService.Show方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OpenWebPage

		public static void OpenWebPage(string url, IMessageBoxService messageBoxService) {
			try {
				Process.Start(url);
			}
			catch {
				messageBoxService.Show(dnSpy_Resources.CouldNotStartBrowser);
			}
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:AboutCommands.cs

示例2: MainWindowViewModel

        public MainWindowViewModel(IBookingService bookingService, IMessageBoxService mboxService, IConfigService configService)
        {
            _context = SynchronizationContext.Current;//We will always execute this on UI dispatcher.
            _bookingService = bookingService;
            _mboxService = mboxService;
            _configService = configService;

            AddNewCommand = new ActionCommand(AddNewClicked);

            _bookingService.GetBookingsAsync(DateTime.Now, HandleBookings,
                e => _mboxService.Show("Error Getting Bookings. " + e, "Error", MessageBoxButton.OK, MessageBoxImage.Error));
        }
开发者ID:stefanidi,项目名称:NineITBookingAppByRomanStefanidi,代码行数:12,代码来源:MainWindowViewModel.cs

示例3: MainViewModel

        public MainViewModel(IMessageBoxService messageBoxService)
        {
            _messageBoxService = messageBoxService;

            AddItemCommand = new RelayCommand(() =>
            {
                Items.Add(DateTime.Now.ToString());

                EnableSelectionCommand.RaiseCanExecuteChanged();
            });

            EnableSelectionCommand = new RelayCommand(() =>
            {
                IsSelectionEnabled = true;
            }, () => Items.Count > 0);

            DeleteItemsCommand = new RelayCommand<System.Collections.IList>(items =>
            {
                var itemsToRemove = items
                    .Cast<string>()
                    .ToArray();

                foreach (var itemToRemove in itemsToRemove)
                {
                    Items.Remove(itemToRemove);
                }

                EnableSelectionCommand.RaiseCanExecuteChanged();

                IsSelectionEnabled = false;
            });

            BackKeyPressCommand = new RelayCommand<CancelEventArgs>(e =>
            {
                if (IsSelectionEnabled)
                {
                    IsSelectionEnabled = false;

                    e.Cancel = true;
                }
            });

            AboutCommand = new RelayCommand(() =>
            {
                _messageBoxService.Show("Cimbalino Windows Phone Toolkit Bindable Application Bar Sample", "About");
            });

            Items = new ObservableCollection<string>();
        }
开发者ID:Cimbalino,项目名称:Cimbalino-Phone-Toolkit,代码行数:49,代码来源:MainViewModel.cs

示例4: CheckAndPromptForSagaUpdate

        public static void CheckAndPromptForSagaUpdate(IComponent handlerComponent, IMessageBoxService messageBoxService, IDialogWindowFactory windowFactory)
        {
            if (handlerComponent.ProcessesMultipleMessages)
            {
                var sagaRecommendationMessage =
                    handlerComponent.IsSaga
                        ? String.Format(Resources.Saga_UpdateQuery)
                        : String.Format(CultureInfo.CurrentCulture, Resources.Saga_ConvertQuery, handlerComponent.CodeIdentifier);

                var result = messageBoxService.Show(sagaRecommendationMessage, Resources.Saga_QueryTitle, MessageBoxButton.YesNo);
                if (result == MessageBoxResult.Yes)
                {
                    new ShowComponentSagaStarterPicker { WindowFactory = windowFactory, CurrentElement = handlerComponent }.Execute();
                }
            }
        }
开发者ID:slamj1,项目名称:ServiceMatrix,代码行数:16,代码来源:SagaHelper.cs

示例5: MainViewModel

 public MainViewModel(IMessageBoxService messageBoxService)
 {
     if (messageBoxService == null) throw new ArgumentNullException(nameof(messageBoxService));
     _messageBoxService = messageBoxService;
     _items = new OrderedListViewModel<ItemViewModel>(
         //() => new ItemViewModel(),
         () => null,
         addedAction: item => Console.WriteLine($"Item '{item?.Text}' added"),
         deleted: item => _messageBoxService.Show($"Delete '{item.Text}'", button:MessageBoxButton.YesNo) == MessageBoxResult.Yes)
     {
         new ItemViewModel() {Value = 1, Text = "One"},
         new ItemViewModel() {Value = 2, Text = "Two"},
         new ItemViewModel() {Value = 3, Text = "Three"},
         new ItemViewModel() {Value = 4, Text = "Four"},
         new ItemViewModel() {Value = 5, Text = "Five"}
     };
 }
开发者ID:CaptiveAire,项目名称:Cas.Common.WPF,代码行数:17,代码来源:MainViewModel.cs

示例6: MainViewModel

        public MainViewModel(ILocationService locationService, IMessageBoxService messageBoxService)
        {
            _locationService = locationService;
            _messageBoxService = messageBoxService;

            _locationService.PositionChanged += LocationService_PositionChanged;
            _locationService.StatusChanged += LocationService_StatusChanged;

            GetCurrentLocationCommand = new RelayCommand(() =>
            {
                _locationService.GetPosition(LocationServiceAccuracy.High, TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(10), (location, ex) =>
                {
                    if (ex != null)
                    {
                        _messageBoxService.Show(ex.ToString(), "Error");
                    }
                    else
                    {
                        CurrentLocation = location.ToString();
                    }
                });
            });

            StartMonitoringLocationCommand = new RelayCommand(() =>
            {
                _locationService.Start(LocationServiceAccuracy.High);

                Status = "Starting";
            });

            StopMonitoringLocationCommand = new RelayCommand(() =>
            {
                _locationService.Stop();

                Status = "Stopped";
            });

            CurrentLocation = "(Unknown)";
            Status = "Stopped";
        }
开发者ID:Cimbalino,项目名称:Cimbalino-Phone-Toolkit,代码行数:40,代码来源:MainViewModel.cs

示例7: MainViewModel

        public MainViewModel(IMainModel mainModel, INavigationService navigationService, IMessageBoxService messageBoxService, IApplicationSettingsService applicationSettingsService, IShellTileService shellTileService)
        {
            _mainModel = mainModel;
            _navigationService = navigationService;
            _messageBoxService = messageBoxService;
            _applicationSettingsService = applicationSettingsService;
            _shellTileService = shellTileService;

            NewAccountCommand = new RelayCommand(() =>
            {
                _navigationService.NavigateTo("/View/AuthorizationPage.xaml");
            });

            RemoveAccountCommand = new RelayCommand<AccountViewModel>(account =>
            {
                _mainModel.AvailableAccounts.Remove(account.Model);
                _mainModel.Save();

                RefreshAccountsList();
            });

            OpenAccountCommand = new RelayCommand<AccountViewModel>(account =>
            {
                _mainModel.CurrentAccount = account.Model;
                _mainModel.ExecuteInitialLoad = true;

                _navigationService.NavigateTo("/View/ExplorerPage.xaml");
            });

            ShowAboutCommand = new RelayCommand(() =>
            {
                _navigationService.NavigateTo("/View/AboutPage.xaml");
            });

            PageLoadedCommand = new RelayCommand(() =>
            {
                _mainModel.CurrentAccount = null;

                if (!_applicationSettingsService.Get<bool>("AcceptedDisclaimer", false))
                {
                    _applicationSettingsService.Set("AcceptedDisclaimer", true);
                    _applicationSettingsService.Save();

                    _messageBoxService.Show("You are advised to read the GDrive disclaimer before you continue.\n\nWould you like to read it now?\n\nYou can always find it later in the About page.", "Welcome to GDrive", new[] { "now", "later" }, buttonIndex =>
                    {
                        if (buttonIndex == 0)
                        {
                            _navigationService.NavigateTo("/View/AboutPage.xaml?disclaimer=true");
                        }
                    });
                }
            });

            MessengerInstance.Register<AvailableAccountsChangedMessage>(this, message =>
            {
                RefreshAccountsList();
            });

#if !WP8
            DispatcherHelper.RunAsync(UpdateTiles);
#endif
        }
开发者ID:Hitchhikrr,项目名称:GDrive,代码行数:62,代码来源:MainViewModel.cs

示例8: ExplorerViewModel

        public ExplorerViewModel(IMainModel mainModel, IGoogleDriveService googleDriveService, INavigationService navigationService, IMessageBoxService messageBoxService, ISystemTrayService systemTrayService, IPhotoChooserService photoChooserService)
        {
            _mainModel = mainModel;
            _googleDriveService = googleDriveService;
            _navigationService = navigationService;
            _messageBoxService = messageBoxService;
            _systemTrayService = systemTrayService;
            _photoChooserService = photoChooserService;

            Files = new ObservableCollection<GoogleFileViewModel>();
            PictureFiles = new ObservableCollection<GoogleFileViewModel>();

            OpenFileCommand = new RelayCommand<GoogleFileViewModel>(file =>
            {
                if (IsSelectionEnabled)
                {
                    return;
                }

                OpenFile(file);
            });

            ChangeStaredStatusCommand = new RelayCommand<GoogleFileViewModel>(file =>
            {
                if (IsSelectionEnabled)
                {
                    return;
                }

                ChangeStaredStatus(file);
            });

            AddFileCommand = new RelayCommand(UploadFile);

            EnableSelectionCommand = new RelayCommand(() =>
            {
                if (IsBusy)
                {
                    return;
                }

                IsSelectionEnabled = true;
            });

            RefreshFilesCommand = new RelayCommand(RefreshFiles);

            DeleteFilesCommand = new RelayCommand<IList>(files =>
            {
                _messageBoxService.Show("You are about to delete the selected files. Do you wish to proceed?", "Delete files?", new[] { "delete", "cancel" }, button =>
                {
                    if (button != 0)
                        return;

                    var filesArray = files
                        .Cast<GoogleFileViewModel>()
                        .ToArray();

                    IsSelectionEnabled = false;

                    DeleteFiles(filesArray);
                });
            });

            CreateNewFolderCommand = new RelayCommand(CreateNewFolder);

            RenameFileCommand = new RelayCommand<GoogleFileViewModel>(RenameFile);

            DeleteFileCommand = new RelayCommand<GoogleFileViewModel>(file =>
            {
                _messageBoxService.Show(string.Format("You are about to delete '{0}'. Do you wish to proceed?", file.Title), "Delete file?", new[] { "delete", "cancel" }, button =>
                {
                    if (button != 0)
                        return;

                    DeleteFile(file);
                });
            });

            ShowAboutCommand = new RelayCommand(() =>
            {
                _navigationService.NavigateTo("/View/AboutPage.xaml");
            });

            PageLoadedCommand = new RelayCommand(ExecuteInitialLoad);

            BackKeyPressCommand = new RelayCommand<CancelEventArgs>(e =>
            {
                GoogleDriveFile item;

                if (PivotSelectedIndex == 1)
                {
                    PivotSelectedIndex = 0;

                    e.Cancel = true;
                }
                else if (IsSelectionEnabled)
                {
                    IsSelectionEnabled = false;

                    e.Cancel = true;
//.........这里部分代码省略.........
开发者ID:Hitchhikrr,项目名称:GDrive,代码行数:101,代码来源:ExplorerViewModel.cs


注:本文中的IMessageBoxService.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。