コード例 #1
0
        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);
                    }
                }
            }
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 void OnWorkOverwrite(object sender, WorkOverwriteEventArgs e)
 {
     e.Overwrite  = AskOverwrite(e.SrcEntry, e.DestEntry);
     e.ApplyToAll = ApplyToAll;
 }
コード例 #5
0
ファイル: App.xaml.cs プロジェクト: Choi-Insu/arrengers
 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;
 }
コード例 #6
0
        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);
                }
        }
コード例 #7
0
 void OnWorkOverwrite(object sender, WorkOverwriteEventArgs e)
 {
     e.Overwrite = AskOverwrite(e.SrcEntry, e.DestEntry);
     e.ApplyToAll = ApplyToAll;
 }