상속: System.EventArgs
예제 #1
0
 protected internal void RaiseGeneratingGanttPanelColumn(GanttPanelColumnEventArgs e)
 {
     if (GeneratingGanttPanelColumn != null)
     {
         GeneratingGanttPanelColumn(this, e);
     }
 }
        internal void Invalidate()
        {
            Debug.WriteLine("GanttPanelColumnsPresenter.Invalidate()");
            TimeUnits unit = (ParentPanel.ParentGanttChart.TimespanHeader.RowsPresenter.Children[ParentPanel.ParentGanttChart.TimespanHeader.RowsPresenter.Children.Count - 1] as TimespanHeaderRow).TimeUnit;
            double totalWidth = 0d;
            DateTime date = this.ParentPanel.CurrentTime;
            this.Children.Clear();

            while (totalWidth < this.ActualWidth)
            {

                GanttPanelColumnEventArgs e = new GanttPanelColumnEventArgs()
                {
                    Column = new GanttPanelColumn()
                    {
                         RepresentedDate = date
                    }
                };

                ParentPanel.ParentGanttChart.RaiseGeneratingGanttPanelColumn(e);

                if(!e.Cancel)
                    this.Children.Add(e.Column);

                date = date.AddType(unit, 1);
                double unitWidth = TimeUnitScalar.ConvertToPixels(date, unit);

                totalWidth += unitWidth;
            }
        }
        internal void Invalidate()
        {
            Debug.WriteLine("GanttPanelColumnsPresenter.Invalidate()");
            TimeUnits unit       = (ParentPanel.ParentGanttChart.TimespanHeader.RowsPresenter.Children[ParentPanel.ParentGanttChart.TimespanHeader.RowsPresenter.Children.Count - 1] as TimespanHeaderRow).TimeUnit;
            double    totalWidth = 0d;
            DateTime  date       = this.ParentPanel.CurrentTime;

            this.Children.Clear();

            while (totalWidth < this.ActualWidth)
            {
                GanttPanelColumnEventArgs e = new GanttPanelColumnEventArgs()
                {
                    Column = new GanttPanelColumn()
                    {
                        RepresentedDate = date
                    }
                };

                ParentPanel.ParentGanttChart.RaiseGeneratingGanttPanelColumn(e);

                if (!e.Cancel)
                {
                    this.Children.Add(e.Column);
                }

                date = date.AddType(unit, 1);
                double unitWidth = TimeUnitScalar.ConvertToPixels(date, unit);

                totalWidth += unitWidth;
            }
        }
예제 #4
0
        void gantt_GeneratingGanttPanelColumn(object sender, GanttPanelColumnEventArgs e)
        {
            //bool important = false;

            ////if it's the first of the month, add month separator
            //if (e.Column.RepresentedDate.Day == 1)
            //{
            //    e.Column.BorderThickness = new Thickness(1, 0, 0, 0);
            //    e.Column.BorderBrush = new SolidColorBrush(Colors.Gray);
            //    important = true;
            //}

            ////If weekend, then gray background.
            //if (e.Column.RepresentedDate.DayOfWeek == DayOfWeek.Saturday || e.Column.RepresentedDate.DayOfWeek == DayOfWeek.Sunday)
            //{
            //    e.Column.Background = new SolidColorBrush(Colors.LightGray);
            //    important = true;
            //}

            //if (!important)
            //{
            //    e.Column.Background = new SolidColorBrush(Colors.Transparent);
            //    e.Cancel = true;
            //}
        }
예제 #5
0
 protected internal void RaiseGeneratingGanttPanelColumn(GanttPanelColumnEventArgs e)
 {
     if (GeneratingGanttPanelColumn != null)
         GeneratingGanttPanelColumn(this, e);
 }