Example #1
0
        //source is the is "source" of the event - in this case it is the timer
        //well, the source should be whatever object invoked the event,
        //which in this case seems to some Timer,
        private void OnChanged(object source, FileSystemEventArgs dave)
        {//eventhandler
            WatcherChangeTypes wct      = dave.ChangeType;
            string             fullpath = dave.FullPath;
            string             m        = fullpath + " " + wct.ToString();

            MessageBox.Show(fullpath + " was " + wct.ToString(), "File was " + wct.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
            changes.Add(m);
            lbxShowChanges.DataSource = null;
            lbxShowChanges.DataSource = changes;
            lblUpdateChange.Visible   = true;
            lblUpdateChange.Text      = m;
            ch++;
            Changes c = new Changes();

            mydel        = new Del(WriteChange);
            c.Full       = fullpath;
            c.Changetype = wct.ToString();
            mydel(c);
        }
Example #2
0
        //eventhandler
        private void OnRenamed(object source, RenamedEventArgs rick)
        {
            WatcherChangeTypes wct      = rick.ChangeType;
            string             fullpath = rick.FullPath;
            string             oldpath  = rick.OldFullPath;
            string             m        = oldpath + " " + fullpath + " " + wct.ToString();

            MessageBox.Show(oldpath + " was " + wct.ToString() + " to " + fullpath, "File was " + wct.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information);
            changes.Add(m);
            lbxShowChanges.DataSource = null;
            lbxShowChanges.DataSource = changes;
            lblUpdateChange.Visible   = true;
            lblUpdateChange.Text      = m;
            ch++;
            Changes c = new Changes();

            mydel        = new Del(WriteChange);
            c.Full       = fullpath;
            c.Changetype = wct.ToString();
            mydel(c);
        }
Example #3
0
 public void WriteChange(Changes c)
 {
     fh.WriterRename(c);
 }