예제 #1
0
        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);
        }
예제 #2
0
        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()));
        }
예제 #3
0
        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>());
        }
예제 #4
0
        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>());
        }
예제 #6
0
        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();
            }
        }
예제 #7
0
        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;
            }
        }
예제 #8
0
 protected CodeLinkedGlobalOptionSetPublishInConnectionCommand(OleMenuCommandService commandService, int baseIdStart, SelectedFileType selectedFileType)
     : base(commandService, baseIdStart)
 {
     this._selectedFileType = selectedFileType;
 }
예제 #9
0
 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;
 }
예제 #12
0
        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;
            }
        }