public PacketManagerPresenter(PacketManagerView view)
        {
            #region Precondizioni
            if (view == null)
            {
                throw new ArgumentNullException("view null");
            }
            #endregion
            view.AddButton.Click += AddHandler;

            if (view.RetrieveTagInformation <AuthorizationLevel>("authorizationLevel") < AuthorizationLevel.BASIC_STAFF)
            {
                view.ActionPanel.Enabled = false;
                view.ActionPanel.Visible = false;
            }

            _packetList = view.ListView;
            coordinator = CoordinatorManager.Instance.CoordinatorOfType <IServiceCoordinator>();
            if (coordinator == null)
            {
                throw new InvalidOperationException("Il coordinatore dei paccheti non è disponibile");
            }

            _packets = coordinator.Packets;
            coordinator.ServiceChanged += ServiceChangedHandler;
            // Popolo la list view all'avvio
            ServiceChangedHandler(this, EventArgs.Empty);
        }
Beispiel #2
0
        private void SpawnPacketView()
        {
            PacketManagerView packetView = new PacketManagerView();

            AddInformation(packetView);
            new PacketManagerPresenter(packetView);
            packetView.Show();
        }