void Monitor_CustomRenamed(object sender, CustomRenamedEventArgs e) { string details = String.Format("Old: {0} New: {1}", e.OldFullPath, e.FullPath); le = new LogEntry(Logfile.FullName, (uint)LogEntryIDs.FileRename, details, machine, user); System.Diagnostics.Debug.WriteLine(details); }
void FileSystemMonitor_Renamed(object sender, RenamedEventArgs e) { //System.Diagnostics.Debug.WriteLine("-=== CORE ===-\r\n" + e.FullPath + " renamed from " + e.OldFullPath); CustomRenamedEventArgs mye = new CustomRenamedEventArgs(e.ChangeType, e.OldFullPath.Substring(0, e.OldFullPath.IndexOf("\\")), e.Name, e.OldName); if (FSMRenamed != null && mye.PassExtensionFilter() && !mye.IsFileSystem()) { FSMRenamed(this, mye); return; } FileInfo oldfi = new FileInfo(e.OldFullPath); FileInfo newfi = new FileInfo(e.FullPath); //if ((oldfi.Extension == ".tmp" || oldfi.Name.Contains("__rar_"))&& FSMModified != null) //{ CreatedDeletedModifiedEventArgs mye2 = new CreatedDeletedModifiedEventArgs(WatcherChangeTypes.Changed, newfi.Directory.FullName, e.Name.Substring(e.Name.LastIndexOf("\\"))); if (mye2.PassExtensionFilter()) { FSMModified(sender, mye2); return; } //} }