コード例 #1
0
        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();
        }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
 private void SelectionServicePropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.PropertyName == nameof(SelectionService.SelectedFeed))
     {
         ViewCore.CancelMultipleSelectionMode();
         UpdateItemsListView();
     }
 }
コード例 #5
0
 public void Show()
 {
     SelectedSection = Sections[0];//Client Def default
     //Login screen first
     //SelectedSection = Sections[0];
     //L/efv
     ViewCore.Show();
 }
コード例 #6
0
 private void OkHandler()
 {
     dialogResult = true;
     if (IsWasReturned)
     {
         SelectedPerson = null;
     }
     ViewCore.Close();
 }
コード例 #7
0
        public bool ShowDialog()
        {
            bool?response = ViewCore.ShowDialog();

            if (response.HasValue)
            {
                return(response.Value);
            }
            return(false);
        }
コード例 #8
0
        public bool ShowDialog(object parent)
        {
            bool?response = ViewCore.ShowDialog(parent);

            if (response.HasValue)
            {
                return(response.Value);
            }
            return(false);
        }
コード例 #9
0
 private async Task ShowWhatsNew()
 {
     await Task.Run(() =>
     {
         Common.DispatcherHelper.CheckBeginInvokeOnUI(() =>
         {
             var contentView = ChildContentViewFactory.GetChildContentViewModel(ChildViewContentType.WhatsNew);
             ViewCore.ShowChildWindow(contentView.View);
         });
     });
 }
コード例 #10
0
        //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);
            }
        }
コード例 #11
0
 public void Show(bool startMinimized)
 {
     if (startMinimized)
     {
         GuiInteractionService.HideApplication();
     }
     else
     {
         ViewCore.Show();
         ShowOnLaunch();
     }
 }
コード例 #12
0
 public void Show(bool startMinimized)
 {
     if (startMinimized)
     {
         GuiInteractionService.HideApplication();
     }
     else
     {
         ViewCore.Show();
         Task.Run(async() => await ShowOnLaunch());
     }
 }
コード例 #13
0
        private void Delete()
        {
            var selectedEntries = ViewCore.GetSelectedEntries();

            if (!selectedEntries.Any())
            {
                return;
            }
            foreach (var entry in selectedEntries)
            {
                Archive.DeleteEntry(entry);
            }
            RaisePropertyChanged(nameof(Archive));
        }
コード例 #14
0
        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;
            }
        }
コード例 #15
0
        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);
        }
コード例 #16
0
 public void ShowBalloon()
 {
     ViewCore.ShowCustomBalloon();
 }
コード例 #17
0
 public void ShowBalloon(string tooltipText)
 {
     ToolTipText = tooltipText;
     DispatcherHelper.CheckBeginInvokeOnUI(() => ViewCore.ShowCustomBalloon());
 }
コード例 #18
0
 public void FocusItem()
 {
     ViewCore.FocusItem();
 }
コード例 #19
0
 public void ShowDialog(object owner)
 {
     ViewCore.ShowDialog(owner);
 }
コード例 #20
0
 public void Close()
 {
     ViewCore.Close();
 }
コード例 #21
0
 private void Close(bool?dialogResult)
 {
     this.dialogResult = dialogResult;
     ViewCore.Close();
 }
コード例 #22
0
 public void Focus()
 {
     ViewCore.FocusFirstControl();
 }
コード例 #23
0
 public void Quit()
 {
     ViewCore.Quit();
 }
コード例 #24
0
 /// <summary>
 /// </summary>
 /// <param name="tooltipText"></param>
 /// <param name="timeoutInMilliseconds"></param>
 public void ShowBalloon(string tooltipText, int timeoutInMilliseconds)
 {
     ToolTipText = tooltipText;
     DispatcherHelper.CheckBeginInvokeOnUI(() => ViewCore.ShowCustomBalloon(timeoutInMilliseconds));
 }
コード例 #25
0
 public void HideBalloon()
 {
     DispatcherHelper.CheckBeginInvokeOnUI(() => ViewCore.CloseBalloon());
 }
コード例 #26
0
        private void Confirm_OnExecute()
        {
            _dialogResult = true;

            ViewCore.Close();
        }
コード例 #27
0
 public void Focus()
 {
     ViewCore.FocusFirstCell();
 }
コード例 #28
0
 public bool?ShowDialog(object owner)
 {
     ViewCore.ShowDialog(owner);
     return(dialogResult);
 }
コード例 #29
0
 public void Show()
 {
     ViewCore.Show();
 }
コード例 #30
0
ファイル: PrintPreviewViewModel.cs プロジェクト: zwq00000/waf
 protected override void FitToWidthCore()
 {
     base.FitToWidthCore();
     ViewCore.FitToWidth();
 }