protected static void OnWorkOverwrite(object sender, WorkOverwriteEventArgs e) { IWork work = (sender as IWork); if (GetDefaultOverwriteMode(work.ID) != OverwriteMode.Ask) { e.Overwrite = GetDefaultOverwriteMode(work.ID); } if (work.Aborted) { e.Overwrite = OverwriteMode.KeepOriginal; } if (!GetIsMuted((sender as IWork).ID)) { if (WorkOverwrite != null) { WorkOverwrite(sender, e); if (e.ApplyToAll) { SetDefaultOverwriteMode(work.ID, e.Overwrite); } } } }
protected OverwriteMode AskOverwrite(FileSystemInfoEx srcEntry, FileSystemInfoEx destEntry) { if (ApplyToAll) return DefaultOverwriteMode; if (WorkOverwrite != null) { WorkOverwriteEventArgs e = new WorkOverwriteEventArgs(ID, srcEntry, destEntry, OverwriteMode.Replace, false); WorkOverwrite(this, e); if (e.ApplyToAll) SetDefaultOverwriteMode(e.Overwrite); return e.Overwrite; } return OverwriteMode.Replace; }
protected OverwriteMode AskOverwrite(FileSystemInfoEx srcEntry, FileSystemInfoEx destEntry) { if (ApplyToAll) { return(DefaultOverwriteMode); } if (WorkOverwrite != null) { WorkOverwriteEventArgs e = new WorkOverwriteEventArgs(ID, srcEntry, destEntry, OverwriteMode.Replace, false); WorkOverwrite(this, e); if (e.ApplyToAll) { SetDefaultOverwriteMode(e.Overwrite); } return(e.Overwrite); } return(OverwriteMode.Replace); }
void OnWorkOverwrite(object sender, WorkOverwriteEventArgs e) { e.Overwrite = AskOverwrite(e.SrcEntry, e.DestEntry); e.ApplyToAll = ApplyToAll; }
void WorkSpawner_WorkOverwrite(object sender, WorkOverwriteEventArgs e) { bool overwrite = true; bool applyAll = false; AskOverwriteDialog(e.SrcEntry, e.DestEntry, ref overwrite, ref applyAll); if (overwrite) e.Overwrite = OverwriteMode.Replace; else e.Overwrite = OverwriteMode.KeepOriginal; }
protected static void OnWorkOverwrite(object sender, WorkOverwriteEventArgs e) { IWork work = (sender as IWork); if (GetDefaultOverwriteMode(work.ID) != OverwriteMode.Ask) e.Overwrite = GetDefaultOverwriteMode(work.ID); if (work.Aborted) e.Overwrite = OverwriteMode.KeepOriginal; if (!GetIsMuted((sender as IWork).ID)) if (WorkOverwrite != null) { WorkOverwrite(sender, e); if (e.ApplyToAll) SetDefaultOverwriteMode(work.ID, e.Overwrite); } }