コード例 #1
0
        public void MoveItemDownButton_Click(object sender, EventArgs e)
        {
            var item = ScheduleChartView.SelectedItem;

            if (item == null)
            {
                return;
            }
            ScheduleChartView.MoveItemDown(item);
        }
コード例 #2
0
        public void DeleteItemButton_Click(object sender, EventArgs e)
        {
            var item = ScheduleChartView.SelectedItem;

            if (item == null)
            {
                return;
            }
            ScheduleChartView.RemoveItem(item);
        }
コード例 #3
0
        public void SetCustomBarColorToItemButton_Click(object sender, EventArgs e)
        {
            var resource = ScheduleChartView.SelectedItem;

            if (resource == null)
            {
                return;
            }
            foreach (GanttChartItem item in resource.GanttChartItems)
            {
                item.BarStroke = Color.Green;
                item.BarFill   = Color.YellowGreen;
            }
            ScheduleChartView.ScrollTo(resource);
        }
コード例 #4
0
 private void ExportImageButton_Click(object sender, RoutedEventArgs e)
 {
     ScheduleChartView.Export((Action) delegate
     {
         SaveFileDialog saveFileDialog = new SaveFileDialog {
             Title = "Export Image To", Filter = "PNG image files|*.png"
         };
         if (saveFileDialog.ShowDialog() != true)
         {
             return;
         }
         BitmapSource bitmapSource = ScheduleChartView.GetExportBitmapSource(96 * 2);
         using (Stream stream = saveFileDialog.OpenFile())
         {
             PngBitmapEncoder pngBitmapEncoder = new PngBitmapEncoder();
             pngBitmapEncoder.Frames.Add(BitmapFrame.Create(bitmapSource));
             pngBitmapEncoder.Save(stream);
         }
     });
 }
コード例 #5
0
        // Define user command methods.
        public void AddNewItemButton_Click(object sender, EventArgs e)
        {
            var item = new ScheduleChartItem
            {
                Content         = "New resource",
                GanttChartItems = new List <GanttChartItem>
                {
                    new GanttChartItem {
                        Content = "Task X (New resource)", Start = new DateTime(year, month, 2, 8, 0, 0), Finish = new DateTime(year, month, 5, 16, 0, 0)
                    },
                    new GanttChartItem {
                        Content = "Task Y (New resource)", Start = new DateTime(year, month, 7, 8, 0, 0), Finish = new DateTime(year, month, 8, 16, 0, 0)
                    }
                }
            };

            ScheduleChartView.AddItem(item);
            ScheduleChartView.SelectedItem = item;
            ScheduleChartView.ScrollTo(item);
            ScheduleChartView.ScrollTo(new DateTime(year, month, 1));
        }
コード例 #6
0
 public void PrintImageButton_Click(object sender, ImageClickEventArgs e)
 {
     // Print the task hierarchy column and a selected timeline page of 5 weeks (timeline end week extensions would be added automatically, if necessary).
     // Optionally, to rotate the print output and simulate Landscape printing mode (when the end user keeps Portrait selection in the Print dialog), append the rotate parameter set to true to the method call: rotate: true.
     ScheduleChartView.Print(title: "Schedule Chart (printable)", isGridVisible: true, columnIndexes: new[] { 1 }, timelineStart: new DateTime(year, month, 1), timelineFinish: new DateTime(year, month, 1).AddDays(5 * 7), preparingMessage: "...");
 }
コード例 #7
0
 public void DecreaseTimelinePageButton_Click(object sender, EventArgs e)
 {
     ScheduleChartView.DecreaseTimelinePage(TimeSpan.FromDays(4 * 7)); // 4 weeks
 }
コード例 #8
0
 private void PrintButton_Click(object sender, RoutedEventArgs e)
 {
     ScheduleChartView.Print("ScheduleChartView Sample Document");
 }