public VuGenZipExportDialog(IVuGenScript script, ZipExportDialogSettings settings) : base(settings) { _script = script; _customControl = new ZipScriptCustomControl(); _customControlViewModel = new ZipScriptCustomControlViewModel(_script); _customControl.DataContext = _customControlViewModel; _customControlViewModel.ExportAllFiles = true; SetUserControl(_customControl); }
public static ZipExportDialogSettings GetDefaultExportToZipSettings(IVuGenScript script) { ZipExportDialogSettings settings = new ZipExportDialogSettings(); settings.DialogTitle = "Export to zip"; settings.ExportItemLabel = "Script folder:"; settings.ExportAction = ExportActionEnum.Zip; settings.AllowSwitchExportAction = false; settings.DefaultExportItemPath = script.LocalPath; settings.IsExportItemReadOnly = true; settings.CompressionLevel = Ionic.Zlib.CompressionLevel.BestSpeed; settings.DefaultExportToPath = Path.Combine(Path.GetDirectoryName(script.LocalPath), script.DisplayName + ".zip"); return settings; }
public static ZipExportDialogSettings GetDefaultExportToZipSettings(IVuGenScript script) { ZipExportDialogSettings settings = new ZipExportDialogSettings(); settings.DialogTitle = "Export to zip"; settings.ExportItemLabel = "Script folder:"; settings.ExportAction = ExportActionEnum.Zip; settings.AllowSwitchExportAction = false; settings.DefaultExportItemPath = script.LocalPath; settings.IsExportItemReadOnly = true; settings.CompressionLevel = Ionic.Zlib.CompressionLevel.BestSpeed; settings.DefaultExportToPath = Path.Combine(Path.GetDirectoryName(script.LocalPath), script.DisplayName + ".zip"); return(settings); }
public override void Run() { IVuGenScript script = VuGenServiceManager.GetService <IVuGenProjectService>().GetActiveScript(); if (script == null) { UttDialogMessageService.Instance.ShowWarning("Export to Zip operation is available for the currently loaded script only"); } else { ZipExportDialogSettings settings = GetDefaultExportToZipSettings(script); using (VuGenZipExportDialog dialog = new VuGenZipExportDialog(script, settings)) { if (dialog.ShowDialog() == CustomDialogResult.Ok) { Process.Start("explorer.exe", "/select," + dialog.ExportZipFile); } } } }