Esempio n. 1
0
        public Form1(String path)
        {
            InitializeComponent();

            folders = new Dictionary <string, string>();
            folders.Add("left_click", "Move23");
            folders.Add("right_click", "Move01");
            folders.Add("middle_click", "tass");
            folders.Add("delete", "Delete");

            keys = new Dictionary <string, char>();
            keys.Add("left_click", '=');
            keys.Add("right_click", '-');
            keys.Add("middle_click", '\\');
            keys.Add("delete", '`');

            if (Directory.Exists(path))
            {
                Properties.Settings.Default.folderPath = path;
            }

            if (!(Directory.Exists(Properties.Settings.Default.folderPath)))
            {
                Properties.Settings.Default.folderPath = "C:\\";
            }

            folderPath      = Properties.Settings.Default.folderPath;
            imageFolderPath = folderPath;

            pbl = new List <PictureBox>();
            pbl.Add(pictureBox1);
            pbl.Add(pictureBox2);
            pbl.Add(pictureBox3);
            pbl.Add(pictureBox4);

            // Create the list of extensions
            ext = new List <string> {
                "*.jpg", "*.jpeg", "*.gif", "*.png", "*.bmp"
            };

            // Set Search Option to search all directories
            so = SearchOption.TopDirectoryOnly;

            FS = new FullScreen(ref pictureBox1, this);
            S  = new Settings(ref folders, ref keys);

            if (Directory.Exists(folderPath))
            {
                openFolder();
            }
        }
Esempio n. 2
0
        public Form1(string path)
        {
            InitializeComponent();

            foreach (var drive in DriveInfo.GetDrives())
            {
                fileToolStripMenuItem.DropDownItems.Add(drive.Name, null, ChangeDrive);
            }

            folders = new Dictionary <string, string>();
            folders.Add("left_click", Properties.Settings.Default.left_click);
            folders.Add("right_click", Properties.Settings.Default.right_click);
            folders.Add("middle_click", Properties.Settings.Default.middle_click);
            folders.Add("delete", Properties.Settings.Default.delete);

            keys = new Dictionary <string, char>();
            keys.Add("left_click", '=');
            keys.Add("right_click", '-');
            keys.Add("middle_click", '\\');
            keys.Add("delete", '`');

            if (path != null && Directory.Exists(path))
            {
                Properties.Settings.Default.folderPath = path;
            }

            folderPath = Properties.Settings.Default.folderPath;

            if (!(Directory.Exists(Properties.Settings.Default.folderPath)))
            {
                Properties.Settings.Default.folderPath = "C:\\";
            }

            imageFolderPath = folderPath;

            pictureBox1.ImageLocation     = "";
            pictureBox2.ImageLocation     = "";
            pictureBox2.Tag               = false;
            toolStripStatusLabel1.Text    = "";
            toolStripStatusLabel2.Text    = @"0/0";
            toolStripProgressBar1.Maximum = 100;
            toolStripProgressBar1.Value   = 100;

            backgroundWorker1                            = new BackgroundWorker();
            backgroundWorker1.DoWork                    += backgroundWorker1_DoWork;
            backgroundWorker1.RunWorkerCompleted        += backgroundWorker1_RunWorkerCompleted; //Tell the user how the process went
            backgroundWorker1.WorkerSupportsCancellation = true;

            pictureBox2.LoadCompleted += PictureBox2_LoadCompleted;

            // Create the list of extensions
            ext = new List <string> {
                "*.jpg", "*.jpeg", "*.gif", "*.png", "*.bmp"
            };

            // Set Search Option to search all directories
            so = SearchOption.TopDirectoryOnly;

            FS = new FullScreen(ref pictureBox1, ref pictureBox2, this);
            S  = new Settings(ref folders, ref keys);
            hs = new HotkeySettings();

            hs.hotkeys[Keys.D1] = "1♥";
            hs.hotkeys[Keys.D1 | Keys.Control] = "1♥-";
            hs.hotkeys[Keys.D1 | Keys.Alt]     = "1♥+";
            hs.hotkeys[Keys.D2] = "2♥";
            hs.hotkeys[Keys.D2 | Keys.Control] = "2♥-";
            hs.hotkeys[Keys.D2 | Keys.Alt]     = "2♥+";
            hs.hotkeys[Keys.D3] = "3♥";
            hs.hotkeys[Keys.D3 | Keys.Control] = "3♥-";
            hs.hotkeys[Keys.D3 | Keys.Alt]     = "3♥+";
            hs.hotkeys[Keys.D4] = "4♥";
            hs.hotkeys[Keys.D4 | Keys.Control] = "4♥-";
            hs.hotkeys[Keys.D4 | Keys.Alt]     = "4♥+";
            hs.hotkeys[Keys.D5] = "5♥";
            hs.hotkeys[Keys.D5 | Keys.Control] = "5♥-";
            hs.hotkeys[Keys.D5 | Keys.Alt]     = "5♥+";
            hs.hotkeys[Keys.L]        = "Special";
            hs.hotkeys[Keys.Oemtilde] = "Delete";
            hs.hotkeys[Keys.F1]       = "Bondage (1-3♥)";
            hs.hotkeys[Keys.F2]       = "Bondage (4-5♥)";

            if (Directory.Exists(folderPath))
            {
                openFolder();
                fileToolStripMenuItem.DropDownItems.OfType <ToolStripMenuItem>().FirstOrDefault(o => o.Text.Equals(folderPath.Substring(0, 3))).Checked = true;
            }

            focus();
        }