Example #1
0
        public string ShowOptionsDialog(IntPtr hParentWnd, string parameters)
        {
            Logger.LogMessageWithData("ShowOptionsDialog: " + parameters);
            Parameters parms;

            try
            {
                parms = new Parameters(parameters);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "TurtleHub", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(parameters);
            }

            OptionsDialog form = new OptionsDialog(parms);

            if (form.ShowDialog(WindowHandleWrapper.TryCreate(hParentWnd)) == DialogResult.OK)
            {
                return(form.Params.ToString());
            }
            else
            {
                return(parameters);
            }
        }
Example #2
0
        public string GetCommitMessage2(IntPtr hParentWnd, string parameters, string commonURL, string commonRoot, string[] pathList,
                                        string originalMessage, string bugID, out string bugIDOut, out string[] revPropNames, out string[] revPropValues)
        {
            Logger.LogMessageWithData("GetCommitMessage2: DIC: " + System.IO.Directory.GetCurrentDirectory());
            Logger.LogMessageWithData("GetCommitMessage2: DIC-EXE: " + System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath));
            Logger.LogMessageWithData("GetCommitMessage2: DIC-ASS: " + System.IO.Path.GetDirectoryName(typeof(Logger).Assembly.Location));
            Logger.LogMessageWithData("GetCommitMessage2: parameters: " + parameters);
            Logger.LogMessageWithData("GetCommitMessage2: commonURL: " + commonURL);
            Logger.LogMessageWithData("GetCommitMessage2: commonRoot: " + commonRoot);
            foreach (var path in pathList)
            {
                Logger.LogMessageWithData("GetCommitMessage2: pathList: " + path);
            }
            Logger.LogMessageWithData("GetCommitMessage2: originalMessage: " + originalMessage);
            Logger.LogMessageWithData("GetCommitMessage2: bugID: " + bugID);

            // Don't know what these do, they were copied from Gurtle
            revPropNames  = new string[0];
            revPropValues = new string[0];
            bugIDOut      = bugID;

            try
            {
                Parameters         parms = new Parameters(parameters);
                IssueBrowserDialog form  = new IssueBrowserDialog(parms);
                if (form.ShowDialog(WindowHandleWrapper.TryCreate(hParentWnd)) != DialogResult.OK)
                {
                    return(originalMessage);
                }

                if (originalMessage.Length > 0 && !Char.IsWhiteSpace(originalMessage[originalMessage.Length - 1]))
                {
                    originalMessage += " ";
                }

                return(originalMessage + parms.CreateReferenceMessage(form.IssuesFixed.Select(issue => issue.Number).ToList()));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "TurtleHub Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(String.Empty);
            }
        }