public void Remove(CRUDControllerIdentifier key) { if (Contains(key)) { innerList.RemoveAt(IndexOf(key)); } }
public void Add(CRUDControllerIdentifier key, AbstractCRUDController crudController) { if (!Contains(key)) { innerList.Add(new CRUDControllerListEntry(key, crudController)); } }
public override bool Equals(object obj) { if (obj is CRUDControllerIdentifier) { CRUDControllerIdentifier aux = (CRUDControllerIdentifier)obj; return((businessLogicType == aux.businessLogicType) && (crudFormType == aux.crudFormType) && (gridTitle == aux.gridTitle) && (crudFormTitle == aux.crudFormTitle)); } else { return(false); } }
public int IndexOf(CRUDControllerIdentifier key) { int result = -1; for (int i = 0; (i < innerList.Count) && (result < 0); i++) { if (((CRUDControllerListEntry)innerList[i]).Key.Equals(key)) { result = i; } } return(result); }
public AbstractCRUDController this[CRUDControllerIdentifier key] { get { AbstractCRUDController result = null; for (int i = 0; (i < innerList.Count) && (result == null); i++) { if (((CRUDControllerListEntry)innerList[i]).Key.Equals(key)) { result = ((CRUDControllerListEntry)innerList[i]).Value; } } return(result); } }
public void UnloadCRUDController(AbstractCRUDController crudController) { CRUDControllerIdentifier key = null; if (crudController is CRUDController) { key = new CRUDControllerIdentifier(crudController as CRUDController); } else { key = new CRUDControllerIdentifier(crudController); } if (crudControllerList.Contains(key)) { crudControllerList.Remove(key); } crudController.Dispose(); }
public CRUDController GetCRUDController(DBase db, Type businessLogicType, Type crudFormType, string gridTitle, string crudFormTitle, bool repeatCreate) { CRUDController result = null; CRUDControllerIdentifier key = new CRUDControllerIdentifier(businessLogicType, crudFormType, gridTitle, crudFormTitle); if (!crudControllerList.Contains(key)) { BusinessLogic businessLogic = BusinessLogicFactory.GetBusinessLogicInstance(db, businessLogicType); result = new CRUDController(businessLogic, gridTitle, crudFormTitle, crudFormType, repeatCreate); childControllerManager.SetChildControllers(result); crudControllerList.Add(key, result); } else { result = (CRUDController)crudControllerList[key]; } return(result); }
public CRUDOnlineController GetCRUDController(DBase db, Type businessLogicType, string gridTitle) { CRUDOnlineController result = null; CRUDControllerIdentifier key = new CRUDControllerIdentifier(businessLogicType, typeof(GridOnLineForm), gridTitle); if (!crudControllerList.Contains(key)) { BusinessLogic businessLogic = BusinessLogicFactory.GetBusinessLogicInstance(db, businessLogicType); result = new CRUDOnlineController(businessLogic, gridTitle); crudControllerList.Add(key, result); } else { result = (CRUDOnlineController)crudControllerList[key]; } return(result); }
public CRUDControllerListEntry(CRUDControllerIdentifier key, AbstractCRUDController value) { this.key = key; this.value = value; }
public bool Contains(CRUDControllerIdentifier key) { return(innerList.Contains(new CRUDControllerListEntry(key, null as AbstractCRUDController))); }