Example #1
0
        /// <summary>
        /// Show a window to ask what to do when there is a file conflict
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="source"></param>
        /// <param name="destination"></param>
        /// <param name="buttons"></param>
        /// <returns></returns>
        internal static E_Decision?Ask4_FileConflict2(object sender, EFileResult state, FileArgs fileSrc, FileArgs fileDest)
        {
            fileSrc.Length  = new FileInfo(fileSrc.Path).Length;
            fileDest.Length = new FileInfo(fileDest.Path).Length;

            return(Application.Current.Dispatcher?.Invoke
                   (
                       () =>
            {
                DxTBoxCore.Box_Decisions.MBDecision boxDeciz = new DxTBoxCore.Box_Decisions.MBDecision()
                {
                    Model = new DxTBoxCore.Box_Decisions.M_Decision()
                    {
                        Message = "Overwrite ?",
                        Source = fileSrc.Path,
                        Destination = fileDest.Path,

                        SourceInfo = FileSizeFormatter.Convert(fileSrc.Length),
                        DestInfo = FileSizeFormatter.Convert(fileDest.Length),
                    },
                    Buttons = E_DxConfB.OverWrite | E_DxConfB.Pass | E_DxConfB.Trash,
                };

                if (boxDeciz.ShowDialog() == true)
                {
                    return boxDeciz.Model.Decision;
                }

                return E_Decision.None;
            }
                   ));
        }
Example #2
0
        /// <summary>
        /// Show a window to ask what to do when there is a conflict
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="target"></param>
        /// <param name="buttons"></param>
        /// <returns></returns>
        public static E_Decision?Ask4_DestConflict(string message, string target, string infoSup, E_DxConfB buttons)
        {
            return(Application.Current.Dispatcher?.Invoke
                   (
                       () =>
            {
                DxTBoxCore.Box_Decisions.MBDecision boxDeciz = new DxTBoxCore.Box_Decisions.MBDecision()
                {
                    Model = new DxTBoxCore.Box_Decisions.M_Decision()
                    {
                        Message = message,
                        Destination = target,
                        DestInfo = infoSup,
                    },
                    Buttons = buttons,
                };

                boxDeciz.ShowDialog();

                return boxDeciz.Model.Decision;
            }
                   ));
        }