示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            //USBBackup usb = new USBBackup(Program.CURRENT_DIR);
            string[] array = new string[ignoreListBox.Items.Count];
            for (int i = 0; i < ignoreListBox.Items.Count; i++)
            {
                array[i] = (string)ignoreListBox.Items[i];
            }
            Console.WriteLine("IgnoredFolders is now: " + array);
            USBProfile p = usb.CreateProfile(deviceIDTextBox.Text, profileNameTextBox.Text, destinationRootTextBox.Text + "\\", array, new string[] { });

            this.Hide();
            this.Dispose();
            mw.PopulateListBox();
            usbl.AddUSBProfile(p);
        }
示例#2
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit);
            AttachConsole(ATTACH_PARENT_PROCESS);
            //USBBackup usb = new USBBackup(CURRENT_DIR);
            //foreach(SettingsFile p in usb.GetProfiles().Values)
            //{

            //}
            //USBListener usbl = new USBListener();
            //HashSet<string> temp = new HashSet<string>() { "#DB","Microsoft VS Code","MySQL","PrintScreen", "BscCompSci\\Year2\\DBDesignImplementation\\XAMPP" };
            //HashSet<string> temp2 = new HashSet<string>() {".png",".txt" };
            //usbl.Copy("C:\\Users\\Shaun\\Desktop\\test\\", "E:\\", temp,temp2);
            CURRENT_DIR = Path.GetDirectoryName(CURRENT_DIR);
            Log.WriteLine(CURRENT_DIR);

            USBBackup   usbBackup   = new USBBackup(CURRENT_DIR);
            USBListener usbListener = new USBListener();

            foreach (USBProfile p in usbBackup.GetActualProfiles())
            {
                usbListener.AddUSBProfile(p);
            }


            Application.EnableVisualStyles();
            MainWindow mw = new MainWindow(usbBackup, usbListener);

            Application.Run(mw);

            if (mw.meta.GetKeyBool("startMinimized", false))
            {
                mw.Hide();
            }

            //Log.Dump();
            Console.ReadLine();
        }