Пример #1
0
        public ImpactControl()
        {
            impact_loader = new ImpactLoader();
            impact_loader.RespectMailmap = true; // respect the .mailmap file
            impact_loader.Updated += OnImpactUpdate;

            Clear();

            InitializeComponent();
            Translate();

            // Set DoubleBuffer flag for flicker-free drawing
            this.SetStyle(ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);

            MouseWheel += ImpactControl_MouseWheel;
        }
Пример #2
0
        public ImpactControl()
        {
            impact_loader = new ImpactLoader();
            impact_loader.Updated += new ImpactLoader.UpdateEventHandler(OnImpactUpdate);

            authors = new Dictionary<string, ImpactLoader.DataPoint>();
            impact = new SortedDictionary<DateTime, Dictionary<string, ImpactLoader.DataPoint>>();

            author_stack = new List<string>();
            paths = new Dictionary<string, GraphicsPath>();
            brushes = new Dictionary<string, SolidBrush>();
            line_labels = new Dictionary<string,List<Tuple<PointF, int>>>();
            week_labels = new List<Tuple<PointF,DateTime>>();

            InitializeComponent();

            // Set DoubleBuffer flag for flicker-free drawing
            this.SetStyle(ControlStyles.AllPaintingInWmPaint |
                ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);

            MouseWheel += new MouseEventHandler(ImpactControl_MouseWheel);
        }
Пример #3
0
        void OnImpactUpdate(ImpactLoader.Commit commit)
        {
            lock (data_lock)
            {
                // UPDATE IMPACT

                // If week does not exist yet in the impact dictionary
                if (!impact.ContainsKey(commit.week))
                    // Create it
                    impact.Add(commit.week, new Dictionary<string, ImpactLoader.DataPoint>());

                // If author does not exist yet for this week in the impact dictionary
                if (!impact[commit.week].ContainsKey(commit.author))
                    // Create it
                    impact[commit.week].Add(commit.author, commit.data);
                else
                    // Otherwise just add the changes
                    impact[commit.week][commit.author] += commit.data;

                // UPDATE AUTHORS

                // If author does not exist yet in the authors dictionary
                if (!authors.ContainsKey(commit.author))
                    // Create it
                    authors.Add(commit.author, commit.data);
                else
                    // Otherwise just add the changes
                    authors[commit.author] += commit.data;

                // Add authors to intermediate weeks where they didn't create commits
                ImpactLoader.AddIntermediateEmptyWeeks(ref impact, authors);

                // UPDATE AUTHORSTACK

                // If author does not exist yet in the author_stack
                if (!author_stack.Contains(commit.author))
                    // Add it to the front (drawn first)
                    author_stack.Insert(0, commit.author);
            }

            UpdatePathsAndLabels();
            Invalidate();
        }
Пример #4
0
 public void Init(IGitModule Module)
 {
     impact_loader = new ImpactLoader(Module);
     impact_loader.RespectMailmap = true; // respect the .mailmap file
     impact_loader.Updated += OnImpactUpdate;
 }
Пример #5
0
 public void Stop()
 {
     if (impact_loader != null)
     {
         impact_loader.Dispose();
         impact_loader = null;
     }
 }