private CAPlugin LocatePlugin() { // -nogui -plugin CRASH_ANALYSIS -input d:\ca_fullsummary.xml CAPlugin ret = null; // string[] args = iEngine.CommandLineArguments; for (int i = 0; i < args.Length; i++) { string cmd = args[i].Trim().ToUpper(); string nextArg = (i < args.Length - 1 ? args[i + 1].Trim().ToUpper() : string.Empty); // try { if (cmd == KParamPlugin && nextArg != string.Empty) { ret = LocatePluginByName(nextArg); break; } } catch (Exception) { } } // return(ret); }
private CAPlugin LocatePluginByName(string aName) { CAPlugin ret = null; // foreach (CAPlugin plugin in iEngine) { bool isHandler = plugin.IsCommandLineHandler(aName); if (isHandler) { ret = plugin; break; } } // return(ret); }
public int Run() { iLog.TraceAlways("[CmdExe] Run() - START"); int error = CAPlugin.KErrCommandLineNone; // CAPlugin plugin = LocatePlugin(); iLog.TraceAlways("[CmdExe] Run() - plugin: " + plugin); if (plugin != null) { iLog.TraceAlways("[CmdExe] Run() - executing plugin command line operations..."); error = plugin.RunCommandLineOperations(); } else { iLog.TraceAlways("[CmdExe] Run() - plugin not found!"); error = CAPlugin.KErrCommandLinePluginNotFound; } // iLog.TraceAlways("[CmdExe] Run() - END - error: " + error); return(error); }