public ProgressService( WindowOwner owner, Lazy <MainWindowViewModel> mainWindowViewModel) { this.windowsOwner = owner; this.mainWindowViewModel = mainWindowViewModel; }
public BranchService( IGitFetchService gitFetchService, IGitPushService gitPushService, IGitBranchService gitBranchService, IGitMergeService gitMergeService, IGitCommitService gitCommitService, IGitCheckoutService gitCheckoutService, ICommitsService commitsService, IProgressService progressService, IMessage message, WindowOwner owner, IRepositoryCommands repositoryCommands, Lazy <IRepositoryService> repositoryService, IStatusService statusService) { this.gitFetchService = gitFetchService; this.gitPushService = gitPushService; this.gitBranchService = gitBranchService; this.gitMergeService = gitMergeService; this.gitCommitService = gitCommitService; this.gitCheckoutService = gitCheckoutService; this.commitsService = commitsService; this.progress = progressService; this.message = message; this.owner = owner; this.repositoryCommands = repositoryCommands; this.repositoryService = repositoryService; this.statusService = statusService; }
public ProgressService( WindowOwner owner, Lazy <IBusyIndicatorProvider> mainWindowViewModel) { this.windowOwner = owner; this.mainWindowViewModel = mainWindowViewModel; }
private void returnToMain_Click(object sender, RoutedEventArgs e) { var dialogResult = System.Windows.MessageBox.Show("Результати поточного ранжування будуть втрачені.\nВиконати ранжування ще раз, використовуючи існуючі альтернативи?", "Увага", MessageBoxButton.YesNoCancel, MessageBoxImage.Question); switch (dialogResult) { case MessageBoxResult.Yes: isClose = false; WorkWindow.isClose = false; WorkWindow.Close(); this.Close(); var alternatives = SoulData.Alternatives; SoulData.Initialize(); SoulData.Alternatives = alternatives; var window = new QuestionWindow(WindowOwner, _container); window.Show(); break; case MessageBoxResult.No: isClose = false; WorkWindow.isClose = false; WorkWindow.Close(); WindowOwner.isClose = false; WindowOwner.Close(); var mainWindow = new MainWindow(); mainWindow.Show(); this.Close(); break; default: break; } }
internal CommitDialog( WindowOwner owner, Func < CommitDialog, BranchName, IEnumerable <CommitFile>, string, bool, CommitDialogViewModel> CommitDialogViewModelProvider, BranchName branchName, IEnumerable <CommitFile> files, string commitMessage, bool isMerging) { Owner = owner; InitializeComponent(); viewModel = CommitDialogViewModelProvider( this, branchName, files, commitMessage, isMerging); DataContext = viewModel; if (string.IsNullOrWhiteSpace(viewModel.Subject)) { SubjectText.Focus(); } else { DescriptionText.Focus(); } }
private void Browse_OnClick(object sender, RoutedEventArgs e) { string path = Folder.Text; if (path.EndsWith("\\")) { path = path.Substring(0, path.Length - 1); } else { path = Path.GetDirectoryName(path) + "\\"; } FolderBrowserDialog dialog = new FolderBrowserDialog() { Description = "Select a folder to clone into:", ShowNewFolderButton = true, //RootFolder = Environment.SpecialFolder.MyComputer }; dialog.SelectedPath = path; IWin32Window owner = WindowOwner.AsWin32Window(Owner); if (dialog.ShowDialog(owner) != System.Windows.Forms.DialogResult.OK) { Log.Debug("User canceled browse"); return; } Folder.Text = dialog.SelectedPath; }
internal CodeDialog( Lazy <IModelNotifications> modelNotifications, ISolutionService solutionService, IProgressService progressService, ModelMetadata modelMetadata, WindowOwner owner, NodeName nodeName, Source source, Func <Task <M <Source> > > updateSource) { this.modelNotifications = modelNotifications; this.source = source; this.updateSource = updateSource; Owner = owner; InitializeComponent(); Loaded += Window_Loaded; codeViewModel = new CodeViewModel(solutionService, progressService, modelMetadata.ModelPaths, nodeName.DisplayLongName, this); DataContext = codeViewModel; SetSyntaxHighlighting(); SetCodeText(); modelNotifications.Value.ModelUpdated += OnModelUpdated; }
/// <summary> /// Displays a <see cref="MessageBox"/> an returns the <see cref="MessageBoxResult"/> depending on the user's choice. /// </summary> /// <param name="owner">The intended owner window of the message box.</param> /// <param name="message">A <see cref="string"/> that specifies the text to display.</param> /// <param name="caption">A <see cref="string"/> that specifies the title bar caption to display.</param> /// <param name="buttons">A n enumeration of <see cref="DialogButtonInfo"/> that specifies buttons to display</param> /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the icon to display.</param> /// <returns>A <see cref="MessageBoxResult"/> value that specifies which message box button is clicked by the user.</returns> public static async Task <MessageBoxResult> Show(WindowOwner owner, string message, string caption, [NotNull] IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image) { var buttonList = buttons.ToList(); var messageBox = new MessageBox { Title = caption, Content = message, ButtonsSource = buttonList, }; SetImage(messageBox, image); SetKeyBindings(messageBox, buttonList); return((MessageBoxResult)await messageBox.ShowInternal(owner)); }
public static Task ShowModal(Window window, WindowOwner windowOwner = WindowOwner.LastModal, WindowInitialPosition position = WindowInitialPosition.CenterOwner) { if (window == null) { throw new ArgumentNullException(nameof(window)); } CheckDispatcher(); var windowInfo = new WindowInfo(window); if (ModalWindowsList.Contains(windowInfo)) { throw new InvalidOperationException("This window has already been shown as modal."); } var owner = FindNextOwner(windowOwner); window.Owner = owner?.Window; SetStartupLocation(window, owner, position); // Set the owner now so the window can be recognized as modal when shown if (owner != null) { owner.IsDisabled = true; } AllWindowsList.Add(windowInfo); switch (windowOwner) { case WindowOwner.LastModal: ModalWindowsList.Add(windowInfo); break; case WindowOwner.MainWindow: ModalWindowsList.Insert(0, windowInfo); break; default: throw new ArgumentOutOfRangeException(nameof(windowOwner), windowOwner, null); } // Update the hwnd on load in case the window is closed before being shown // We will receive EVENT_OBJECT_HIDE but not EVENT_OBJECT_SHOW in this case. window.Loaded += (sender, e) => windowInfo.ForceUpdateHwnd(); Logger.Info($"Modal window showing. ({window})"); window.Show(); return(windowInfo.WindowClosed.Task); }
public TagService( IStatusService statusService, IProgressService progressService, IGitPushService gitPushService, IGitTagService gitTagService, IMessage message, WindowOwner owner) { this.statusService = statusService; this.progress = progressService; this.gitPushService = gitPushService; this.gitTagService = gitTagService; this.message = message; this.owner = owner; }
private static WindowInfo FindNextOwner(WindowOwner owner) { switch (owner) { case WindowOwner.LastModal: // Skip non-visible window, they might be in the process of being closed. return(ModalWindows.FirstOrDefault(x => x.Hwnd == IntPtr.Zero || x.IsVisible) ?? MainWindow); case WindowOwner.MainWindow: return(MainWindow); default: throw new ArgumentOutOfRangeException(nameof(owner), owner, null); } }
internal DependencyExplorerWindow( IDependencyWindowService dependencyWindowService, IModelNotifications modelNotifications, WindowOwner owner, Node node, Line line) { this.modelNotifications = modelNotifications; Owner = owner; InitializeComponent(); Loaded += Window_Loaded; viewModel = new DependencyExplorerWindowViewModel(dependencyWindowService, node, line); DataContext = viewModel; modelNotifications.ModelUpdated += OnModelChanged; }
public OpenRepoService( IRecentReposService recentReposService, IGitInfoService gitInfoService, IGitRepoService gitRepoService, IStartInstanceService startInstanceService, IMessage message, IProgressService progressService, WindowOwner owner) { this.owner = owner; this.recentReposService = recentReposService; this.gitInfoService = gitInfoService; this.gitRepoService = gitRepoService; this.startInstanceService = startInstanceService; this.message = message; this.progressService = progressService; }
public static async Task<CheckedMessageBoxResult> Show(WindowOwner owner, string message, string caption, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image, string checkedMessage, bool? isChecked) { var buttonList = buttons.ToList(); var messageBox = new CheckedMessageBox { Title = caption, Content = message, ButtonsSource = buttonList, CheckedMessage = checkedMessage, IsChecked = isChecked, }; SetImage(messageBox, image); SetKeyBindings(messageBox, buttonList); var result = (MessageBoxResult)await messageBox.ShowInternal(owner); return new CheckedMessageBoxResult(result, messageBox.IsChecked); }
public static async Task <CheckedMessageBoxResult> Show(WindowOwner owner, string message, string caption, [NotNull] IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image, string checkedMessage, bool?isChecked) { var buttonList = buttons.ToList(); var messageBox = new CheckedMessageBox { Title = caption, Content = message, ButtonsSource = buttonList, CheckedMessage = checkedMessage, IsChecked = isChecked, }; SetImage(messageBox, image); SetKeyBindings(messageBox, buttonList); var result = (MessageBoxResult)await messageBox.ShowInternal(owner); return(new CheckedMessageBoxResult(result, messageBox.IsChecked)); }
public static void ShowNonModal(Window window, WindowOwner windowOwner = WindowOwner.MainWindow, WindowInitialPosition position = WindowInitialPosition.CenterOwner) { if (window == null) { throw new ArgumentNullException(nameof(window)); } CheckDispatcher(); var owner = FindNextOwner(windowOwner); window.Owner = owner?.Window; SetStartupLocation(window, owner, position); var windowInfo = new WindowInfo(window); AllWindowsList.Add(windowInfo); Logger.Info($"Non-modal window showing. ({window})"); window.Show(); }
private void ExitClick(object sender, System.ComponentModel.CancelEventArgs e) { if (isClose) { var dialogResult = System.Windows.MessageBox.Show("Ви дійсно хочете вийти з програми?", "Вихід з програми", MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); switch (dialogResult) { case MessageBoxResult.Yes: WindowOwner.Show(); //WindowOwner.Close(); WorkWindow.isClose = false; WorkWindow.Close(); break; case MessageBoxResult.No: e.Cancel = true; break; default: break; } } }
/// <summary> /// Displays a <see cref="MessageBox"/> an returns the <see cref="MessageBoxResult"/> depending on the user's choice. /// </summary> /// <param name="owner">The intended owner window of the message box.</param> /// <param name="message">A <see cref="string"/> that specifies the text to display.</param> /// <param name="caption">A <see cref="string"/> that specifies the title bar caption to display.</param> /// <param name="button">A <see cref="MessageBoxButton"/> value that specifies which button or buttons to display</param> /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the icon to display.</param> /// <returns>A <see cref="MessageBoxResult"/> value that specifies which message box button is clicked by the user.</returns> public static Task<MessageBoxResult> Show(WindowOwner owner, string message, string caption, MessageBoxButton button, MessageBoxImage image) { return Show(owner, message, caption, GetButtons(button), image); }
public static CheckedMessageBoxResult BlockingCheckedMessageBox(IDispatcherService dispatcher, string message, string caption, bool?isChecked, string checkboxMessage, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(PushFrame(dispatcher, () => CheckedMessageBox(dispatcher, message, caption, isChecked, checkboxMessage, button, image, owner))); }
public static MessageBoxResult BlockingMessageBox(IDispatcherService dispatcher, string message, string caption, IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(PushFrame(dispatcher, () => MessageBox(dispatcher, message, caption, buttons, image, owner))); }
public static Task <CheckedMessageBoxResult> CheckedMessageBox(IDispatcherService dispatcher, string message, string caption, bool?isChecked, string checkboxMessage, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(dispatcher.InvokeTask(() => Windows.CheckedMessageBox.Show(owner, message, caption, button, image, checkboxMessage, isChecked))); }
internal CloneDialog(WindowOwner owner) { InitializeComponent(); Owner = owner; }
protected async Task <int> ShowInternal(WindowOwner owner) { await WindowManager.ShowModal(this, owner); return(result); }
public MessageService(WindowOwner owner) { this.owner = owner; }
protected async Task<int> ShowInternal(WindowOwner owner) { await WindowManager.ShowModal(this, owner); return result; }
public MessageBoxResult BlockingMessageBox(string message, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return DialogHelper.BlockingMessageBox(Dispatcher, message, ApplicationName, buttons, image, owner); }
public static Task<CheckedMessageBoxResult> Show(WindowOwner owner, string message, string caption, MessageBoxButton button, MessageBoxImage image, string checkedMessage, bool? isChecked) { return Show(owner, message, caption, GetButtons(button), image, checkedMessage, isChecked); }
public static void ShowNonModal(Window window, WindowOwner windowOwner = WindowOwner.MainWindow, WindowInitialPosition position = WindowInitialPosition.CenterOwner) { if (window == null) throw new ArgumentNullException(nameof(window)); CheckDispatcher(); var owner = FindNextOwner(windowOwner); window.Owner = owner?.Window; SetStartupLocation(window, owner, position); var windowInfo = new WindowInfo(window); AllWindowsList.Add(windowInfo); Logger.Info($"Non-modal window showing. ({window})"); window.Show(); }
public static Task <CheckedMessageBoxResult> Show(WindowOwner owner, string message, string caption, MessageBoxButton button, MessageBoxImage image, string checkedMessage, bool?isChecked) { return(Show(owner, message, caption, GetButtons(button), image, checkedMessage, isChecked)); }
public CheckedMessageBoxResult BlockingCheckedMessageBox(string message, bool? isChecked, string checkboxMessage, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return DialogHelper.BlockingCheckedMessageBox(Dispatcher, message, ApplicationName, isChecked, checkboxMessage, button, image, owner); }
public static Task <MessageBoxResult> Show(WindowOwner owner, string message, string caption, MessageBoxButton button, MessageBoxImage image) { return(Show(owner, message, caption, GetButtons(button), image)); }
internal SetBranchPromptDialog(WindowOwner owner) { InitializeComponent(); Owner = owner; }
/// <summary> /// Displays a <see cref="MessageBox"/> an returns the <see cref="MessageBoxResult"/> depending on the user's choice. /// </summary> /// <param name="owner">The intended owner window of the message box.</param> /// <param name="message">A <see cref="string"/> that specifies the text to display.</param> /// <param name="caption">A <see cref="string"/> that specifies the title bar caption to display.</param> /// <param name="buttons">A n enumeration of <see cref="DialogButtonInfo"/> that specifies buttons to display</param> /// <param name="image">A <see cref="MessageBoxImage"/> value that specifies the icon to display.</param> /// <returns>A <see cref="MessageBoxResult"/> value that specifies which message box button is clicked by the user.</returns> public static async Task<MessageBoxResult> Show(WindowOwner owner, string message, string caption, IEnumerable<DialogButtonInfo> buttons, MessageBoxImage image) { var buttonList = buttons.ToList(); var messageBox = new MessageBox { Title = caption, Content = message, ButtonsSource = buttonList, }; SetImage(messageBox, image); SetKeyBindings(messageBox, buttonList); return (MessageBoxResult)await messageBox.ShowInternal(owner); }
/************************************************************************/ #region Constructor /// <summary> /// Initializes a new instance of the<see cref="WindowViewModel"/> class. /// </summary> protected WindowViewModel() { CloseWindowCommand = RelayCommand.Create((p) => WindowOwner.Close()); ToggleWindowStateCommand = RelayCommand.Create(RunChangeWindowStateCommand); SetWindowStateMinimizedCommand = RelayCommand.Create((p) => WindowOwner.WindowState = WindowState.Minimized); }
public static Task <MessageBoxResult> MessageBox(IDispatcherService dispatcher, string message, string caption, IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(dispatcher.InvokeTask(() => Windows.MessageBox.Show(owner, message, caption, buttons, image))); }
public static Task ShowModal(Window window, WindowOwner windowOwner = WindowOwner.LastModal, WindowInitialPosition position = WindowInitialPosition.CenterOwner) { if (window == null) throw new ArgumentNullException(nameof(window)); CheckDispatcher(); var windowInfo = new WindowInfo(window); if (ModalWindowsList.Contains(windowInfo)) throw new InvalidOperationException("This window has already been shown as modal."); var owner = FindNextOwner(windowOwner); window.Owner = owner?.Window; SetStartupLocation(window, owner, position); // Set the owner now so the window can be recognized as modal when shown if (owner != null) { owner.IsDisabled = true; } AllWindowsList.Add(windowInfo); switch (windowOwner) { case WindowOwner.LastModal: ModalWindowsList.Add(windowInfo); break; case WindowOwner.MainWindow: ModalWindowsList.Insert(0, windowInfo); break; default: throw new ArgumentOutOfRangeException(nameof(windowOwner), windowOwner, null); } // Update the hwnd on load in case the window is closed before being shown // We will receive EVENT_OBJECT_HIDE but not EVENT_OBJECT_SHOW in this case. window.Loaded += (sender, e) => windowInfo.ForceUpdateHwnd(); Logger.Info($"Modal window showing. ({window})"); window.Show(); return windowInfo.WindowClosed.Task; }
public Task <MessageBoxResult> MessageBox(string message, MessageBoxButton buttons = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(DialogHelper.MessageBox(Dispatcher, message, ApplicationName, buttons, image, owner)); }
private static WindowInfo FindNextOwner(WindowOwner owner) { switch (owner) { case WindowOwner.LastModal: // Skip non-visible window, they might be in the process of being closed. return ModalWindows.FirstOrDefault(x => x.Hwnd == IntPtr.Zero || x.IsVisible) ?? MainWindow; case WindowOwner.MainWindow: return MainWindow; default: throw new ArgumentOutOfRangeException(nameof(owner), owner, null); } }
public MessageBoxResult BlockingMessageBox(string message, IEnumerable <DialogButtonInfo> buttons, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(DialogHelper.BlockingMessageBox(Dispatcher, message, ApplicationName, buttons, image, owner)); }
public CheckedMessageBoxResult BlockingCheckedMessageBox(string message, bool?isChecked, string checkboxMessage, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return(DialogHelper.BlockingCheckedMessageBox(Dispatcher, message, ApplicationName, isChecked, checkboxMessage, button, image, owner)); }
public Task<MessageBoxResult> MessageBox(string message, MessageBoxButton buttons = MessageBoxButton.OK, MessageBoxImage image = MessageBoxImage.None, WindowOwner owner = WindowOwner.LastModal) { return DialogHelper.MessageBox(Dispatcher, message, ApplicationName, buttons, image, owner); }