예제 #1
0
 /// <summary>
 /// Set up the hidden form.
 /// </summary>
 /// <param name="detector">DriveDetector object which will receive notification about USB drives, see WndProc</param>
 public DetectorForm(DriveDetector detector)
 {
     mDetector            = detector;
     this.MinimizeBox     = false;
     this.MaximizeBox     = false;
     this.ShowInTaskbar   = false;
     this.ShowIcon        = false;
     this.FormBorderStyle = FormBorderStyle.None;
     this.Load           += new System.EventHandler(this.Load_Form);
     this.Activated      += new EventHandler(this.Form_Activated);
 }
예제 #2
0
        public ImportFromUSBForm()
        {
            InitializeComponent();
            button_cancel.Text = LanguageTranslation.CANCEL;
            label.Text         = LanguageTranslation.INSERT_USB_DRIVE;

            ImportType  = ImportType.User;
            USBDetector = new DriveDetector();
            USBDetector.ProgramStarted = true;
            USBDetector.DeviceArrived += new DriveDetectorEventHandler(USBDetector_DeviceArrived);
            USBDetector.DeviceRemoved += new DriveDetectorEventHandler(USBDetector_DeviceRemoved);
            FileChooser                 = new OpenFileDialog();
            FileChooser.FileOk         += new CancelEventHandler(FileChooser_FileOk);
            FileChooser.DefaultExt      = ".xml";
            FileChooser.Title           = LanguageTranslation.CHOOSE_IMPORT_FILE;
            FileChooser.Filter          = "Data Files(*.XLS;*.XLSX;*.CSV)|*.XLS;*.XLSX;*.CSV|All files (*.*)|*.*";
            FileChooser.CheckFileExists = true;
            FileChooser.CheckPathExists = true;
            Arrived = false;
        }