Exemple #1
0
            private void OnActiveDocumentChanged()
            {
                var currentPane = _mainForm._windowPaneSelection.ActiveDocument;

                _currentUser = currentPane as INiStatusBarUser;

                Status status;

                if (_currentUser == null)
                {
                    status = _defaultStatus;
                }
                else
                {
                    if (!_statuses.TryGetValue(_currentUser, out status))
                    {
                        status = new Status();
                        _statuses.Add(_currentUser, status);

                        INiWindowFrame windowFrame;
                        ErrorUtil.ThrowOnFailure(((INiShell)GetService(typeof(INiShell))).GetWindowFrameForWindowPane(
                                                     currentPane,
                                                     out windowFrame
                                                     ));

                        Debug.Assert(windowFrame != null);

                        new WindowPaneListener(this, _currentUser, windowFrame);
                    }

                    ErrorUtil.ThrowOnFailure(_currentUser.SetInfo());
                }

                ApplyStatus(status);
            }
Exemple #2
0
            public HResult IsCurrentUser(INiStatusBarUser user, out bool isCurrent)
            {
                isCurrent = false;

                try
                {
                    isCurrent = user == _currentUser;

                    return(HResult.OK);
                }
                catch (Exception ex)
                {
                    return(ErrorUtil.GetHResult(ex));
                }
            }
Exemple #3
0
 public WindowPaneListener(NiStatusBar statusBar, INiStatusBarUser statusBarUser, INiConnectionPoint connectionPoint)
     : base(connectionPoint)
 {
     _statusBar     = statusBar;
     _statusBarUser = statusBarUser;
 }
Exemple #4
0
 public WindowPaneListener(NiStatusBar statusBar, INiStatusBarUser statusBarUser, INiConnectionPoint connectionPoint)
     : base(connectionPoint)
 {
     _statusBar = statusBar;
     _statusBarUser = statusBarUser;
 }
Exemple #5
0
            private void OnActiveDocumentChanged()
            {
                var currentPane = _mainForm._windowPaneSelection.ActiveDocument;
                _currentUser = currentPane as INiStatusBarUser;

                Status status;

                if (_currentUser == null)
                {
                    status = _defaultStatus;
                }
                else
                {
                    if (!_statuses.TryGetValue(_currentUser, out status))
                    {
                        status = new Status();
                        _statuses.Add(_currentUser, status);

                        INiWindowFrame windowFrame;
                        ErrorUtil.ThrowOnFailure(((INiShell)GetService(typeof(INiShell))).GetWindowFrameForWindowPane(
                            currentPane,
                            out windowFrame
                        ));

                        Debug.Assert(windowFrame != null);

                        new WindowPaneListener(this, _currentUser, windowFrame);
                    }

                    ErrorUtil.ThrowOnFailure(_currentUser.SetInfo());
                }

                ApplyStatus(status);
            }
Exemple #6
0
            public HResult IsCurrentUser(INiStatusBarUser user, out bool isCurrent)
            {
                isCurrent = false;

                try
                {
                    isCurrent = user == _currentUser;

                    return HResult.OK;
                }
                catch (Exception ex)
                {
                    return ErrorUtil.GetHResult(ex);
                }
            }