예제 #1
0
        void _selectedIterationsGrid_SelectionChanged(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            //lvWorkItems.Items.Clear();

            foreach (DataGridViewRow row in _selectedIterationsGrid.SelectedRows)
            {
                var val = row.Cells["Path"].Value;
                List <System.Windows.Controls.ListViewItem> wis = new List <System.Windows.Controls.ListViewItem>();

                foreach (var workItem in tfs.GetWorkItemsInIterationPath((string)val))
                {
                    var lvi = TableHelper.GetLviForWi(workItem);
                    wis.Add(lvi);
                }
                lvWorkItems.ItemsSource = wis;
            }
            this.Cursor = Cursors.Default;
        }
예제 #2
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor             = Cursors.WaitCursor;
                splitContainer1.Enabled = false;
                var selections = _selectedIterationsGrid.DataSource as List <IterationSelection>;

                SetIterationsGrid(selections);

                TableHelper.SetTable(selections, _table, tfs);

                _selectedIterationsGrid_SelectionChanged(null, null);
            }
            finally
            {
                splitContainer1.Enabled = true;
                this.Cursor             = Cursors.Default;
            }
        }
예제 #3
0
 private void btnSnapshot_Click(object sender, EventArgs e)
 {
     try
     {
         var fbd = new FolderBrowserDialog();
         fbd.Description = "Select folder to save sprint snapshots";
         //fbd.SelectedPath = System.Environment.SpecialFolder.MyDocuments;
         if (fbd.ShowDialog(this) == DialogResult.OK)
         {
             this.Cursor = Cursors.WaitCursor;
             System.Windows.Forms.Application.DoEvents();
             TableHelper.TakeSnapshot(fbd.SelectedPath);
             System.Windows.Forms.Application.DoEvents();
             this.Cursor = Cursors.Default;
         }
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show("Could not connect : " + ex.Message + System.Environment.NewLine + ex.StackTrace);
     }
 }
예제 #4
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            this.Text = string.Format(this.Text, version.Major + "." + version.Minor + "." + version.Revision);

            var progress = new Progress();

            progress.FormClosed += progress_FormClosed;

            try
            {
                if (ConfigurationManager.AppSettings["TFSUri"] == null)
                {
                    System.Windows.Forms.MessageBox.Show("TFS Uri not set in config file");
                    System.Windows.Forms.Application.Exit();
                }

                int autoRefreshInterval = 300000;
                if (ConfigurationManager.AppSettings["AutoRefreshInterval"] != null)
                {
                    int.TryParse(ConfigurationManager.AppSettings["AutoRefreshInterval"], out autoRefreshInterval);
                }

                timer1.Interval = autoRefreshInterval;

                string tfsUriStr = ConfigurationManager.AppSettings["TFSUri"].ToString();
                if (!Uri.IsWellFormedUriString(tfsUriStr, UriKind.Absolute))
                {
                    System.Windows.Forms.MessageBox.Show("TFS Uri in config file is not valid");
                    System.Windows.Forms.Application.Exit();
                }

                tfs = new Tfs(new Uri(tfsUriStr));
                TableHelper._tfs   = tfs;
                TableHelper._table = _table;
                var picker = new IterationPicker(tfs);
                if (picker.ShowDialog(this) == System.Windows.Forms.DialogResult.OK && picker.SelectedIterations != null)
                {
                    progress.Show(this);

                    System.Windows.Forms.Application.DoEvents();

                    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                    sw.Start();
                    this.Cursor = Cursors.WaitCursor;
                    List <IterationSelection> selections = picker.SelectedIterations;
                    TableHelper.LoadSuccesors = picker.LoadSuccesors;

                    SetIterationsGrid(selections);

                    TableHelper.SetTable(selections, _table, tfs);
                    this.Cursor = Cursors.Default;
                    sw.Stop();
                    var secs = sw.Elapsed.TotalSeconds;
                    System.Diagnostics.Debug.WriteLine(secs);
                }
                else
                {
                    System.Windows.Forms.Application.Exit();
                }

                picker.Dispose();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Could not connect : " + ex.Message + System.Environment.NewLine + ex.StackTrace);
                System.Windows.Forms.Application.Exit();
            }
            finally
            {
                progress.FormClosed -= progress_FormClosed;
                progress.Close();
            }
        }
예제 #5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var progress = new Progress();

            progress.FormClosed += progress_FormClosed;

            try
            {
                if (ConfigurationManager.AppSettings["TFSUri"] == null)
                {
                    System.Windows.Forms.MessageBox.Show("TFS Uri not set in config file");
                    System.Windows.Forms.Application.Exit();
                }

                string tfsUriStr = ConfigurationManager.AppSettings["TFSUri"].ToString();
                if (!Uri.IsWellFormedUriString(tfsUriStr, UriKind.Absolute))
                {
                    System.Windows.Forms.MessageBox.Show("TFS Uri in config file is not valid");
                    System.Windows.Forms.Application.Exit();
                }

                tfs = new Tfs(new Uri(tfsUriStr));
                TableHelper._tfs   = tfs;
                TableHelper._table = _table;
                var picker = new IterationPicker(tfs);
                if (picker.ShowDialog(this) == System.Windows.Forms.DialogResult.OK && picker.SelectedIterations != null)
                {
                    progress.Show(this);

                    System.Windows.Forms.Application.DoEvents();

                    System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
                    sw.Start();
                    this.Cursor = Cursors.WaitCursor;
                    List <IterationSelection> selections = picker.SelectedIterations;

                    SetIterationsGrid(selections);

                    TableHelper.SetTable(selections, _table, tfs);
                    this.Cursor = Cursors.Default;
                    sw.Stop();
                    var secs = sw.Elapsed.TotalSeconds;
                    System.Diagnostics.Debug.WriteLine(secs);
                }
                else
                {
                    System.Windows.Forms.Application.Exit();
                }

                picker.Dispose();
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Could not connect : " + ex.Message + System.Environment.NewLine + ex.StackTrace);
                System.Windows.Forms.Application.Exit();
            }
            finally
            {
                progress.FormClosed -= progress_FormClosed;
                progress.Close();
            }
        }