protected static void ProcessTestament(IEnumerable<string> books, Dictionary<string, string> codeNames, XsltArgumentList xsltArgs, StreamWriter sw, IInProcess inProcess) { foreach (string book in books) { if (codeNames.ContainsKey(book)) { LogStatus("Processing {0}", codeNames[book]); Transform(codeNames[book], xsltArgs, sw); inProcess.PerformStep(); } else { LogStatus("Creating empty {0}", book); var tempName = TempName(book); Transform(tempName, xsltArgs, sw); File.Delete(tempName); } } }
protected void ProcessAllBooks(string fullName, bool otFlag, IEnumerable<string> otBooks, IEnumerable<string> ntBooks, Dictionary<string, string> codeNames, XsltArgumentList xsltArgs, IInProcess inProcess) { LogStatus("Creating MySword: {0}", Path.GetFileName(fullName)); // false = do not append but overwrite instead var sw = new StreamWriter(fullName, false, new UTF8Encoding(true)); if (otFlag) { ProcessTestament(otBooks, codeNames, xsltArgs, sw, inProcess); } ProcessTestament(ntBooks, codeNames, xsltArgs, sw, inProcess); AttachMetadata(sw); sw.Close(); }