Ejemplo n.º 1
0
 public void Register(IGrainID observerUnit)
 {
     if (!unitDict.TryAdd(observerUnit.GrainType, observerUnit))
     {
         throw new ObserverUnitRepeatedException(observerUnit.GrainType.FullName);
     }
 }
Ejemplo n.º 2
0
 public void Register(IGrainID followUnit)
 {
     if (!unitDict.TryAdd(followUnit.GrainType, followUnit))
     {
         throw new RepeatedFollowUnitException(followUnit.GrainType.FullName);
     }
 }
Ejemplo n.º 3
0
 public void Register <PrimaryKey>(string observerName, IGrainID observerUnit)
 {
     if (unitDict.TryGetValue(observerName, out List <object> units))
     {
         units.Add(observerUnit);
     }
     if (!unitDict.TryAdd(observerName, new List <object> {
         observerUnit
     }))
     {
         throw new ObserverUnitRepeatedException(observerUnit.EventHandlerType.FullName);
     }
 }