Beispiel #1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            NewChartColorTemplateDialog colorTemplateDialog = new NewChartColorTemplateDialog();

            if (colorTemplateDialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            ChartColorTemplate template = new ChartColorTemplate(colorTemplateDialog.TemplateName);

            foreach (KeyValuePair <string, Color> keyValuePair in Global.ChartManager.ColorTemplates.DefaultTemplate.Settings)
            {
                template.Settings.Add(keyValuePair.Key, keyValuePair.Value);
            }
            Global.ChartManager.ColorTemplates.AddTemplate(colorTemplateDialog.TemplateName, template);
            ChartColorTemplateViewItem templateViewItem = new ChartColorTemplateViewItem(template);

            this.ltvTemplates.Items.Add((ListViewItem)templateViewItem);
            templateViewItem.Selected = true;
        }
Beispiel #2
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     NewChartColorTemplateDialog colorTemplateDialog = new NewChartColorTemplateDialog();
     if (colorTemplateDialog.ShowDialog() != DialogResult.OK)
         return;
     ChartColorTemplate template = new ChartColorTemplate(colorTemplateDialog.TemplateName);
     foreach (KeyValuePair<string, Color> keyValuePair in Global.ChartManager.ColorTemplates.DefaultTemplate.Settings)
         template.Settings.Add(keyValuePair.Key, keyValuePair.Value);
     Global.ChartManager.ColorTemplates.AddTemplate(colorTemplateDialog.TemplateName, template);
     ChartColorTemplateViewItem templateViewItem = new ChartColorTemplateViewItem(template);
     this.ltvTemplates.Items.Add((ListViewItem)templateViewItem);
     templateViewItem.Selected = true;
 }