Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 4
0
 protected virtual void When(LinkCompleted @event)
 {
     SentLinkRequests.Remove(new LibraryId(@event.AcceptingLibraryId));
     LinkedLibraries.Add(new LibraryId(@event.AcceptingLibraryId));
 }
Exemplo n.º 5
0
 protected virtual void When(LinkRequested @event)
 {
     SentLinkRequests.Add(new LibraryId(@event.TargetLibraryId));
 }