Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Global
- {
- public const string ArgsDocument = @"-d:";
- public const string ArgsReport = @"-r:";
- public const string ArgsDoc2xPath = @"-conv:";
- public const string ArgsDebug = @"-Debug";
- public const string ArgsOutput = @"-o:";
- }
- public static bool LoadCommandLineParams(string[] pArgs)
- {
- try
- {
- if (pArgs.Length == 0)
- {
- Console.Out.WriteLine("{0} version: {1}",
- System.Reflection.Assembly.GetExecutingAssembly().GetName().Name,
- System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
- Console.Out.WriteLine("Keys:");
- Console.Out.WriteLine("\t" + Global.ArgsDebug + "\t" + "Enables debug mode");
- Console.Out.WriteLine("\t" + Global.ArgsDocument + "\t" + "Path to document");
- Console.Out.WriteLine("\t" + Global.ArgsReport + "\t" + "Path to ESign report for document");
- Console.Out.WriteLine("\t" + Global.ArgsDoc2xPath + "\t" + "Path to Doc2x.exe.");
- Console.Out.WriteLine("\t" + Global.ArgsOutput + "\t" + "Path to result file.");
- return false;
- }
- foreach (string vRes in pArgs)
- {
- if (vRes.StartsWith(Global.ArgsDocument))
- {
- Global.InDocument = vRes.Substring(Global.ArgsDocument.Length);
- continue;
- }
- if (vRes.StartsWith(Global.ArgsReport))
- {
- Global.InReport = vRes.Substring(Global.ArgsReport.Length);
- continue;
- }
- if (vRes.StartsWith(Global.ArgsDoc2xPath))
- {
- Global.Doc2xPath = vRes.Substring(Global.ArgsDoc2xPath.Length);
- continue;
- }
- if (vRes.StartsWith(Global.ArgsOutput))
- {
- Global.OutResult = vRes.Substring(Global.ArgsOutput.Length);
- continue;
- }
- if (vRes.StartsWith(Global.ArgsDebug))
- {
- Global.DebugMode = true;
- //continue;
- }
- }
- return true;
- }
- catch (Exception)
- {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement