public static Func <string, bool> GetCheckerFunction(this SelectedFileType selectedFileType) { switch (selectedFileType) { case SelectedFileType.WebResource: return(Helpers.FileOperations.SupportsWebResourceType); case SelectedFileType.WebResourceText: return(Helpers.FileOperations.SupportsWebResourceTextType); case SelectedFileType.WebResourceJavaScript: case SelectedFileType.WebResourceJavaScriptHasLinkedSystemForm: case SelectedFileType.WebResourceJavaScriptHasLinkedGlobalOptionSet: return(Helpers.FileOperations.SupportsJavaScriptType); case SelectedFileType.Report: return(Helpers.FileOperations.SupportsReportType); case SelectedFileType.CSharp: case SelectedFileType.CSharpHasLinkedGlobalOptionSet: return(Helpers.FileOperations.SupportsCSharpType); case SelectedFileType.Xml: return(Helpers.FileOperations.SupportsXmlType); default: break; } return(null); }
private IEnumerable <Tuple <string, string> > GenerateMasterScriptFile(string path) { Analytics.Track("Export", new Dictionary <string, string> { { "exportType", SelectedFileType.ToString() }, { "includeVoiceActors", IncludeVoiceActors.ToString() } }); return(GenerateFile(path, () => GetExportData())); }
public IEnumerable <SelectedFile> GetSelectedFiles(DTEHelper helper, SelectedFileType selectedFileType) { Func <string, bool> checkerFunction = selectedFileType.GetCheckerFunction(); if (checkerFunction != null) { return(helper.GetOpenedDocuments(checkerFunction).ToList()); } return(Enumerable.Empty <SelectedFile>()); }
public IEnumerable <SelectedFile> GetSelectedFiles(DTEHelper helper, SelectedFileType selectedFileType) { Func <string, bool> checkerFunction = selectedFileType.GetCheckerFunction(); if (checkerFunction != null) { return(helper.GetSelectedFilesInSolutionExplorer(checkerFunction, true).ToList()); } return(Enumerable.Empty <SelectedFile>()); }
public IEnumerable <SelectedFile> GetSelectedFiles(DTEHelper helper, SelectedFileType selectedFileType) { Func <string, bool> checkerFunction = selectedFileType.GetCheckerFunction(); if (checkerFunction != null) { var result = helper.GetSelectedFilesInSolutionExplorer(checkerFunction, false).ToList(); if (result.Count == 1) { return(result); } } return(Enumerable.Empty <SelectedFile>()); }
private void buttonUpdateHugo_Click(object sender, EventArgs e) { try { DataTable changes = null; int rowsToChange = 0; if (dataGridView1.DataSource != null) { changes = ((DataTable)dataGridView1.DataSource).GetChanges(); if (changes != null) { rowsToChange = changes.Rows.Count; } } if (rowsToChange <= 0) { MessageBox.Show("No updates to perform", "Update Hugo", MessageBoxButtons.OK); } else if (DialogResult.Yes == MessageBox.Show(String.Format("Update {0} records?", rowsToChange), "Update Hugo", MessageBoxButtons.YesNo)) { buttonUpdateHugo.Enabled = false; switch (SelectedFileType) { case FileType.Positions: Utilities.UpdatePositionRecords(SelectedClearingHouse, changes); break; case FileType.Confirmations: Utilities.UpdateConfirmationRecords(SelectedClearingHouse, changes); break; default: MessageBox.Show(String.Format("Updates not supported for file type {0}", SelectedFileType.ToString()), "Update Hugo", MessageBoxButtons.OK); break; } } } catch (Exception ex) { HandleError("Error updating Hugo", ex); } finally { m_needToBindSource = true; EnableControls(); BindSource(); } }
public void CommandBeforeQueryStatus(DTE2 applicationObject, OleMenuCommand menuCommand, SelectedFileType selectedFileType) { switch (selectedFileType) { case SelectedFileType.WebResource: CommonHandlers.ActionBeforeQueryStatusOpenedDocumentsWebResource(applicationObject, menuCommand); break; case SelectedFileType.WebResourceText: CommonHandlers.ActionBeforeQueryStatusOpenedDocumentsWebResourceText(applicationObject, menuCommand); break; case SelectedFileType.WebResourceJavaScript: case SelectedFileType.WebResourceJavaScriptHasLinkedSystemForm: case SelectedFileType.WebResourceJavaScriptHasLinkedGlobalOptionSet: CommonHandlers.ActionBeforeQueryStatusOpenedDocumentsJavaScript(applicationObject, menuCommand); break; case SelectedFileType.Report: CommonHandlers.ActionBeforeQueryStatusOpenedDocumentsReport(applicationObject, menuCommand); break; case SelectedFileType.CSharp: case SelectedFileType.CSharpHasLinkedGlobalOptionSet: CommonHandlers.ActionBeforeQueryStatusOpenedDocumentsCSharp(applicationObject, menuCommand); break; case SelectedFileType.Xml: CommonHandlers.ActionBeforeQueryStatusOpenedDocumentsXml(applicationObject, menuCommand); break; default: menuCommand.Enabled = menuCommand.Visible = false; break; } }
protected CodeLinkedGlobalOptionSetPublishInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, SelectedFileType selectedFileType) : base(commandService, baseIdStart) { this._selectedFileType = selectedFileType; }
protected CodeLinkedGlobalOptionSetExplorerCommand(OleMenuCommandService commandService, int idCommand, SelectedFileType selectedFileType) : base(commandService, idCommand) { this._selectedFileType = selectedFileType; }
protected CodeLinkedGlobalOptionSetAddToSolutionLastSelectedCommand(OleMenuCommandService commandService, int baseIdStart, SelectedFileType selectedFileType) : base(commandService, baseIdStart) { this._selectedFileType = selectedFileType; }
protected CodeLinkedGlobalOptionSetActionOnComponentInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, ActionOnComponent actionOnComponent, SelectedFileType selectedFileType) : base(commandService, baseIdStart) { this._actionOnComponent = actionOnComponent; this._selectedFileType = selectedFileType; }
public void CommandBeforeQueryStatus(DTE2 applicationObject, OleMenuCommand menuCommand, SelectedFileType selectedFileType) { switch (selectedFileType) { case SelectedFileType.WebResource: CommonHandlers.ActionBeforeQueryStatusSolutionExplorerWebResourceRecursive(applicationObject, menuCommand); break; case SelectedFileType.WebResourceText: CommonHandlers.ActionBeforeQueryStatusSolutionExplorerWebResourceTextRecursive(applicationObject, menuCommand); break; case SelectedFileType.WebResourceJavaScript: case SelectedFileType.WebResourceJavaScriptHasLinkedSystemForm: case SelectedFileType.WebResourceJavaScriptHasLinkedGlobalOptionSet: CommonHandlers.ActionBeforeQueryStatusSolutionExplorerJavaScriptRecursive(applicationObject, menuCommand); break; case SelectedFileType.Report: CommonHandlers.ActionBeforeQueryStatusSolutionExplorerReportRecursive(applicationObject, menuCommand); break; case SelectedFileType.CSharp: case SelectedFileType.CSharpHasLinkedGlobalOptionSet: CommonHandlers.ActionBeforeQueryStatusSolutionExplorerCSharpRecursive(applicationObject, menuCommand); break; case SelectedFileType.Xml: CommonHandlers.ActionBeforeQueryStatusSolutionExplorerXmlRecursive(applicationObject, menuCommand); break; default: menuCommand.Enabled = menuCommand.Visible = false; break; } }