Exemplo n.º 1
0
        /// <summary>
        /// Occurs just before the text window closes.
        /// </summary>
        /// <param name="window">The window that is closing.</param>
        public void windowsEvents_WindowClosing(Window window)
        {
            if (window == null)
            {
                Debug.Fail("window == null");
                Utils.DisplayMessage(Resources.ErrorPrefix, "windowsEvents_WindowClosing has a null window parameter.");
                return;
            }

            if ((_codeCache != null) && (_codeCache.CurrentFileManager != null) &&
                (_codeCache.CurrentFileManager.Document == window.Document))
            {
                _codeCache.CurrentFileManager.State
                    = CodeOutlineFileManager.OutlineFileManagerState.WaitToStartOver;
                _control.HideWaitWhileReadyMessage();
                _control.Enabled            = false;
                _control.TreeView.Visible   = false;
                _control.FilterView.Visible = false;
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raised when a CodeElement object has been created.
        /// </summary>
        /// <param name="newElement">The CodeElement object that was added.</param>
        private void codeModelEvents_Added(CodeElement newElement)
        {
            try
            {
                if (CurrentFileManager == null)
                {
                    return;
                }

                if (!CurrentFileManager.FileIsOutlined)
                {
                    ForceReload();
                    return;
                }

                _control.ShowWaitWhileReadyMessage();
                _fileManager.OnCodeModelElementAdd(newElement);
                _control.HideWaitWhileReadyMessage();
            }
            catch (Exception ex)
            {
                Utils.DisplayMessage(Resources.ErrorPrefix, "codeModelEvents_Added exception: " + ex.ToString());
            }
        }