public bool Break(IContractPointer <T> contract)
            {
                if (this.set_.Remove(contract))
                {
                    (contract as ContractPointerOwnerImpl <T> .ContractPointerImpl) !
                    .BreakWith(this);
                    return(true);
                }

                return(false);
            }
Example #2
0
                public bool Add(IContractPointer <IEventSubscription> contract)
                {
                    if (this.contracts_.Add(contract))
                    {
                        var genericEventType = contract.Value.EventType;
                        this.sets_.Add(genericEventType, contract);
                        return(true);
                    }

                    return(false);
                }
Example #3
0
                public bool Remove(IContractPointer <IEventSubscription> contract)
                {
                    var genericEventType = contract.Value.EventType;

                    if (this.sets_.Remove(genericEventType, contract))
                    {
                        if ((this.sets_.TryGet(genericEventType)?.Count ?? 0) == 0)
                        {
                            this.contracts_.Remove(contract);
                        }
                        return(true);
                    }

                    return(false);
                }