Shows a changelist or stash with the ability to "walk" the chain. Returns "DialogResult.No" to load a previous change Returns "DialogResult.Yes" to load a next change Otherwise returns "DialogResult.Cancel"
Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        /// <summary>
        /// Describe (view) selected changelist and drive up/down back propagation through the host list view
        /// </summary>
        public static void DriveChangelistFromListViewEx(ref ListViewEx listRev)
        {
            // Get the SHA associated with the selected item on the log list
            ListView li = listRev;
            if (li.SelectedIndices.Count != 1)
                return;
            bool multiSel = li.MultiSelect;
            li.MultiSelect = false;
            int index = li.SelectedIndices[0];

            FormShowChangelist form = new FormShowChangelist();
            DialogResult dlg;

            do
            {
                li.Items[index].Selected = true;
                string sha = li.Items[index].Tag.ToString();
                form.LoadChangelist(sha);
                dlg = form.ShowDialog();

                // Using the "Yes" value to load a next commit
                if (dlg == DialogResult.Yes && index > 0)
                    index--;

                // Using the "No" value to load a previous commit
                if (dlg == DialogResult.No && index < li.Items.Count - 1)
                    index++;

            } while (dlg != DialogResult.Cancel);
            li.MultiSelect = multiSel;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Show more information on the selected stash
        /// </summary>
        private void BtShowClick(object sender, EventArgs e)
        {
            FormShowChangelist formShowChangelist = new FormShowChangelist();
            DialogResult       result;

            do
            {
                formShowChangelist.LoadChangelist(stash);

                // Walk the list of stashes up and down
                result = formShowChangelist.ShowDialog();
                if (result == DialogResult.No)
                {
                    if (listStashes.SelectedIndex < listStashes.Items.Count - 1)
                    {
                        listStashes.SelectedIndex++;
                    }
                }
                if (result == DialogResult.Yes)
                {
                    if (listStashes.SelectedIndex > 0)
                    {
                        listStashes.SelectedIndex--;
                    }
                }
            } while (result != DialogResult.Cancel);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Show more information on the selected stash
        /// </summary>
        private void BtShowClick(object sender, EventArgs e)
        {
            FormShowChangelist formShowChangelist = new FormShowChangelist();
            DialogResult result;
            do
            {
                formShowChangelist.LoadChangelist(stash);

                // Walk the list of stashes up and down
                result = formShowChangelist.ShowDialog();
                if(result==DialogResult.No)
                {
                    if (listStashes.SelectedIndex < listStashes.Items.Count - 1)
                        listStashes.SelectedIndex++;
                }
                if(result==DialogResult.Yes)
                {
                    if (listStashes.SelectedIndex > 0)
                        listStashes.SelectedIndex--;
                }
            } while (result != DialogResult.Cancel);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Describe (view) selected changelist and drive up/down back propagation through the host list view
        /// </summary>
        static public void DriveChangelistFromListViewEx(ref ListViewEx listRev)
        {
            // Get the SHA associated with the selected item on the log list
            ListView li = listRev;

            if (li.SelectedIndices.Count != 1)
            {
                return;
            }
            bool multiSel = li.MultiSelect;

            li.MultiSelect = false;
            int index = li.SelectedIndices[0];

            FormShowChangelist form = new FormShowChangelist();
            DialogResult       dlg;

            do
            {
                li.Items[index].Selected = true;
                string sha = li.Items[index].Tag.ToString();
                form.LoadChangelist(sha);
                dlg = form.ShowDialog();

                // Using the "Yes" value to load a next commit
                if (dlg == DialogResult.Yes && index > 0)
                {
                    index--;
                }

                // Using the "No" value to load a previous commit
                if (dlg == DialogResult.No && index < li.Items.Count - 1)
                {
                    index++;
                }
            } while (dlg != DialogResult.Cancel);
            li.MultiSelect = multiSel;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Describe (view) selected changelist
 /// </summary>
 private void MenuDescribeClick(object sender, EventArgs e)
 {
     FormShowChangelist.DriveChangelistFromListViewEx(ref listRev);
 }