示例#1
0
        public DirSyncroForm()
        {
            InitializeComponent();
            ssc = new SyncServiceClient();

            config = Utility.ReadFromXML <DirSyncro.DirSyncro>(configurationFile);

            watcherGrid.Rows.Add(config.Watcher.Length);
            for (int i = 0; i < config.Watcher.Length; i++)
            {
                watcherGrid.Rows[i].Cells["enabled"].Value = new DataGridViewImageCell();
                watcherGrid.Rows[i].Cells["watcher"].Value = new DataGridViewTextBoxCell();
            }
            for (int i = 0; i < config.Watcher.Length; i++)
            {
                if (config.Watcher[i].Enabled)
                {
                    watcherGrid.Rows[i].Cells["enabled"].Tag   = true;
                    watcherGrid.Rows[i].Cells["enabled"].Value = Resources.On;
                }
                else
                {
                    watcherGrid.Rows[i].Cells["enabled"].Tag   = false;
                    watcherGrid.Rows[i].Cells["enabled"].Value = Resources.Off;
                }
                watcherGrid.Rows[i].Cells["watcher"].Value = config.Watcher[i].Name;
                watcherGrid.Rows[i].Tag = i;
            }
        }
示例#2
0
        public void StartWatchers()
        {
            if (!watchersUp)
            {
                DirSyncro config = Utility.ReadFromXML <DirSyncro>(configurationFile);

                watchers = new List <Watcher>(config.Watcher.Length);

                foreach (DirSyncroWatcher c in config.Watcher)
                {
                    watchers.Add(new Watcher(c));
                    Debug.WriteLine("DEBUG: Startup directory watchers.");
                }

                watchersUp = true;
            }
        }