Esempio 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));
        }
Esempio n. 2
0
        public void AcceptLink(Guid processId, LibraryId requestingLibraryId)
        {
            if (LinkedLibraries.Contains(requestingLibraryId))
            {
                return;
            }
            if (!ReceivedLinkRequests.Contains(requestingLibraryId))
            {
                return;
            }

            RaiseEvent(new LinkAccepted(processId, Id, requestingLibraryId.Id));
        }
Esempio n. 3
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));
        }
Esempio n. 4
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));
        }
        private async void AddLinkedLibrary(object param)
        {
            var ofd = new OpenFileDialog();

            ofd.InitialDirectory = Model.CurrentDirectory;

            var result = await ofd.ShowAsync();

            if (result != null && !string.IsNullOrEmpty(result.First()))
            {
                string newInclude = Model.CurrentDirectory.MakeRelativePath(result.First()).ToAvalonPath();

                LinkedLibraries.Add(newInclude);

                UpdateLinkerString();
            }
        }
        private async void AddLinkedLibrary()
        {
            var ofd = new OpenFileDialog();

            ofd.Title = "Add Linked Library";

            ofd.InitialDirectory = Model.CurrentDirectory;

            var result = await ofd.ShowAsync(Application.Current.MainWindow);

            if (result != null && !string.IsNullOrEmpty(result.FirstOrDefault()))
            {
                string newInclude = Model.CurrentDirectory.MakeRelativePath(result.First()).ToAvalonPath();

                LinkedLibraries.Add(newInclude);

                UpdateLinkerString();
            }
        }
 private void RemoveLinkedLibrary(object param)
 {
     LinkedLibraries.Remove(SelectedLinkedLibrary);
     UpdateLinkerString();
 }
Esempio n. 8
0
 protected virtual void When(LinkCompleted @event)
 {
     SentLinkRequests.Remove(new LibraryId(@event.AcceptingLibraryId));
     LinkedLibraries.Add(new LibraryId(@event.AcceptingLibraryId));
 }
Esempio n. 9
0
 protected virtual void When(LinkAccepted @event)
 {
     ReceivedLinkRequests.Remove(new LibraryId(@event.RequestingLibraryId));
     LinkedLibraries.Add(new LibraryId(@event.RequestingLibraryId));
 }