예제 #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);
            }
예제 #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));
                }
            }
예제 #3
0
 public WindowPaneListener(NiStatusBar statusBar, INiStatusBarUser statusBarUser, INiConnectionPoint connectionPoint)
     : base(connectionPoint)
 {
     _statusBar     = statusBar;
     _statusBarUser = statusBarUser;
 }
예제 #4
0
 public WindowPaneListener(NiStatusBar statusBar, INiStatusBarUser statusBarUser, INiConnectionPoint connectionPoint)
     : base(connectionPoint)
 {
     _statusBar = statusBar;
     _statusBarUser = statusBarUser;
 }
예제 #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);
            }
예제 #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);
                }
            }