Пример #1
0
        public ucSeriesEpisodes(SeriesEpisodesShortInfo sesInfo, ucSeries parent)
        {
            InitializeComponent();

            _parent = parent;

            dgvEpisodes.GetType().GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(dgvEpisodes, true, null);
            dgvEpisodes.AutoGenerateColumns = false;

            _bsEpisodesGridData    = new BindingSource();
            dgvEpisodes.DataSource = _bsEpisodesGridData;

            // The check box column will be virtual.
            dgvEpisodes.VirtualMode = true;

            dgvEpisodes.Columns.Insert(0, new DataGridViewCheckBoxColumn()
            {
                Width = 40, Resizable = DataGridViewTriState.False
            });

            _headerColCheckBox = ColumnHeaderCheckBox(dgvEpisodes);
            _headerColCheckBox.CheckedChanged += HeaderColCheckBox_CheckedChanged;

            // Initialize the dictionary that contains the boolean check state.
            _checkState = new Dictionary <int, bool>();

            LoadControls(sesInfo);
        }
Пример #2
0
        public void LoadControls(SeriesEpisodesShortInfo sesInfo)
        {
            _checkState = new Dictionary <int, bool>();
            _headerColCheckBox.Checked = false;

            SetBulkEditButtonStateInParent();
            _lastSelectedRowIndex = -1;

            var episodesInSeries = DAL.GetCollectionElements(sesInfo);

            if (episodesInSeries.Any())
            {
                lbCollectionElementsCaption.Text = string.Format("Elements ({0})", episodesInSeries.Count);

                dgvElements.Visible        = true;
                lbNoEpisodeWarning.Visible = false;

                _bsEpisodesGridData.DataSource = episodesInSeries;
                _bsEpisodesGridData.ResetBindings(false);

                //dgvEpisodes.ClearSelection();
            }
            else
            {
                lbCollectionElementsCaption.Text = "Elements";
                dgvElements.Visible        = false;
                lbNoEpisodeWarning.Visible = true;
            }
        }
Пример #3
0
        public void RefreshControls(SeriesEpisodesShortInfo sesi)
        {
            tbTitle.Text = sesi.FileName;
            tbNotes.Text = sesi.Notes;
            cbSectionType.SelectedIndex = sesi.SectionType;

            Poster = sesi.Poster;
            Common.Helpers.UnsavedChanges = false;
        }