/// <summary> /// Auto-create one or more EPUBs from the command-line /// </summary> private void CommandLineCreate() { int i = 1; List<String> fileNames = new List<String>(); frmBlindSave blind = new frmBlindSave(); blind.Show(); Application.DoEvents(); quietOperation = true; foreach (String item in autoFileNames) { blind.NumFiles = autoFileNames.Count; blind.Info = String.Format("({0} of {1}) - Processing {2}", i, autoFileNames.Count, Path.GetFileName(item)); blind.UpdateInfo(); tbxFileName.Text = item; LoadFile(); Setup(); fileNames.Add(AutoCreateEpub()); i++; blind.UpdateProgress(); } // Ask to add the EPUB to the ATOM library file if (MessageBox.Show("Add all items to Library?", "Add items?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { ListBox lstImages = new ListBox(); foreach (String item in fileNames) { Program.ReadEpub(item, lstImages); String subFolder = Path.GetDirectoryName(item); subFolder = subFolder.Substring(ConfigurationManager.AppSettings["BaseDir"].Length); Program.AddToLibrary(item, lstImages, subFolder, false); } MessageBox.Show("ePub(s) added to Library."); } blind.Close(); blind.Dispose(); }
/// <summary> /// Clean one or more HTML files called from the command-line /// </summary> private void CommandLineClean() { int i = 1; frmBlindSave blind = new frmBlindSave(); blind.Show(); Application.DoEvents(); quietOperation = true; foreach (String item in autoFileNames) { blind.NumFiles = autoFileNames.Count; blind.Info = String.Format("({0} of {1}) - Processing {2}", i, autoFileNames.Count, Path.GetFileName(item)); blind.UpdateInfo(); HtmlTidy(item, item); blind.UpdateProgress(); } blind.Close(); blind.Dispose(); }