public void SetHandler(IConvertItem handler, string parent) { if (!handlers.ContainsKey(parent)) { return; } handlers[handler.name] = handler; handler.Setup(this, handlers[parent]); }
private void LoadPlugin(string file) { try { Assembly ass = Assembly.LoadFrom(file); foreach (Type t in ass.GetExportedTypes().Where((t) => t.GetInterface("IConvertModule") != null && !t.IsAbstract)) { IConvertItem module = (IConvertItem)Activator.CreateInstance(t); SetHandler(module); } } catch (BadImageFormatException) { } }
private void Run(IConvertItem file, string filename) { Message("Loading file " + filename); string config = Path.ChangeExtension(filename, ".xml"); file.Process(filename); if (File.Exists(config) && config != filename) { configure.ConvertSection(config, file.name); } }
public void Setup(ConverterMgr _mgr, IConvertItem _parent) { }
public void Setup(ConverterMgr _mgr, IConvertItem _parent) { mgr = _mgr; parent = (Parent)_parent; }
public void SetHandler(IConvertItem handler, IConvertItem parent = null) { handlers[handler.name] = handler; handler.Setup(this, parent); }
public void Setup(ConverterMgr _mgr, IConvertItem _parent) { mgr = _mgr; mgr.SetModuleFactory("rotator", () => new RotatorModule()); }
public void Setup(ConverterMgr _mgr, IConvertItem _parent) { mgr = _mgr; Setup(); }
public void Setup(ConverterMgr mgr, IConvertItem parent) { mgr.SetModuleFactory("control", () => new ControlModule()); }