Exemplo n.º 1
0
 public MainDataContexts(DataConsumers consumers = DataConsumers.AccountingEquipment_V2)
 {
     AccEquipmentV2Entities = new AccEquipment_V2Entities(); // { Database = { Log = Console.WriteLine } };
     NumEquipmentEntities = new Num_equipmentEntities();
     switch (consumers)
     {
         case DataConsumers.AccountingEquipment_V2:
             _customersDependencyChangeHandler = new DependencyChangeHandler(NumEquipmentEntities, NumEquipmentEntities.Customers);
             _customersDependencyChangeHandler.OnRefreshEntityEvent += () => RefreshSideLinkInfos(true);
             _accEquipmentV2EntitiesDependencyChangeHandler = new DependencyChangeHandler(AccEquipmentV2Entities,
                 new List<DbSet> {AccEquipmentV2Entities.Equipments, AccEquipmentV2Entities.EquipmentPorts});
             break;
         case DataConsumers.Events_V2:
             
             break;
         default:
             throw new ArgumentOutOfRangeException("consumers");
     }
 }
Exemplo n.º 2
0
 public void RemoveEventsDependencyHandler(DependencyChangeHandler.RefreshEntityEventHandler handler)
 {
     _eventsDependencyChangeHandler.OnRefreshEntityEvent -= handler;
 }
Exemplo n.º 3
0
 public void SetEventsDependencyHandler(DependencyChangeHandler.RefreshEntityEventHandler handler)
 {
     if (_eventsDependencyChangeHandler==null)
         _eventsDependencyChangeHandler = new DependencyChangeHandler(AccEquipmentV2Entities, AccEquipmentV2Entities.Events);
     _eventsDependencyChangeHandler.OnRefreshEntityEvent += handler;
 }
Exemplo n.º 4
0
 public void RemoveAdvDependencyHandler(DependencyChangeHandler.RefreshEntityEventHandler handler)
 {
     _accEquipmentV2EntitiesDependencyChangeHandler.OnRefreshEntityEvent -= handler;
 }