Exemplo n.º 1
0
        /// <summary>
        /// 转移桌面
        /// </summary>
        private async void TransferDesktop()
        {
            try
            {
                var destFolder = DestFolder;
                if (string.IsNullOrWhiteSpace(destFolder))
                {
                    MessageBox.Show("目录路径不能为空");
                    return;
                }
                var currentDesktopFolder = DesktopFolder;
                if (destFolder == currentDesktopFolder)
                {
                    MessageBox.Show("目录路径与当前桌面路径相同");
                    return;
                }

                //destFolder = Path.Combine(destFolder, "Desktop");
                FolderUtil.EnsureDirectoryExisting(destFolder);
                var canChangeDataPath = await CheckCanChangeDataPath(currentDesktopFolder, destFolder);

                if (canChangeDataPath)
                {
                    MoveCacheWidthBackgroundWorker(currentDesktopFolder, destFolder);
                }
            }
            catch (Exception e)
            {
                LogHelper.Error(e.Message);
                System.Windows.MessageBox.Show(e.Message);
            }
        }