Inheritance: System.Windows.Forms.UserControl
コード例 #1
0
        public void PlaylistsPanelLoad_ShouldCreateOneAssociationControlPerAvailablePlaylist()
        {
            List <Playlist> playlists = BuildListOfDummyPlaylists(2);
            ModelRepository model     = new ModelRepository();

            model.Add("devices", new DeviceCollection());

            MockMediaSoftwareService mockMediaSoftwareService = new MockMediaSoftwareService();

            mockMediaSoftwareService.SetPlaylists(playlists);

            PlaylistsPanel playlistsPanel = new PlaylistsPanel();

            playlistsPanel.MediaSoftwareService = mockMediaSoftwareService;
            playlistsPanel.Model = model;

            playlistsPanel.PlaylistsPanel_Load(this, null);

            int numberOfAssociationControlsCreated = 0;

            foreach (Control panelControl in playlistsPanel.FlowPlaylistAssociations.Controls)
            {
                Console.WriteLine(String.Format("Control type: {0}", panelControl.GetType().ToString()));
                if (panelControl is PlaylistAssociationControl)
                {
                    numberOfAssociationControlsCreated++;
                }
            }

            Assert.AreEqual(playlists.Count(), numberOfAssociationControlsCreated);
        }
コード例 #2
0
ファイル: PlaylistsPanelTest.cs プロジェクト: notpod/Notpod
        public void PlaylistsPanelLoad_ShouldCreateOneAssociationControlPerAvailablePlaylist()
        {
            List<Playlist> playlists = BuildListOfDummyPlaylists(2);
            ModelRepository model = new ModelRepository();
            model.Add("devices", new DeviceCollection());

            MockMediaSoftwareService mockMediaSoftwareService = new MockMediaSoftwareService();
            mockMediaSoftwareService.SetPlaylists(playlists);

            PlaylistsPanel playlistsPanel = new PlaylistsPanel();
            playlistsPanel.MediaSoftwareService = mockMediaSoftwareService;
            playlistsPanel.Model = model;

            playlistsPanel.PlaylistsPanel_Load(this, null);

            int numberOfAssociationControlsCreated = 0;
            foreach (Control panelControl in playlistsPanel.FlowPlaylistAssociations.Controls)
            {
                Console.WriteLine(String.Format("Control type: {0}", panelControl.GetType().ToString()));
                if (panelControl is PlaylistAssociationControl)
                {
                    numberOfAssociationControlsCreated++;
                }
            }

            Assert.AreEqual(playlists.Count(), numberOfAssociationControlsCreated);
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: pipipierre/Notpod
        private void InitializePanels()
        {
            HomePanel homePanel = new HomePanel();

            homePanel.MediaSoftwareServices = mediaSoftwareServices;
            panels.Add("home", homePanel);

            DevicesPanel devicesPanel = new DevicesPanel();

            devicesPanel.Model = modelRepository;
            devicesPanel.PortableDevicesService  = portableDevicesService;
            devicesPanel.SupportedDevicesManager = supportedDevicesManager;
            devicesPanel.MainForm = this;
            panels.Add("devices", devicesPanel);


            DefaultNewPlaylistAssociationFormFactory newPlaylistAssociationFormFactory = new DefaultNewPlaylistAssociationFormFactory();

            newPlaylistAssociationFormFactory.ModelRepository = modelRepository;

            PlaylistsPanel playlistsPanel = new PlaylistsPanel();

            playlistsPanel.MediaSoftwareService = mediaSoftwareServices[ITunesServiceImpl.SERVICE_NAME];
            playlistsPanel.Model    = modelRepository;
            playlistsPanel.MainForm = this;
            panels.Add("playlists", playlistsPanel);

            AssociationManagementPanel associationsPanel = new AssociationManagementPanel();

            associationsPanel.MainForm             = this;
            associationsPanel.MediaSoftwareService = mediaSoftwareServices[ITunesServiceImpl.SERVICE_NAME];
            associationsPanel.DevicesManager       = supportedDevicesManager;
            associationsPanel.Model = modelRepository;
            panels.Add("associations", associationsPanel);

            panels.Add("preferences", new PreferencesPanel());

            SetCommonPanelProperties();
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: notpod/Notpod
        private void InitializePanels()
        {
            HomePanel homePanel = new HomePanel();
            homePanel.MediaSoftwareServices = mediaSoftwareServices;
            panels.Add("home", homePanel);

            DevicesPanel devicesPanel = new DevicesPanel();
            devicesPanel.Model = modelRepository;
            devicesPanel.PortableDevicesService = portableDevicesService;
            devicesPanel.SupportedDevicesManager = supportedDevicesManager;
            devicesPanel.MainForm = this;
            panels.Add("devices", devicesPanel);

            DefaultNewPlaylistAssociationFormFactory newPlaylistAssociationFormFactory = new DefaultNewPlaylistAssociationFormFactory();
            newPlaylistAssociationFormFactory.ModelRepository = modelRepository;

            PlaylistsPanel playlistsPanel = new PlaylistsPanel();
            playlistsPanel.MediaSoftwareService = mediaSoftwareServices[ITunesServiceImpl.SERVICE_NAME];
            playlistsPanel.Model = modelRepository;
            playlistsPanel.MainForm = this;
            panels.Add("playlists", playlistsPanel);

            AssociationManagementPanel associationsPanel = new AssociationManagementPanel();
            associationsPanel.MainForm = this;
            associationsPanel.MediaSoftwareService = mediaSoftwareServices[ITunesServiceImpl.SERVICE_NAME];
            associationsPanel.DevicesManager = supportedDevicesManager;
            associationsPanel.Model = modelRepository;
            panels.Add("associations", associationsPanel);

            panels.Add("preferences", new PreferencesPanel());

            SetCommonPanelProperties();
        }