public void Read(string filename) { try { dict.Clear(); var lines = File.ReadAllLines(filename); foreach (var item in lines) { var tokens = item.Split(','); var c = Color.FromArgb(Convert.ToInt32(tokens[1])); int width = Convert.ToInt32(tokens[2]); var s = new SeriesSettings(c, width); dict.Add(tokens[0], s); } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); File.Delete(filename); } }
public void Add(string label, Color c, int width = 1) { SeriesSettings s = new SeriesSettings(c, width); dict.Add(label, s); }