public static void Save(IResourceDataProvider[] nodes, bool useSubDirs, ResourceDataType resourceDataType, Window ownerWindow = null) { if (nodes == null) return; Tuple<ResourceData, string>[] files; try { files = GetFiles(GetResourceData(nodes, resourceDataType), useSubDirs).ToArray(); } catch (Exception ex) { App.MsgBox.Instance.Show(ex); return; } if (files.Length == 0) return; var data = new ProgressVM(Dispatcher.CurrentDispatcher, new ResourceSaver(files)); var win = new ProgressDlg(); win.DataContext = data; win.Owner = ownerWindow ?? Application.Current.MainWindow; win.Title = files.Length == 1 ? dnSpy_Shared_Resources.SaveResource : dnSpy_Shared_Resources.SaveResources; var res = win.ShowDialog(); if (res != true) return; if (!data.WasError) return; App.MsgBox.Instance.Show(string.Format(dnSpy_Shared_Resources.AnErrorOccurred, data.ErrorMessage)); }
public static void Show(IProgressTask task, string title, Window ownerWindow) { var win = new ProgressDlg(); var vm = new ProgressVM(System.Windows.Threading.Dispatcher.CurrentDispatcher, task); win.Owner = ownerWindow; win.DataContext = vm; win.Title = title; win.ShowDialog(); }