Beispiel #1
0
        public void AddEventToContract(ContractDefinition contract, EventDefinition eventDef)
        {
            if (!ContractToEventsMap.ContainsKey(contract))
            {
                ContractToEventsMap[contract] = new HashSet <EventDefinition>();
            }

            Debug.Assert(!ContractToEventsMap[contract].Contains(eventDef), $"Duplicated event definition: {eventDef.Name}");
            ContractToEventsMap[contract].Add(eventDef);

            Debug.Assert(!EventToContractMap.ContainsKey(eventDef), $"Duplicated event: {eventDef.Name}");
            EventToContractMap[eventDef] = contract;
        }
Beispiel #2
0
 public ContractDefinition GetContractByEvent(EventDefinition eventDef)
 {
     Debug.Assert(EventToContractMap.ContainsKey(eventDef));
     return(EventToContractMap[eventDef]);
 }