Example #1
0
        private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string file = saveFileDialog1.FileName;

                ColorListFile clf = new ColorListFile(file);
                clf.Save(colorList1.Colors);
                savedList = true;
            }
        }
Example #2
0
        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string file = openFileDialog1.FileName;

                ColorListFile       clf    = new ColorListFile(file);
                IEnumerable <Color> colors = clf.Load();

                colorList1.Colors.Clear();
                colorList1.Colors.AddRange(colors);
                colorList1.Refresh();
            }
        }
Example #3
0
        public Form1()
        {
            InitializeComponent();

            selectedColor    = Color.White;
            panel1.BackColor = selectedColor;

            colorList1.ColorSelected += new ColorList.ColorEventHandler(colorList1_ColorSelected);
            defaultList = Path.Combine(Application.ExecutablePath, "MyColors.list");

            if (File.Exists(defaultList))
            {
                ColorListFile       clf    = new ColorListFile(defaultList);
                IEnumerable <Color> colors = clf.Load();

                colorList1.Colors.AddRange(colors);
                colorList1.Refresh();
            }
        }
Example #4
0
        public void SaveColorList()
        {
            ColorListFile clf = new ColorListFile(defaultList);

            clf.Save(colorList1.Colors);
        }