public void Execute(string modulesDir, IMHost host, ModuleFinishedHandler callBack) { if (modulesDir == "") throw new Exception("Путь к хранилищу модулей не задан!"); MConnect connect = new MConnect(Path.Combine(modulesDir, this.ModuleName)); IModule module = connect.GetModuleInterface(this.ModuleParams); module.Execute(this.Commands, host); callBack(module); }
public RPrinter(string modulePath, string moduleNameSpace, string moduleClass, string printerName) { _printerName = printerName; if (!Path.IsPathRooted(modulePath)) { modulePath = Path.GetFullPath(modulePath); } _module = new MConnect(modulePath); _printer = _module.GetModuleInterface(); }
private string _queryToModule(string moduleName, string text) { string response = null; string modulesDir = Path.GetDirectoryName(Application.ExecutablePath); MConnect connect = new MConnect(Path.Combine(modulesDir, moduleName)); IModule module = connect.GetModuleInterface(null); response = module.ModuleQuery(text); if (response != null) return response; else return NotFoundMarks.attrs.Begin + text + NotFoundMarks.attrs.End; }
private static bool _queryToModule(string moduleName, string varName, out string value) { string modulesDir = Path.GetDirectoryName(Application.ExecutablePath); MConnect connect = new MConnect(Path.Combine(modulesDir, moduleName)); IModule module = connect.GetModuleInterface(null); return module.QueryValue(varName, false, out value); }