public void ErrorWindowShow(string ti, string me) { //er = new ErrorWindow(ti, me); //StartCloseTimer(); // er.Show(); App.Current.Dispatcher.Invoke((Action)(() => { if (!AIThermometerAPP.Instance().is_error_window_show) { ErrorWindow er = new ErrorWindow(ti, me, true);// "错误", "当前版本暂时只支持一个设备"); AIThermometerAPP.Instance().is_error_window_show = true; er.Show(); } })); }
private void CopyDirectory(object paths) { string desPath = (paths as List <string>)[(paths as List <string>).Count - 1]; for (int i = 0; i < (paths as List <string>).Count; i++) { string srcPath = (paths as List <string>)[i]; string folderName = srcPath.Substring(srcPath.LastIndexOf("\\") + 1); string desfolderdir = desPath + "\\" + folderName; if (srcPath.LastIndexOf("\\") == (desPath.Length - 1)) { desfolderdir = desPath + folderName; } string[] filenames = Directory.GetFileSystemEntries(srcPath); foreach (string file in filenames) { if (Directory.Exists(file)) { string currentdir = desfolderdir + "\\" + file.Substring(file.LastIndexOf("\\") + 1); if (!Directory.Exists(currentdir)) { Directory.CreateDirectory(currentdir); } Common.CopyDirectory(file, desfolderdir); } else { string srcfileName = file.Substring(file.LastIndexOf("\\") + 1); srcfileName = desfolderdir + "\\" + srcfileName; if (!Directory.Exists(desfolderdir)) { Directory.CreateDirectory(desfolderdir); } File.Copy(file, srcfileName); } } } Dispatcher.BeginInvoke(new Action(delegate { ErrorWindow ew = new ErrorWindow(Application.Current.FindResource("updateText1").ToString(), Application.Current.FindResource("updateText2").ToString()); ew.Show(); })); }