예제 #1
0
        private void mainWindow_Activated(object sender, EventArgs e)
        {
            if (this.AllowFileRefreshing &&
                LiveDocumentorFile.Singleton != null &&
                LiveDocumentorFile.Singleton.LiveDocument != null &&
                LiveDocumentorFile.Singleton.LiveDocument.Assemblies != null)
            {
                this.Cursor = Cursors.Wait;
                SelectionStateManager state = new SelectionStateManager();
                state.Save(this.currentSelection);
                bool hasBeenReloaded = false;

                foreach (DocumentedAssembly current in LiveDocumentorFile.Singleton.LiveDocument.Assemblies)
                {
                    if (current.HasAssemblyBeenModified())
                    {
                        hasBeenReloaded = true;

                        LiveDocumentorFile.Singleton.LiveDocument.RefreshAssembly(current);
                    }
                }

                // update the view if we are refreshing, especially since libraries may have been newly
                // compiled.
                if (hasBeenReloaded)
                {
                    this.UpdateView();
                    state.Restore();
                }

                this.Cursor = null;
            }
        }
예제 #2
0
        public static ISelectionStateManager CreateManager(ListViewBase listView, ButtonBase selectItemsButton, ButtonBase cancelSelectionButton)
        {
            var selectionManager = new SelectionStateManager(listView, selectItemsButton, cancelSelectionButton);

            listView.SetValue(AttachedSelectionManagerProperty, selectionManager);
            attachedPropertiesService.RegisterElement(listView);
            return(selectionManager);
        }
예제 #3
0
        /// <summary>
        /// Executes commands actioned by the user of the appliction which are implemented by the
        /// interface.
        /// </summary>
        /// <param name="sender">Calling object</param>
        /// <param name="e">Event arguments</param>
        public void ExecuteCommand(object sender, ExecutedRoutedEventArgs e)
        {
            if (e.Command == NavigationCommands.BrowseForward || e.Command == NavigationCommands.BrowseBack)
            {
                this.userViewingHistory.ExecuteCommand(sender, e);
            }
            else if (e.Command == ApplicationCommands.Open)
            {
                this.OpenDocumentationFile();
            }
            else if (e.Command == Commands.Add)
            {
                this.AddDocumentationFile();
            }
            else if (e.Command == ApplicationCommands.Close)
            {
                this.CloseApplication(sender, e);
            }
            else if (e.Command == ApplicationCommands.Print)
            {
                this.Button_Click(sender, e);
            }
            else if (e.Command == ApplicationCommands.Find)
            {
                this.searchBox.Focus();
            }
            else if (e.Command == ApplicationCommands.Save)
            {
                this.Save(false);
            }
            else if (e.Command == ApplicationCommands.SaveAs)
            {
                this.Save(true);
            }
            else if (e.Command == Commands.Export)
            {
                this.exportClick(sender, e);
            }
            else if (e.Command == Commands.Remove)
            {
                ProjectManager manager = new ProjectManager();
                manager.Owner = this;
                bool?result = manager.ShowDialog();
                if (result.HasValue && result.Value)
                {
                    SelectionStateManager state = new SelectionStateManager();
                    state.Save(this.currentSelection);
                    this.UpdateView();
                    state.Restore();
                }
            }
            else if (e.Command == Commands.DocumentSettings)
            {
                Preferences p = new Preferences();
                p.Owner = this;

                bool?result = p.ShowDialog();

                if (result.HasValue && result.Value)
                {
                    SelectionStateManager state = new SelectionStateManager();
                    state.Save(this.currentSelection);
                    this.UpdateView();
                    state.Restore();
                }
            }
        }