public void Write(string text, Brush color) { if (string.IsNullOrEmpty(text)) { return; } var textLines = text.Split(new[] { Environment.NewLine }, StringSplitOptions.None); var p = new Paragraph(); for (var i = 0; i < textLines.Length - 1; i++) { p.Inlines.Add(new Run(textLines[i]) { Foreground = color }); p.Inlines.Add(new LineBreak()); } p.Inlines.Add(new Run(textLines.Last()) { Foreground = color }); Document.Blocks.Add(p); ViewCore.ScrollToEnd(); }
private void Extract() { var selectedEntries = ViewCore.GetSelectedEntries(); if (!selectedEntries.Any()) { return; } var firstName = string.Format("{0}.{1}", selectedEntries[0].Name, selectedEntries[0].Type); SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.FileName = firstName; if (saveFileDialog.ShowDialog() == true) { var selectedFolder = Path.GetDirectoryName(saveFileDialog.FileName); foreach (var entry in selectedEntries) { var filename = string.Format("{0}.{1}", entry.Name, entry.Type); if (filename == firstName) { filename = Path.GetFileName(saveFileDialog.FileName); } var path = Path.Combine(selectedFolder, filename); File.WriteAllBytes(path, entry.Data); } } }
private void SearchTextCore(SearchMode searchMode) { if (!string.IsNullOrEmpty(SearchText)) { IEnumerable <PlaylistItem> itemsToSearch; if (SelectedPlaylistItem != null) { var index = IndexOf(PlaylistManager.Items, SelectedPlaylistItem); if (searchMode == SearchMode.Next) { index++; // Skip the current item so that the next one will be found. } itemsToSearch = PlaylistManager.Items.Skip(index).Concat(PlaylistManager.Items.Take(index)); } else { itemsToSearch = PlaylistManager.Items; } if (searchMode == SearchMode.Previous) { itemsToSearch = itemsToSearch.Reverse(); } var foundItem = itemsToSearch.FirstOrDefault(x => IsContained(x.MusicFile, SearchText)); if (foundItem != null) { SelectedPlaylistItem = foundItem; ViewCore.ScrollIntoView(foundItem); } } ViewCore.FocusSearchBox(); }
private void SelectionServicePropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(SelectionService.SelectedFeed)) { ViewCore.CancelMultipleSelectionMode(); UpdateItemsListView(); } }
public void Show() { SelectedSection = Sections[0];//Client Def default //Login screen first //SelectedSection = Sections[0]; //L/efv ViewCore.Show(); }
private void OkHandler() { dialogResult = true; if (IsWasReturned) { SelectedPerson = null; } ViewCore.Close(); }
public bool ShowDialog() { bool?response = ViewCore.ShowDialog(); if (response.HasValue) { return(response.Value); } return(false); }
public bool ShowDialog(object parent) { bool?response = ViewCore.ShowDialog(parent); if (response.HasValue) { return(response.Value); } return(false); }
private async Task ShowWhatsNew() { await Task.Run(() => { Common.DispatcherHelper.CheckBeginInvokeOnUI(() => { var contentView = ChildContentViewFactory.GetChildContentViewModel(ChildViewContentType.WhatsNew); ViewCore.ShowChildWindow(contentView.View); }); }); }
//public DataTable LookupTable //{ // get // { // return _LookupTable; // } // set // { // _LookupTable = value; // OnPropertyChanged(new PropertyChangedEventArgs("LookupTable")); // } //} public void ShowView() { if (ViewCore == null) { var view = _WindowService.NewParameterTableWindow(); view.ShowView(null); } else { ViewCore.ShowView(null); } }
public void Show(bool startMinimized) { if (startMinimized) { GuiInteractionService.HideApplication(); } else { ViewCore.Show(); ShowOnLaunch(); } }
public void Show(bool startMinimized) { if (startMinimized) { GuiInteractionService.HideApplication(); } else { ViewCore.Show(); Task.Run(async() => await ShowOnLaunch()); } }
private void Delete() { var selectedEntries = ViewCore.GetSelectedEntries(); if (!selectedEntries.Any()) { return; } foreach (var entry in selectedEntries) { Archive.DeleteEntry(entry); } RaisePropertyChanged(nameof(Archive)); }
private async Task Send() { try { var result = await _applicationUpdateService.SendFeedback(Name, Email, Message); if (result) { ViewCore.Close(); } } catch (Exception ex) { Logger.Error($"FeedbackViewModel:Send: {ex}"); _messageService.ShowWarning(Resources.SendFeedbackError); } finally { await Task.CompletedTask; } }
private void Login(object parameter) { System.Windows.Controls.PasswordBox passwordBox = parameter as System.Windows.Controls.PasswordBox; string textPassword = passwordBox.Password; UserResultModel userResult; if (Username != "" && textPassword != "") { userResult = _authenticationService.AuthenticateUser(Username, textPassword); } else { userResult = new UserResultModel() { UserModel = null, ServerResponse = _nameOrPwdNotSpecifiedInfo }; } if (userResult.UserModel != null) { CurrentUser.Initialize(userResult.UserModel); } ViewCore.ShowView(userResult); }
public void ShowBalloon() { ViewCore.ShowCustomBalloon(); }
public void ShowBalloon(string tooltipText) { ToolTipText = tooltipText; DispatcherHelper.CheckBeginInvokeOnUI(() => ViewCore.ShowCustomBalloon()); }
public void FocusItem() { ViewCore.FocusItem(); }
public void ShowDialog(object owner) { ViewCore.ShowDialog(owner); }
public void Close() { ViewCore.Close(); }
private void Close(bool?dialogResult) { this.dialogResult = dialogResult; ViewCore.Close(); }
public void Focus() { ViewCore.FocusFirstControl(); }
public void Quit() { ViewCore.Quit(); }
/// <summary> /// </summary> /// <param name="tooltipText"></param> /// <param name="timeoutInMilliseconds"></param> public void ShowBalloon(string tooltipText, int timeoutInMilliseconds) { ToolTipText = tooltipText; DispatcherHelper.CheckBeginInvokeOnUI(() => ViewCore.ShowCustomBalloon(timeoutInMilliseconds)); }
public void HideBalloon() { DispatcherHelper.CheckBeginInvokeOnUI(() => ViewCore.CloseBalloon()); }
private void Confirm_OnExecute() { _dialogResult = true; ViewCore.Close(); }
public void Focus() { ViewCore.FocusFirstCell(); }
public bool?ShowDialog(object owner) { ViewCore.ShowDialog(owner); return(dialogResult); }
public void Show() { ViewCore.Show(); }
protected override void FitToWidthCore() { base.FitToWidthCore(); ViewCore.FitToWidth(); }