Exemplo n.º 1
0
        void PopulatePlaylistAssociationData()
        {
            int playlistID = model.Get <int>("editAssociationsPlaylistID");

            UpdatePlaylistName(playlistID);
            UpdateAssociatedPlaylists(playlistID);
        }
Exemplo n.º 2
0
        private void AddNewDeviceFromWizardDataStore(Wizard wizard)
        {
            CompatibleDevice device          = (CompatibleDevice)wizard.DataStore[WizardDataStoreKeys.DEVICE];
            String           name            = (String)wizard.DataStore[WizardDataStoreKeys.NAME];
            bool             openDevicePanel = (bool)wizard.DataStore[WizardDataStoreKeys.OPEN_PLAYLIST_PANEL];

            DeviceCollection deviceCollection = model.Get <DeviceCollection>("devices");

            if (deviceCollection.GetDeviceWithIdentifier(device.Identifier) != null)
            {
                MessageBox.Show(this, "The device you are adding has already been added. You can only "
                                + "add a device once.\n\nIf you want several playlists synchronized to the same "
                                + "device, use the Playlists view to assign more playlists to your device.",
                                "Device already added", MessageBoxButtons.OK, MessageBoxIcon.Information);

                return;
            }

            Device newDevice = new Device();

            newDevice.Identifier = device.Identifier;
            newDevice.Name       = name;

            deviceCollection.Devices.Add(newDevice);
            FlushDeviceConfigurationToFile();

            RefreshDevicesList();

            if (openDevicePanel)
            {
                mainForm.SwithcToMyDevicesPanel();
            }
        }
Exemplo n.º 3
0
        public void PlaylistsPanel_Load(object sender, EventArgs e)
        {
            flowPlaylistAssociations.Visible = false;

            DeviceCollection deviceCollection = model.Get <DeviceCollection>("devices");

            List <Playlist> playlists = mediaSoftwareService.GetPlaylists();

            foreach (Playlist playlist in playlists)
            {
                PlaylistAssociationControl playlistAssociationControl = new PlaylistAssociationControl();
                playlistAssociationControl.PlaylistName        = playlist.Name;
                playlistAssociationControl.PlaylistNameToolTip = playlistAssociationControl.PlaylistName;
                playlistAssociationControl.PlaylistID          = playlist.ID;

                UpdateAssociationCountForControl(playlistAssociationControl, deviceCollection);

                playlistAssociationControl.AddAssociationButton.Click   += new EventHandler(AddAssociationButton_Click);
                playlistAssociationControl.EditAssociationsButton.Click += new EventHandler(EditAssociationsButton_Click);
                playlistAssociationControl.PlaylistNameLabel.Click      += new EventHandler(EditAssociationsButton_Click);

                flowPlaylistAssociations.Controls.Add(playlistAssociationControl);
            }


            flowPlaylistAssociations.Visible = true;
        }
        private void NewPlaylistAssociationForm_Load(object sender, EventArgs e)
        {
            DeviceCollection devices = model.Get <DeviceCollection>("devices");

            foreach (Device device in devices.Devices)
            {
                cbDeviceSelector.Items.Add(device);
            }
        }
Exemplo n.º 5
0
 private void InitializeDevicesManager()
 {
     portableDevicesService  = new WindowsPortableDevicesService();
     supportedDevicesManager = new SupportedDevicesManager();
     supportedDevicesManager.PortableDevicesService = portableDevicesService;
     supportedDevicesManager.ConfiguredDevices      = modelRepository.Get <DeviceCollection>("devices");
     supportedDevicesManager.NewDeviceConnected    += new NewDeviceConnectedHandler(NewDeviceConnectedEventHandler);
     supportedDevicesManager.DeviceRemoved         += new DeviceRemovedHandler(DeviceRemovedEventHandler);
 }