Пример #1
0
        public string GetCommitMessage(IntPtr hParentWnd, string parameters, string commonRoot, string[] pathList, string originalMessage)
        {
            connectionErrorReported = false;
            cs = new ConnectionSettings(parameters);
            IssuesForm form = new IssuesForm(this, cs);
            this.form = form;

            // WTF does this take so long?
            BasicHttpBinding binding = new BasicHttpBinding();
            EndpointAddress endpoint = new EndpointAddress(cs.URL);
            client = new MantisConnectPortTypeClient(binding, endpoint);

            client.mc_versionCompleted += new EventHandler<mc_versionCompletedEventArgs>(client_mc_versionCompleted);
            client.mc_projects_get_user_accessibleCompleted += new EventHandler<mc_projects_get_user_accessibleCompletedEventArgs>(client_mc_projects_get_user_accessibleCompleted);
            client.mc_enum_statusCompleted += new EventHandler<mc_enum_statusCompletedEventArgs>(client_mc_enum_statusCompleted);
            client.mc_projects_get_user_accessibleAsync(cs.Username, cs.Password);
            client.mc_enum_statusAsync(cs.Username, cs.Password);

            if (form.ShowDialog() == DialogResult.OK)
            {
                IssueHeaderData issue = form.GetSelectedIssue();
                if (issue != null)
                {
                    String retMessage = String.Format("BUGFIX: {0}\nissue {1}\n", issue.summary, issue.id);
                    return retMessage;
                }
            }
            return originalMessage;
        }
Пример #2
0
 public IssuesForm(Plugin plugin, ConnectionSettings cs)
 {
     InitializeComponent();
     issuesListColumnSorter = new IssuesListColumnSorter();
     issuesList.ListViewItemSorter = (IComparer)issuesListColumnSorter;
     this.Text += String.Format(" v{0}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
     issueHeaders = null;
     selectedIssue = null;
     myAccountID = null;
     userNameMapping = new Dictionary<string, string>();
     statusMapping = new Dictionary<string, string>();
     this.cs = cs;
     searchString = String.Empty;
     plugin.StatusUpdated += new Plugin.StatusUpdatedHandler(plugin_StatusUpdated);
     InitializeStatusColorMapping();
 }
Пример #3
0
 public bool ValidateParameters(IntPtr hParentWnd, string parameters)
 {
     ConnectionSettings cs = new ConnectionSettings(parameters);
     if (!cs.isValid())
     {
         MessageBox.Show("invalid parameters\nexample:\nurl:http://bugserver/bugs/api/soap/mantisconnect.php username:foouser password:foopass project:fooproject",
             "invalid parameters", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return false;
     }
     return true;
 }