Example #1
0
        public void CompleteLink(Guid processId, LibraryId acceptingLibraryId)
        {
            if (LinkedLibraries.Contains(acceptingLibraryId))
            {
                return;
            }
            if (!SentLinkRequests.Contains(acceptingLibraryId))
            {
                return;
            }

            RaiseEvent(new LinkCompleted(processId, Id, acceptingLibraryId.Id));
        }
Example #2
0
        public void ReceiveLinkRequest(Guid processId, LibraryId sourceLibraryId)
        {
            if (ReceivedLinkRequests.Contains(sourceLibraryId))
            {
                return;
            }
            if (SentLinkRequests.Contains(sourceLibraryId))
            {
                return;
            }
            if (LinkedLibraries.Contains(sourceLibraryId))
            {
                return;
            }

            RaiseEvent(new LinkRequestReceived(processId, Id, sourceLibraryId.Id));
        }
Example #3
0
        public void RequestLink(Guid processId, LibraryId desinationLibraryId)
        {
            if (SentLinkRequests.Contains(desinationLibraryId))
            {
                return;
            }
            if (ReceivedLinkRequests.Contains(desinationLibraryId))
            {
                return;
            }
            if (LinkedLibraries.Contains(desinationLibraryId))
            {
                return;
            }

            RaiseEvent(new LinkRequested(processId, Id, desinationLibraryId.Id));
        }
Example #4
0
 protected virtual void When(LinkCompleted @event)
 {
     SentLinkRequests.Remove(new LibraryId(@event.AcceptingLibraryId));
     LinkedLibraries.Add(new LibraryId(@event.AcceptingLibraryId));
 }
Example #5
0
 protected virtual void When(LinkRequested @event)
 {
     SentLinkRequests.Add(new LibraryId(@event.TargetLibraryId));
 }