private void fileSystemWatcher_Changed(object sender, System.IO.FileSystemEventArgs e) { System.IO.WatcherChangeTypes w = e.ChangeType; System.Windows.Forms.DialogResult dr = System.Windows.Forms.MessageBox.Show("The timer database has been changed. Would you like to reload it?", "Reload", System.Windows.Forms.MessageBoxButtons.YesNo); if (dr == System.Windows.Forms.DialogResult.Yes) { Reload(); } }
FileSystemChange( System.IO.WatcherChangeTypes changeType, FileSystemPath oldPath, FileSystemPath newPath ) { ChangeType = changeType; OldPath = oldPath; NewPath = newPath; }
public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout) { switch (_platform) { case Platform.Mono: return(_monoFsw.WaitForChanged(changeType, timeout)); case Platform.OSX: return(_osxFsw.WaitForChanged(changeType, timeout)); default: throw new NotImplementedException(); } }
private void RecordEntry(string filePath, System.IO.WatcherChangeTypes evntChanging) { string path = Assembly.GetExecutingAssembly().Location; string pathToLog = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), System.IO.Path.GetFileNameWithoutExtension(path) + ".log"); lock (obj) { string message = $"{DateTime.Now.ToString("yyyy.MM.dd|hh:mm:ss")}|{evntChanging}|{filePath}"; EvntInfoMessage?.Invoke(this, new TextEventArgs(message)); using (System.IO.StreamWriter writer = new System.IO.StreamWriter(pathToLog, true)) { writer.WriteLine(message); writer.Flush(); } } }
public static bool _WaitForChanged_System_IO_FileSystemWatcher_System_IO_WatcherChangeTypes_System_Int32( ) { //Parameters System.IO.WatcherChangeTypes changeType = null; System.Int32 timeout = null; //ReturnType/Value System.IO.WaitForChangedResult returnVal_Real = null; System.IO.WaitForChangedResult returnVal_Intercepted = null; //Exception Exception exception_Real = null; Exception exception_Intercepted = null; InterceptionMaintenance.disableInterception( ); try { returnValue_Real = System.IO.FileSystemWatcher.WaitForChanged(changeType, timeout); } catch (Exception e) { exception_Real = e; } InterceptionMaintenance.enableInterception( ); try { returnValue_Intercepted = System.IO.FileSystemWatcher.WaitForChanged(changeType, timeout); } catch (Exception e) { exception_Intercepted = e; } Return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted)); }
public FileSystemEventArgs(System.IO.WatcherChangeTypes changeType, string directory, string name) { }
public RenamedEventArgs(System.IO.WatcherChangeTypes changeType, string directory, string name, string oldName) : base(default(System.IO.WatcherChangeTypes), default(string), default(string)) { }
public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout) { return(default(System.IO.WaitForChangedResult)); }
public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout) { throw null; }
/// <summary> /// A synchronous method that returns a structure that contains specific information on the change /// that occurred, given the type of change you want to monitor. /// </summary> /// <returns> /// A <see cref="T:System.IO.WaitForChangedResult"/> that contains specific information on the /// change that occurred. /// </returns> /// <param name="changeType">The <see cref="T:System.IO.WatcherChangeTypes"/> to watch for.</param> /// <filterpriority>2</filterpriority> public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType) { return(inner.WaitForChanged(changeType)); }
public NotifyFilesystemEvent(string affectedFullPath, string affectedName, System.IO.WatcherChangeTypes changeType) { this.AffectedFullPath = affectedFullPath; this.AffectedName = affectedName; this.ChangeType = changeType; }