/// <summary> /// Registers the specified UI element. /// </summary> /// <param name="uiElement">The UI element.</param> public void Register(object uiElement) { IPrintHandler handler = FactoryCatalog.GetFactory(uiElement).GetAdapter(uiElement); handlers.Add(uiElement, handler); Register(handler); }
public void Register(object dataList) { IDataListView handler = FactoryCatalog.GetFactory(dataList).GetAdapter(dataList); views.Add(dataList, handler); Register(handler); }
public void TestMethod1() { FactoryCatalog catalog = new FactoryCatalog(); catalog.Bind<IBoat, SailBoat>(); // catalog.Bind<IBoat, SailBoat>().Singleton.Builder(b => b.AuxiliaryMotor = false); // catalog.Bind<ICar, SportCar>().Builder(c => c.MaxRotations = 8000); // ICar car = catalog.CreateInstance<ICar>(); IBoat boat = catalog.CreateInstance<IBoat>(); }
/// <summary> /// 注册文档处理组件 /// </summary> /// <param name="uiElement">文档处理UI组件.</param> public void Register(object uiElement) { IDocumentHandler handler = FactoryCatalog.GetFactory(uiElement).GetAdapter(uiElement); if (handler != null) { handlers.Add(uiElement, handler); Register(handler); } }
static void Main(string[] args) { FactoryCatalog catalog = new FactoryCatalog(); catalog.Bind<IBoat, SailBoat>().Singleton. Builder(b => b.AuxiliaryMotor = false); catalog.Bind<ICar, SportCar>().Builder(c => c.MaxRotations = 8000); ICar car = catalog.CreateInstance<ICar>(); IBoat boat = catalog.CreateInstance<IBoat>(); car.Show(); boat.Show(); }
/// <summary> /// Registers a site for the given UI element by asking the adapter factory to /// automatically allocate an adapter based on the element type. /// </summary> /// <param name="siteName">The site name to register.</param> /// <param name="uiElement">The UI element.</param> public void RegisterSite(string siteName, object uiElement) { Guard.ArgumentNotNullOrEmptyString(siteName, "siteName"); Guard.ArgumentNotNull(uiElement, "uiElement"); IUIElementAdapterFactory factory = FactoryCatalog.GetFactory(uiElement); IUIElementAdapter adapter = factory.GetAdapter(uiElement); createdAdapters.Add(adapter); RegisterSite(siteName, adapter); }
public List <Catalogo> ConsultaCatalog() { try { return(FactoryCatalog.GetList((DbDataReader)base._ProviderDB.GetDataReader("spGet_MostrarCatTemp", new DbParameter[] { }))); } catch (Exception ex) { throw ex; } }
static void Main(string[] args) { FactoryCatalog catalog = new FactoryCatalog(); catalog.Bind <IBoat, SailBoat>().Singleton. Builder(b => b.AuxiliaryMotor = false); catalog.Bind <ICar, SportCar>().Builder(c => c.MaxRotations = 8000); ICar car = catalog.CreateInstance <ICar>(); IBoat boat = catalog.CreateInstance <IBoat>(); car.Show(); boat.Show(); }
//Muestra los datos que se almacenaron en la tabla catalogo temporal realizando busqueda por idmapa y llproceso public List <Catalogo> muestraCatalogoTem(Catalogo muestra) { try { return(FactoryCatalog.GetList((DbDataReader)base._ProviderDB.GetDataReader("spGet_MostrarCatTemp", new DbParameter[] { DataFactory.GetObjParameter(GlobalConfiguration.ProviderDB, "@Id_mapa", DbType.String, muestra.Id_mapa), DataFactory.GetObjParameter(GlobalConfiguration.ProviderDB, "@llproceso", DbType.String, muestra.llproceso) }))); } catch (Exception ex) { throw ex; } }
//Muestra los datos que se almacenaron en la tabla catalogo temporal realizando busqueda por idmapa y llproceso public List <Catalogo> ConsultaCatalogoByProcesoMapa(int llproceso, int llmapa) { try { return(FactoryCatalog.GetList((DbDataReader)base._ProviderDB.GetDataReader("spGetCatalogoByProcesoMapa", new DbParameter[] { DataFactory.GetObjParameter(GlobalConfiguration.ProviderDB, "@llmapa", DbType.String, llmapa), DataFactory.GetObjParameter(GlobalConfiguration.ProviderDB, "@llproceso", DbType.String, llproceso) }))); } catch (Exception ex) { throw ex; } }