void OpenFile(string filePath) { if (openFileTask != null) { Tip_Lab.Text = "正在打开文件,请稍后......"; return; } Tip_Lab.Text = "加载文件中......"; DirectoryInfo[] directoryInfos; openFileTask = new Task(() => { unityTools.UnPackage(filePath, DateTime.Now.ToFileTimeUtc().ToString(), SetTip); SetTip("读取文件中......"); directoryInfos = unityTools.GetDirectorys(); menuPackageInfo = unityTools.GetMuneList(directoryInfos, SetTip); SetMenuTreeAsync(menuPackageInfo); SetTip("加载成功"); openFileTask = null; }); openFileTask.Start(); }