Example #1
0
        private void UpdateSelectedPublisher()
        {
            // We get the new publisher, we alwasy trust that _currentPublisher is not null
            _currentPublisher = sideBarControl.SelectedValue;

            videoLoginStatusControl.Auth = _currentPublisher.Auth;

            Debug.Assert(_currentPublisher != null);

            // Get the acceptance text from the publisher and link it
            llTerms.Text  = _currentPublisher.AcceptanceTitle;
            llSafety.Text = _currentPublisher.SafetyTipTitle;

            txtAcceptTerms.Text = _currentPublisher.AcceptanceText;

            cbAcceptTerms.Width = txtTags.Width;
            cbAcceptTerms.Left  = txtTags.Left;

            comboBoxPermissions.Items.Clear();
            if (_currentPublisher.Id != YouTubeVideoPublisher.ID)
            {
                comboBoxPermissions.Items.Add(new SecurityItem("1", Res.Get(StringId.Plugin_Video_Soapbox_Publish_Permissions_Hidden)));
                comboBoxPermissions.Items.Add(new SecurityItem("0", Res.Get(StringId.Plugin_Video_Soapbox_Publish_Permissions_Public)));

                int index = comboBoxPermissions.FindString(_selectedPermission);
                index = Math.Max(0, index);
                comboBoxPermissions.SelectedIndex = index;
            }
            else
            {
                comboBoxPermissions.Items.Add(new SecurityItem("0", Res.Get(StringId.Plugin_Video_Soapbox_Publish_Permissions_Public)));
                comboBoxPermissions.SelectedIndex = 0;
            }


            // Add the categories for the publisher
            List <CategoryItem> categoryList = _currentPublisher.Categories;

            comboBoxCategory.Items.Clear();
            comboBoxCategory.Items.Add(new CategoryItem(Guid.Empty.ToString(), String.Empty));
            if (categoryList.Count > 0)
            {
                foreach (CategoryItem c in categoryList)
                {
                    comboBoxCategory.Items.Add(c);
                }
                comboBoxCategory.SelectedIndex = 0;
                comboBoxCategory.Enabled       = true;
                comboBoxCategory.DropDownWidth = DisplayHelper.AutoFitSystemComboDropDown(comboBoxCategory) + 10;
            }
            else
            {
                comboBoxCategory.Enabled = false;
            }

            cbAcceptTerms.Checked = false;
        }
        private void UpdateSelectedPublisher()
        {
            // We get the new publisher, we alwasy trust that _currentPublisher is not null
            _currentPublisher = sideBarControl.SelectedValue;

            videoLoginStatusControl.Auth = _currentPublisher.Auth;

            Debug.Assert(_currentPublisher != null);

            // Get the acceptance text from the publisher and link it
            llTerms.Text = _currentPublisher.AcceptanceTitle;
            llSafety.Text = _currentPublisher.SafetyTipTitle;

            txtAcceptTerms.Text = _currentPublisher.AcceptanceText;

            cbAcceptTerms.Width = txtTags.Width;
            cbAcceptTerms.Left = txtTags.Left;

            comboBoxPermissions.Items.Clear();
            if (_currentPublisher.Id != YouTubeVideoPublisher.ID)
            {
                comboBoxPermissions.Items.Add(new SecurityItem("1", Res.Get(StringId.Plugin_Video_Soapbox_Publish_Permissions_Hidden)));
                comboBoxPermissions.Items.Add(new SecurityItem("0", Res.Get(StringId.Plugin_Video_Soapbox_Publish_Permissions_Public)));

                int index = comboBoxPermissions.FindString(_selectedPermission);
                index = Math.Max(0, index);
                comboBoxPermissions.SelectedIndex = index;
            }
            else
            {
                comboBoxPermissions.Items.Add(new SecurityItem("0", Res.Get(StringId.Plugin_Video_Soapbox_Publish_Permissions_Public)));
                comboBoxPermissions.SelectedIndex = 0;
            }

            // Add the categories for the publisher
            List<CategoryItem> categoryList = _currentPublisher.Categories;
            comboBoxCategory.Items.Clear();
            comboBoxCategory.Items.Add(new CategoryItem(Guid.Empty.ToString(), String.Empty));
            if (categoryList.Count > 0)
            {
                foreach (CategoryItem c in categoryList)
                {
                    comboBoxCategory.Items.Add(c);
                }
                comboBoxCategory.SelectedIndex = 0;
                comboBoxCategory.Enabled = true;
                comboBoxCategory.DropDownWidth = DisplayHelper.AutoFitSystemComboDropDown(comboBoxCategory) + 10;
            }
            else
            {
                comboBoxCategory.Enabled = false;
            }

            cbAcceptTerms.Checked = false;
        }