public HandleException ( Exception exception ) : void | ||
exception | Exception | |
return | void |
public void DisableCommandStatusCheck(OleMenuCommand disableCommand) { try { disableCommand.Enabled = false; foreach (var project in currentProjectFinder.GetCurrentProjects()) { var xmlForProject = LoadXmlForProject(project); if (xmlForProject != null) { if (containsFodyChecker.Check(xmlForProject)) { disableCommand.Enabled = true; return; } } } } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
public void ConfigureCallback() { try { var project = currentProjectFinder.GetCurrentProject(); if (UnsaveProjectChecker.HasUnsavedPendingChanges(project)) { return; } var projectReader = new ProjectReader(project.FullName); var model = new ConfigureWindowModel(); var defaulter = new Defaulter(); defaulter.ToModel(projectReader, model); var configureWindow = new ConfigureWindow(model); new WindowInteropHelper(configureWindow) { Owner = GetActiveWindow() }; if (configureWindow.ShowDialog().GetValueOrDefault()) { Configure(model, project); } } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
void CommandStatusCheck() { try { disableCommand.Enabled = true; configureCommand.Enabled = true; var project = currentProjectFinder.GetCurrentProject(); if (project == null) { disableCommand.Enabled = false; configureCommand.Enabled = false; return; } var xmlForProject = LoadXmlForProject(project); if (xmlForProject == null) { disableCommand.Enabled = false; configureCommand.Enabled = false; return; } disableCommand.Enabled = ContainsWeavingTask(xmlForProject); } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
private void TreeView_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e) { try { // Get Double Clicked Node (and Table) if (e == null) { return; } TreeNode treeNode = e.Node; if (treeNode == null) { return; } TreeNodeTable treeNodeTable = treeNode as TreeNodeTable; if (treeNodeTable == null) { return; } EsriTable table = treeNodeTable.Table; if (table == null) { return; } // Scroll to Table this._model.ScrollToElement(table); } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
protected override void Initialize() { base.Initialize(); var exceptionDialog = new ExceptionDialog(); try { var menuCommandService = (IMenuCommandService)GetService(typeof(IMenuCommandService)); var errorListProvider = new ErrorListProvider(ServiceProvider.GlobalProvider); var currentProjectFinder = new CurrentProjectFinder(); var contentsFinder = new ContentsFinder(); var configureMenuCallback = new ConfigureMenuCallback(currentProjectFinder, contentsFinder, exceptionDialog); var messageDisplayer = new MessageDisplayer(errorListProvider); var disableMenuConfigure = new DisableMenuConfigure(currentProjectFinder, messageDisplayer, exceptionDialog); var containsFodyChecker = new ContainsFodyChecker(); var menuStatusChecker = new MenuStatusChecker(currentProjectFinder, exceptionDialog, containsFodyChecker); new MenuConfigure(configureMenuCallback, disableMenuConfigure, menuCommandService, menuStatusChecker).RegisterMenus(); var taskFileReplacer = new TaskFileReplacer(messageDisplayer, contentsFinder); var taskFileProcessor = new TaskFileProcessor(taskFileReplacer, messageDisplayer); var msBuildKiller = new MSBuildKiller(); new SolutionEvents(taskFileProcessor, exceptionDialog, msBuildKiller).RegisterSolutionEvents(); new TaskFileReplacer(messageDisplayer, contentsFinder).CheckForFilesToUpdate(); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
private void MenuItem_Activate(object sender, EventArgs e) { try { if (sender == this.menuButtonItemReset) { if (this.menuButtonItemReset.Tag != null) { if (this.menuButtonItemReset.Tag is PropertyGrid) { PropertyGrid propertyGrid = (PropertyGrid)this.menuButtonItemReset.Tag; propertyGrid.ResetSelectedProperty(); } } } else if (sender == this.menuButtonItemDescription) { if (this.menuButtonItemDescription.Tag != null) { if (this.menuButtonItemDescription.Tag is PropertyGrid) { PropertyGrid propertyGrid = (PropertyGrid)this.menuButtonItemDescription.Tag; propertyGrid.HelpVisible = !(propertyGrid.HelpVisible); } } } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void TreeView_AfterSelect(object sender, TreeViewEventArgs e) { try { if (e.Node is TreeNodeGeodatabase) { TreeNodeGeodatabase treeNodeGeodatabase = (TreeNodeGeodatabase)e.Node; EsriModel model = treeNodeGeodatabase.Model; model.SelectElements(false); } else if (e.Node is TreeNodeTable) { TreeNodeTable treeNodeTable = (TreeNodeTable)e.Node; EsriTable table = treeNodeTable.Table; EsriModel model = (EsriModel)table.Container; model.SelectElements(false); table.Selected = true; } else if (e.Node is TreeNodeGroup) { } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void LoadReport() { try { // Create Report this._dataReport.Export(); if (string.IsNullOrEmpty(this._dataReport.Html)) { return; } // Update Web Browser Contents if (this.webBrowser1 == null) { return; } if (this.webBrowser1.IsDisposed) { return; } if (this.webBrowser1.Disposing) { return; } this.webBrowser1.Navigate(this._dataReport.Html); } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void Timer_Tick(object sender, EventArgs e) { try { if (this.IsDisposed) { return; } if (this.Disposing) { return; } if (!(this.Visible)) { return; } if (this.WindowState == FormWindowState.Minimized) { return; } this.buttonApply.Enabled = this.m_edited; this.buttonCancel.Enabled = true; this.buttonReset.Enabled = true; this.buttonOK.Enabled = true; } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void MenuItem_BeforePopup(object sender, MenuPopupEventArgs e) { try { if (sender == this.contextMenuBarItemGrid) { // Get Selected Property Grid PropertyGrid propertyGrid = null; if (e.Control != null && e.Control is PropertyGrid) { propertyGrid = (PropertyGrid)e.Control; } // Enable/Check Menu Items this.menuButtonItemReset.Enabled = propertyGrid != null && propertyGrid.SelectedGridItem != null; this.menuButtonItemDescription.Enabled = propertyGrid != null; this.menuButtonItemDescription.Checked = propertyGrid != null && propertyGrid.HelpVisible; // Store Reference of Selected PropertyGrid this.menuButtonItemReset.Tag = propertyGrid; this.menuButtonItemDescription.Tag = propertyGrid; } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
protected override void Initialize() { base.Initialize(); var exceptionDialog = new ExceptionDialog("http://code.google.com/p/notifypropertyweaver/issues/list", "NotifyPropertyWeaver"); try { using (var catalog = new AssemblyCatalog(GetType().Assembly)) using (var container = new CompositionContainer(catalog)) { var menuCommandService = (IMenuCommandService) GetService(typeof (IMenuCommandService)); var errorListProvider = new ErrorListProvider(ServiceProvider.GlobalProvider); container.ComposeExportedValue(exceptionDialog); container.ComposeExportedValue(menuCommandService); container.ComposeExportedValue(errorListProvider); container.GetExportedValue<MenuConfigure>().RegisterMenus(); container.GetExportedValue<SolutionEvents>().RegisterSolutionEvents(); container.GetExportedValue<TaskFileReplacer>().CheckForFilesToUpdate(); } } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
protected override void Initialize() { base.Initialize(); var exceptionDialog = new ExceptionDialog(); try { using (var catalog = new AssemblyCatalog(GetType().Assembly)) using (var container = new CompositionContainer(catalog)) { var menuCommandService = (IMenuCommandService)GetService(typeof(IMenuCommandService)); var errorListProvider = new ErrorListProvider(ServiceProvider.GlobalProvider); container.ComposeExportedValue(exceptionDialog); container.ComposeExportedValue(menuCommandService); container.ComposeExportedValue(errorListProvider); container.GetExportedValue <MenuConfigure>().RegisterMenus(); container.GetExportedValue <SolutionEvents>().RegisterSolutionEvents(); container.GetExportedValue <TaskFileReplacer>().CheckForFilesToUpdate(); } } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
private void ToolBar_ButtonClick(object sender, ToolBarItemEventArgs e) { try { if (e.Item == this.buttonItemCatalog || e.Item == this.buttonItemCategorized || e.Item == this.buttonItemAlphabetical) { ButtonItem item = (ButtonItem)e.Item; if (item.Checked) { return; } this.buttonItemCatalog.Checked = (e.Item == this.buttonItemCatalog); this.buttonItemCategorized.Checked = (e.Item == this.buttonItemCategorized); this.buttonItemAlphabetical.Checked = (e.Item == this.buttonItemAlphabetical); this.LoadModel(); } else if (e.Item == this.buttonItemRefresh) { this.LoadModel(); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void MenuItem_Activate(object sender, EventArgs e) { try { TreeNode treeNode = this.treeView1.SelectedNode; if (treeNode == null) { return; } TreeNodeTable treeNodeTable = treeNode as TreeNodeTable; if (treeNodeTable == null) { return; } EsriTable table = treeNodeTable.Table; if (table == null) { return; } if (sender == this.menuButtonItemScroll) { this._model.ScrollToElement(table); } else if (sender == this.menuButtonItemFlash) { table.Flash(); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
protected override void Initialize() { base.Initialize(); var exceptionDialog = new ExceptionDialog(); try { var menuCommandService = (IMenuCommandService) GetService(typeof (IMenuCommandService)); var errorListProvider = new ErrorListProvider(ServiceProvider.GlobalProvider); var currentProjectFinder = new CurrentProjectFinder(); var contentsFinder = new ContentsFinder(); var configureMenuCallback = new ConfigureMenuCallback(currentProjectFinder, contentsFinder, exceptionDialog); var messageDisplayer = new MessageDisplayer(errorListProvider); var disableMenuConfigure = new DisableMenuConfigure(currentProjectFinder, messageDisplayer, exceptionDialog); var containsFodyChecker = new ContainsFodyChecker(); var menuStatusChecker = new MenuStatusChecker(currentProjectFinder, exceptionDialog, containsFodyChecker); new MenuConfigure(configureMenuCallback, disableMenuConfigure, menuCommandService, menuStatusChecker).RegisterMenus(); var taskFileReplacer = new TaskFileReplacer(messageDisplayer, contentsFinder); var taskFileProcessor = new TaskFileProcessor(taskFileReplacer, messageDisplayer); var msBuildKiller = new MSBuildKiller(); new SolutionEvents(taskFileProcessor, exceptionDialog, msBuildKiller).RegisterSolutionEvents(); new TaskFileReplacer(messageDisplayer, contentsFinder).CheckForFilesToUpdate(); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
// // PRIVATE METHODS // private void Report_Invalidated(object sender, EventArgs e) { try { this.LoadReport(); } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void ContextMenu_BeforePopup(object sender, TD.SandBar.MenuPopupEventArgs e) { try { TreeNode treeNode = this.treeView1.SelectedNode; this.menuButtonItemScroll.Enabled = (treeNode is TreeNodeTable); this.menuButtonItemFlash.Enabled = (treeNode is TreeNodeTable); } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
public void DisableCallback() { try { var project = currentProjectFinder.GetCurrentProject(); if (UnsaveProjectChecker.HasUnsavedPendingChanges(project)) { return; } errorDisplayer.ShowInfo(string.Format("Costura: Removed from the project '{0}'. However no binary files will be removed in case they are being used by other projects.", project.Name)); new ProjectRemover(project.FullName); } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
private void ListView_DoubleClick(object sender, EventArgs e) { try { if (sender == this.listViewErrorList) { this.Invoke(new EventHandler(this.MenuItem_Activate), new object[] { this.menuButtonItemScroll, EventArgs.Empty }); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void TreeView_AfterExpand(object sender, TreeViewEventArgs e) { try { if (e.Node is TreeNodeGroup) { e.Node.ImageKey = Catalog.FOLDER_OPENED; e.Node.SelectedImageKey = Catalog.FOLDER_OPENED; } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
// // PRIVATE METHODS // private void ColorScheme_PropertyChanged(object sender, PropertyChangedEventArgs e) { try { // Update SandBar Office2007Renderer sandBarRenderer = (Office2007Renderer)this.sandBarManager1.Renderer; if (sandBarRenderer.ColorScheme == ColorSchemeSettings.Default.ColorScheme) { return; } sandBarRenderer.ColorScheme = ColorSchemeSettings.Default.ColorScheme; } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
public void ConfigureCallback() { try { var currentProjects = currentProjectFinder.GetCurrentProjects(); if (currentProjects .Any(UnsaveProjectChecker.HasUnsavedPendingChanges)) { return; } foreach (var project in currentProjects) { Configure(project); } } catch (COMException exception) { exceptionDialog.HandleException(exception); } catch (Exception exception) { exceptionDialog.HandleException(exception); } }
private void MenuItem_BeforePopup(object sender, MenuPopupEventArgs e) { try { if (sender == this.contextMenuBarItemGrid) { // Enable/Check Menu Items this.menuButtonItemReset.Enabled = this.propertyPrinter.SelectedGridItem != null; this.menuButtonItemDescription.Enabled = true; this.menuButtonItemDescription.Checked = this.propertyPrinter.HelpVisible; } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void MenuItem_Activate(object sender, EventArgs e) { try { if (sender == this.menuButtonItemReset) { this.propertyPrinter.ResetSelectedProperty(); } else if (sender == this.menuButtonItemDescription) { this.propertyPrinter.HelpVisible = !(this.propertyPrinter.HelpVisible); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution) { try { var dte = (DTE)ServiceProvider.GlobalProvider.GetService(typeof(DTE)); if (!string.IsNullOrEmpty(dte.Solution.FullName)) { var solutionDirectory = Path.GetDirectoryName(dte.Solution.FullName); taskFileProcessor.ProcessTaskFile(solutionDirectory); } } catch (Exception exception) { exceptionDialog.HandleException(exception); } return(VSConstants.S_OK); }
private void Button_Click(object sender, EventArgs e) { try { if (sender == this.buttonApply) { this.m_printer.Save(); this.propertyPrinter.Refresh(); this.m_edited = false; } else if (sender == this.buttonCancel) { this.m_printer.Reload(); this.Close(); } else if (sender == this.buttonReset) { DialogResult dialogResult = MessageBox.Show( Resources.TEXT_RESET_CURRENT_TAB_WARNING, Resources.TEXT_ARCDIAGRAMMER, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3, MessageBoxOptions.DefaultDesktopOnly); switch (dialogResult) { case DialogResult.Yes: this.m_printer.Reset(); this.propertyPrinter.Refresh(); break; case DialogResult.Cancel: case DialogResult.No: default: break; } } else if (sender == this.buttonOK) { this.m_printer.Save(); this.Close(); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void ToolBar_ButtonClick(object sender, ToolBarItemEventArgs e) { try { if (e.Item == this.buttonItemErrors) { this.RefreshErrorList(); } else if (e.Item == this.buttonItemWarnings) { this.RefreshErrorList(); } else if (e.Item == this.dropDownMenuItemValidator) { this.dropDownMenuItemValidator.Show(); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
public int OnAfterOpenSolution(object pUnkReserved, int fNewSolution) { try { foreach (var project in allProjectFinder.GetAllProjects()) { try { taskFileProcessor.ProcessTaskFile(project); } catch (Exception exception) { errorDisplayer.ShowError(string.Format("Costura: An exception occured while trying to process {0}.\r\nException: {1}.", project.FullName, exception)); } } } catch (Exception exception) { exceptionDialog.HandleException(exception); } return(VSConstants.S_OK); }
private void TreeView_KeyDown(object sender, KeyEventArgs e) { try { switch (e.KeyData) { case Keys.Enter: // Handle Event e.Handled = true; // Get Table TreeNode treeNode = this.treeView1.SelectedNode; if (treeNode == null) { return; } TreeNodeTable treeNodeTable = treeNode as TreeNodeTable; if (treeNodeTable == null) { return; } EsriTable table = treeNodeTable.Table; if (table == null) { return; } // Scroll to Table this._model.ScrollToElement(table); break; default: break; } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
// // PRIVATE METHODS // private void Timer_Tick(object sender, EventArgs e) { try { if (this.IsDisposed) { return; } if (this.Disposing) { return; } if (!(this.Visible)) { return; } if (this.WindowState == FormWindowState.Minimized) { return; } // Get Count int count = this.listViewWindows.SelectedItems.Count; // Activate Button if (this.buttonActivate.Enabled != (count == 1)) { this.buttonActivate.Enabled = (count == 1); } // Close Button if (this.buttonClose.Enabled != (count > 0)) { this.buttonClose.Enabled = (count > 0); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
private void Activate_Click(object sender, EventArgs e) { try{ if (sender == this.buttonActivate) { if (this.listViewWindows.SelectedItems.Count != 1) { return; } ListViewItemTabbedDocument item = (ListViewItemTabbedDocument)this.listViewWindows.SelectedItems[0]; item.TabbedDocument.Activate(); // this.LoadDockControls(); } else if (sender == this.buttonClose) { foreach (ListViewItemTabbedDocument item in this.listViewWindows.SelectedItems) { if (item.TabbedDocument.AllowClose) { item.TabbedDocument.Close(); } } // this.LoadDockControls(); } else if (sender == this.buttonOK) { this.Close(); } } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }
// // PRIVATE METHODS // private void LinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { if (sender == null) { return; } if (!(sender is LinkLabel)) { return; } LinkLabel linkLabel = (LinkLabel)sender; string link = null; if (linkLabel == this.linkLabelWebsite) { link = Resources.TEXT_URL_ESRI_HOME; } else if (linkLabel == this.linkLabelContactAuthor) { link = Resources.TEXT_URL_FEEDBACK; } if (link == null) { return; } Process process = new Process(); process.StartInfo.FileName = link; process.StartInfo.Verb = "Open"; process.StartInfo.CreateNoWindow = false; process.Start(); } catch (Exception ex) { ExceptionDialog.HandleException(ex); } }