private void RaiseCompletedEvent(string path) { FileCompletedEventArgs args = new FileCompletedEventArgs(); args.FileName = path; OnFileCompleted(args); }
/// <summary> /// Event will be raised when a file is done reading. /// The event args will contain the filename. /// </summary> /// <param name="e">Event args</param> protected virtual void OnFileCompleted(FileCompletedEventArgs e) { EventHandler <FileCompletedEventArgs> handler = FileCompleted; if (handler != null) { handler(this, e); } }
static void mfs_FileCompleted(object sender, FileCompletedEventArgs e) { string path = basePath + "\\TestApp\\TestMessages\\Done"; FileInfo fi = new FileInfo(e.FileName); fi.MoveTo(path + "\\" + fi.Name); Console.WriteLine("File '{0}' moved.", fi.Name); }
/// <summary> /// Event will be raised when a file is done reading. /// The event args will contain the filename. /// </summary> /// <param name="e">Event args</param> protected virtual void OnFileCompleted(FileCompletedEventArgs e) { EventHandler<FileCompletedEventArgs> handler = FileCompleted; if (handler != null) { handler(this, e); } }