Exemplo n.º 1
0
        private void cmdImportSeriesColors_Click(object sender, EventArgs e)
        {
            try
            {
                OpenFileDialog fd = new OpenFileDialog();
                fd.DefaultExt = "xml";
                fd.Title      = "Specify import file path";
                fd.Filter     = "xml files|*.xml";
                if (fd.ShowDialog() == DialogResult.OK)
                {
                    string importXMLContent = System.IO.File.ReadAllText(fd.FileName, Encoding.UTF8);
                    HenIT.Windows.Controls.Graphing.GraphSettings importedSettings = (HenIT.Windows.Controls.Graphing.GraphSettings)Serializer.DeserializeXML(importXMLContent, typeof(HenIT.Windows.Controls.Graphing.GraphSettings));

                    GraphSettings = importedSettings;
                    LoadControls();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Error importing setings\r\nDetails: {ex.ToString()}", "Import", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 2
0
 public void InitializeGraphSettings()
 {
     GraphSettings = new HenIT.Windows.Controls.Graphing.GraphSettings();
     GraphSettings.SeriesColors = new List <string>();
 }