/// <summary> /// Build new empty project in database /// </summary> /// <param name="configFiles"></param> public WizardSchema(ConfigFilesCollection configFiles, bool fromImport = false) { InitializeComponent(); _configFiles = configFiles; _fromImport = fromImport; cmbType.SelectedIndex = 0; txtSchema.Enabled = !fromImport; }
/// <summary> /// Copie tabloid engine files /// on update (maj=true) /// on first save (forceKeepConfig=true) /// on click on publish (maj=false, forcekeepConfig=false) /// </summary> /// <param name="config"></param> /// <param name="maj"></param> /// <param name="forceKeepConfig"></param> public static void publication(ConfigFilesCollection config, IWin32Window own, bool maj = false, bool forceKeepConfig = false) { var cfg = new publishConfig(); if (maj) { //use path from config file var path = config.ConfigFiles[0].ConfigFilePath; cfg.DestinationPath = path.Substring(0, path.IndexOf("config", StringComparison.OrdinalIgnoreCase)); } else { var fbd = new FolderBrowserDialog(); DialogResult result = fbd.ShowDialog(); if (result != DialogResult.OK) { return; } cfg.DestinationPath = fbd.SelectedPath; } string[] files = Directory.GetFiles(cfg.DestinationPath); cfg.KeepWebConfig = forceKeepConfig; if (!forceKeepConfig && (files.Length > 0 || Directory.GetDirectories(cfg.DestinationPath).Length > 0)) { var majFrm = new maj(cfg.DestinationPath); if (majFrm.ShowDialog() == DialogResult.OK) { if (majFrm.chkSAV.Checked) { makeZipSite(cfg.DestinationPath, own); } cfg.KeepOpenJs = majFrm.chkOpenJs.Checked; cfg.KeepUpload = majFrm.chkUpload.Checked; cfg.KeepWebConfig = majFrm.chkWebConfig.Checked; cfg.KeepImages = majFrm.chkImg.Checked; } else { return; } } Tools.publication(config, cfg, own); }
/// <summary> /// Open edit setting form and set default config files values /// </summary> /// <param name="configFiles">Config files to edit</param> public static void EditSetting(ConfigFilesCollection configFiles) { var sf = new SettingForm(false); var temp = Program.AppSet; sf.propertyGrid1.SelectedObject = temp; sf.ShowDialog(); if (sf.DialogResult == DialogResult.OK) { Program.AppSet = temp; InitNewConfigMenu(); foreach (XmlFile.ConfigFilesTypes ft in Enum.GetValues(typeof(XmlFile.ConfigFilesTypes))) { configFiles.ConfigFiles[(int)ft] = new XmlFile("sources/" + ft + ".config", ft); //get generic .config } } }
/// <summary> /// Copy tabloid engine to selected path /// </summary> /// <param name="destinationPath">destination path</param> static void publication(ConfigFilesCollection config, publishConfig cfg, IWin32Window own) { //var wf = new WaitingForm(wrPublication); //wf.sho(); //Thread.Sleep(2000); try { var _wf = new WaitingForm(wrPublication) { Text = Properties.Resources.Publishing, progressBar = { Style = ProgressBarStyle.Marquee } }; _wf.Wr.RunWorkerAsync(new object[] { config, cfg, own }); _wf.ShowDialog(); } catch (Exception ex) { MetroMessageBox.Show(own, Properties.Resources.SavingError + ex, Properties.Resources.Erreur, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public WizardFilter(ConfigFilesCollection configFiles) { InitializeComponent(); _configFiles = configFiles; }