Пример #1
0
 public void Add(CRUDControllerIdentifier key, AbstractCRUDController crudController)
 {
     if (!Contains(key))
     {
         innerList.Add(new CRUDControllerListEntry(key, crudController));
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
        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();
        }
Пример #4
0
 public CRUDControllerListEntry(CRUDControllerIdentifier key, AbstractCRUDController value)
 {
     this.key   = key;
     this.value = value;
 }
Пример #5
0
 public CRUDControllerIdentifier(AbstractCRUDController controller) : this(controller.BusinessLogic.GetType(), controller.CRUDFormType, controller.CRUDFormTitle)
 {
 }