public static bool CreateLogFile(Document doc, MassTool selectedTool) { try { massTool = selectedTool; bool directoryFound = FindLogDirectory(doc); if (directoryFound) { logFullName = Path.Combine(logDirectory, logFileName); if (File.Exists(logFullName)) { ReadLogFile(logFullName); } else { try { FileStream fs = File.Create(logFullName); fs.Close(); } catch { return(false); } } return(true); } else { return(false); } } catch (Exception ex) { string message = ex.Message; return(false); } }
private static string FindSurfix(MassTool toolType) { string surfix = ""; switch (toolType) { case MassTool.MassCreate: surfix = "_MassCreate.log"; break; case MassTool.UpdateData: surfix = "_UpdateData.log"; break; case MassTool.MassCommands: surfix = "_MassCommands.log"; break; } return(surfix); }