Ejemplo n.º 1
0
        public void SetService(IMediaSource source)
        {
            _auth = source.Auth;

            VideoServiceSettings settings = VideoSettings.GetServiceSettings(source.Id);

            txtUsername.Text          = settings.Username;
            ckBoxSavePassword.Checked = !_auth.PasswordRequired(settings.Username);

            ckBoxSavePassword.Text = _auth.LoginSavePasswordText;
            lblEmailExample.Text   = _auth.LoginExampleText;
            lblUsername.Text       = _auth.LoginUsernameLabel;
            lblPassword.Text       = _auth.LoginPasswordLabel;

            pictureBoxLogo.Image = _auth.LoginLogo;
            if (pictureBoxLogo.Image != null)
            {
                pictureBoxLogo.Size = pictureBoxLogo.Image.Size;
            }
            else
            {
                pictureBoxLogo.Size = new Size(0, 0);
            }

            RefreshLayout();
        }
        public override bool ValidateSelection()
        {
            VideoSettings.selectedServiceName = _sidebarService.SelectedValue.ServiceName;
            VideoServiceSettings serviceSettings = VideoSettings.GetServiceSettings(_sidebarService.SelectedValue.Id);

            if (!CurrentService.Auth.IsLoggedIn)
            {
                DisplayMessage.Show(MessageId.VideoLoginRequired, this);
                return(false);
            }

            if (_listBoxVideos.SelectedItems.Count == 0)
            {
                DisplayMessage.Show(MessageId.NoSoapboxVideoSelected, this);
                return(false);
            }

            serviceSettings.SelectedRequestType = _videoRequestComboBox.SelectedRequestType.TypeName;
            serviceSettings.Username            = CurrentService.Auth.Username;

            return(true);
        }