Example #1
0
 public void ProcessActionItems(RenamedEventArgs e, FSEventType type)
 {
     foreach(FswatchRuleActionItem actionitem in this.__actionitems)
     {
         actionitem.InvokeAction(e, type);
     }
 }
 /************************************************
 * CONSTRUCTORS
 ************************************************/
 public FswatcherChangeTimeout(Fswatcher CALLER, FileSystemEventArgs ARGS, FSEventType TYPE, int TIMEOUT)
 {
     __caller = CALLER;
     __type = TYPE;
     __fseventargs = ARGS;
     __timer.AutoReset = false;
     __timer.Interval = TIMEOUT;
     __timer.Elapsed += new ElapsedEventHandler(onTimerElapsed);
 }
        public void InvokeAction(FileSystemEventArgs e, FSEventType type)
        {
            if(File.Exists(e.FullPath))
            {
                if(this.__takebackup)
                {

                }
            }
        }
Example #4
0
 public bool ProcessMatchItems(RenamedEventArgs e, FSEventType type)
 {
     foreach(FswatchRuleMatchItem matchitem in this.__matchitems)
     {
         bool result = matchitem.MatchCondition(e, type);
         if(!result)
             return false;
     }
     return true;
 }
 /************************************************
 * METHODS
 ************************************************/
 public bool MatchCondition(Object e, FSEventType type)
 {
     if(this.__context == "filename")
     {
         if(this.__type == "string")
         {
             if(e.Name == this.__value)
                 return true;
             else
                 return false;
         }
         else if(this.__type == "regex")
         {
             Regex regex = new Regex(this.__value);
             if(regex.Match(e.Name).Success)
                 return true;
             else
                 return false;
         }
     }
     else if(this.__context == "filehash")
     {
         if(this.__type == "string")
         {
             return false;
         }
         else if(this.__type == "regex")
         {
             return false;
         }
     }
     else if(this.__context == "filecontent")
     {
         if(this.__type == "string")
         {
             return false;
         }
         else if(this.__type == "regex")
         {
             return false;
         }
     }
     else
     {
         return false;
     }
     return false;
 }
Example #6
0
 internal FileSystemEvent(string fileName, FSEventType eventType, Exception error)
 {
     FileName  = fileName;
     EventType = eventType;
     Error     = error;
 }
 public void InvokeAction(RenamedEventArgs e, FSEventType type)
 {
     //invoke move action
 }
 public void InvokeAction(FileSystemEventArgs e, FSEventType type)
 {
     //invoke move action
 }
Example #9
0
        public void onFileSystemChangeTimeoutElapsed(FswatcherChangeTimeout timeoutwatcher, FileSystemEventArgs e, FSEventType type)
        {
            //call the callback
            try{ __onchangedcallbacks(e, type); } catch(Exception exception){ Console.WriteLine(exception.Message); }

            //remove the change timeout watcher from the list
            __fswatcherchangetimeouts.Remove(timeoutwatcher);
        }