Exemplo n.º 1
0
        private void RemoveStatusBarItems()
        {
            _statusInfoUpdateSubscription.Dispose();
            _statusInfoUpdateSubscription = null;

            Editor.StatusBarItemsRight.Remove(_statusInfo);
            _statusInfo = null;
        }
Exemplo n.º 2
0
        private void AddStatusBarItems()
        {
            _statusInfo = new TextEditorStatusViewModel {
                IsVisible = false
            };
            Editor.StatusBarItemsRight.Insert(0, _statusInfo);

            // Observe the IDocumentService.ActiveDocumentChanged event and show/hide our status info.
            var documentService = _documentService;

            _statusInfoUpdateSubscription =
                Observable.FromEventPattern <EventArgs>(
                    h => documentService.ActiveDocumentChanged += h,
                    h => documentService.ActiveDocumentChanged -= h)
                .Select(eventPattern => (IDocumentService)eventPattern.Sender)
                .Select(ds => ds.ActiveDocument as TextDocument)
                .Subscribe(textDocument => _statusInfo.IsVisible = (textDocument != null));
        }
Exemplo n.º 3
0
        private void RemoveStatusBarItems()
        {
            _statusInfoUpdateSubscription.Dispose();
            _statusInfoUpdateSubscription = null;

            Editor.StatusBarItemsRight.Remove(_statusInfo);
            _statusInfo = null;
        }
Exemplo n.º 4
0
        private void AddStatusBarItems()
        {
            _statusInfo = new TextEditorStatusViewModel { IsVisible = false };
            Editor.StatusBarItemsRight.Insert(0, _statusInfo);

            // Observe the IDocumentService.ActiveDocumentChanged event and show/hide our status info.
            var documentService = _documentService;
            _statusInfoUpdateSubscription =
                Observable.FromEventPattern<EventArgs>(
                              h => documentService.ActiveDocumentChanged += h, 
                              h => documentService.ActiveDocumentChanged -= h)
                          .Select(eventPattern => (IDocumentService)eventPattern.Sender)
                          .Select(ds => ds.ActiveDocument as TextDocument)
                          .Subscribe(textDocument => _statusInfo.IsVisible = (textDocument != null));
        }