Example #1
0
        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);
        }
Example #2
0
        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();
        }
Example #3
0
        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;
        }
Example #4
0
        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);
        }