private void SpawnServiceView() { ServiceManagerView serviceView = new ServiceManagerView(); AddInformation(serviceView); new ServiceManagerPresenter(serviceView); serviceView.Show(); }
public ServiceManagerPresenter(ServiceManagerView view) { view.AddButton.Click += AddHandler; view.DeleteButton.Click += DeleteHandeler; _serviceList = view.ListView; coordinator = CoordinatorManager.Instance.CoordinatorOfType <IServiceCoordinator>(); if (coordinator == null) { throw new InvalidOperationException("Il coordinatore dei servizi non è disponibile"); } if (view.RetrieveTagInformation <AuthorizationLevel>("authorizationLevel") < AuthorizationLevel.BASIC_STAFF) { view.ActionPanel.Enabled = false; view.ActionPanel.Visible = false; } _services = coordinator.Services; coordinator.ServiceChanged += ServiceChangedHandler; // Popolo la list view all'avvio ServiceChangedHandler(this, EventArgs.Empty); }