Ejemplo n.º 1
0
        /** cleanup after the megahistory querier is done doing it's thing.
         */
        private void _worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (treeListView1.InvokeRequired)
            {
                treeListView1.BeginInvoke(new RunWorkerCompletedEventHandler(_worker_RunWorkerCompleted));
            }
            else
            {
                object[] results = e.Result as object[];

                if (e.Error != null)
                {
                }
                else
                {
                    HistoryCollector visitor = results[1] as HistoryCollector;

                    foreach (Revision r in visitor.primaryRevs())
                    {
                        treeListView1.AddObject(r);
                        treeListView1.RefreshObject(r);
                    }
                }

                long delta = (long)results[0];
                // button1.Enabled = true;
                // progressBar1.Style = ProgressBarStyle.Blocks;
                TimeSpan t = new TimeSpan(delta);
                // _time.Text = t.ToString();
            }
        }
Ejemplo n.º 2
0
        /** start the megahistory querier.
         */
        private void _worker_DoWork(object sender, DoWorkEventArgs e)
        {
            long             start_ticks = DateTime.Now.Ticks;
            HistoryCollector visitor     = new HistoryCollector();

            visitor.Worker = _worker;

            /* @TODO if/when i add deleted-item support,
             * i'll need the changeset on the item id?
             */
            VersionSpec ver = VersionSpec.Latest;

            megahistorylib.MegaHistory mh = new megahistorylib.MegaHistory(_tfsServer, _distance);

            mh.Results = visitor;
            mh.query(_item, _maxChanges, null, null, null);

            visitor.fixRevs();
            {
                long end_ticks = DateTime.Now.Ticks;
                e.Result = new object[] { end_ticks - start_ticks, visitor };
            }
        }