Exemplo n.º 1
0
        public void RegisterPublisherFor <T>(string endpointName)
        {
            if (!publisherDetails.TryGetValue(endpointName, out var publisher))
            {
                publisher = new PublisherDetails(endpointName);

                publisherDetails[endpointName] = publisher;
            }

            publisher.RegisterOwnedEvent <T>();
        }
Exemplo n.º 2
0
        // Details

        private void Details(object sender, EventArgs e)
        {
            if (!CheckForSelectedItem())
            {
                return;
            }

            Hide();
            switch (_option)
            {
            case 1:
                var authorDetails = new AuthorDetails(entitiesListBox.SelectedItem as Author);
                authorDetails.Closed += (s, args) => Show();
                authorDetails.ShowDialog();
                break;

            case 2:
                var publisherDetails = new PublisherDetails(entitiesListBox.SelectedItem as Publisher);
                publisherDetails.Closed += (s, args) => Show();
                publisherDetails.ShowDialog();
                break;

            case 3:
                var studentDetails = new StudentDetails(entitiesListBox.SelectedItem as Student);
                studentDetails.Closed += (s, args) => Show();
                studentDetails.ShowDialog();
                break;

            case 4:
                var bookDetails = new BookDetails(entitiesListBox.SelectedItem as Book);
                bookDetails.Closed += (s, args) => Show();
                bookDetails.ShowDialog();
                break;

            case 5:
                var loanDetails = new LoanDetails(entitiesListBox.SelectedItem as Loan);
                loanDetails.Closed += (s, args) => Show();
                loanDetails.ShowDialog();
                break;

            default:
                CommonErrorMessage();
                break;
            }

            RefreshRepositories();
        }