Ejemplo n.º 1
0
        private void Unregister(IDispatchee dispatchee)
        {
            dispatchee.ThrowIfNull(nameof(dispatchee));
            dispatchee.UniqueId.ThrowIfEmpty(nameof(dispatchee.UniqueId));

            _uniquelyNamedDispatchees.Remove(dispatchee.UniqueId);
        }
Ejemplo n.º 2
0
        internal string Register(IDispatchee dispatchee)
        {
            dispatchee.ThrowIfNull(nameof(dispatchee));

            var uniqueId = dispatchee.UniqueId.IsNullOrEmpty() ? GenerateUniqueId(dispatchee) : dispatchee.UniqueId;

            EnsureToUnregisterExistingDispatchee(dispatchee, uniqueId);

            _uniquelyNamedDispatchees[uniqueId] = dispatchee;

            return uniqueId;
        }