Ejemplo n.º 1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            string pictures = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);

            foreach (string picture in Directory.GetFiles(pictures, "*.jpg", SearchOption.AllDirectories))
            {
                listBox1.Items.Add(picture);
            }

            try
            {
                _settings             = ImageViewerConfiguration.Load(DEFAULT_CONFIG_PATH);
                listBox1.SelectedItem = _settings.SelectedImagePath;
            }
            catch (FileNotFoundException)
            {
                _settings = new ImageViewerConfiguration();
            }

            saveSettingsToolStripMenuItem.Image = SystemIcons.Shield.ToBitmap();
        }
Ejemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            //TODO: Add a manifest to the executable to run asInvoker

            string pictures = Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);

            foreach (string picture in Directory.GetFiles(pictures, "*.jpg", SearchOption.AllDirectories))
            {
                listBox1.Items.Add(picture);
            }

            try
            {
                _settings             = ImageViewerConfiguration.Load(DEFAULT_CONFIG_PATH);
                listBox1.SelectedItem = _settings.SelectedImagePath;
            }
            catch (FileNotFoundException)
            {
                _settings = new ImageViewerConfiguration();
            }

            //TODO: Add shield icon to saveSettingsToolStripMenuItem
        }