Ejemplo n.º 1
0
        public ConfigForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            this.config = ConfigManager.getConfig();

            txtSpUrl.DataBindings.Add("Text", config, "sharepointUrl");
            txtUser.DataBindings.Add("Text", config, "username");
            txtPasswd.DataBindings.Add("Text", config, "password");
            txtDomain.DataBindings.Add("Text", config, "domain");
            txtFolderIn.DataBindings.Add("Text", config, "watchPath");
        }
Ejemplo n.º 2
0
        public void StartWatcher()
        {
            QuickScanStartupArgs args = new QuickScanStartupArgs();

            try {
                this.config      = ConfigManager.getConfig();
                watcher          = new FileSystemWatcher();
                watcher.Path     = config.watchPath;
                watcher.Filter   = "*.*"; //watch for any file and filter at the event
                watcher.Created += new FileSystemEventHandler(OnFileCreated);
                // Begin watching.
                watcher.EnableRaisingEvents = true;
            }
            catch (Exception ex) {
                watcher.EnableRaisingEvents = false;
                args.Success = false;
                args.Message = "Starting the file system watcher failed : " + ex.Message;
                OnQuickScanStartup(args);
            }
        }