Esempio n. 1
0
        /// <summary>
        /// Handle timer tick event to processed accumulated changes in watched folders
        /// list.
        /// </summary>
        private void timerProcessChanges_Tick(object sender, EventArgs e)
        {
            // only process changes that happened more than x seconds ago to try
            // to handle boundary cases where a change triggers multiple notifications
            // and the timer goes off in between the notifications

            if (comboBoxTemplates.SelectedIndex <= 0)
            {
                this.Invoke(new AppendToLog(doAppendToLog), "Can't protect files until a protection policy is specified\r\n");
                return;
            }

            try
            {
                timerProcessChanges.Enabled = false;
                fileWatchEngine.ProcessWatchedChanges();
            }
            finally
            {
                timerProcessChanges.Enabled = true;
            }
        }