public SubtitleTableDelegate(SubtitleTableDataSource datasource, IChangeSubtitleTableSelection controller)
 {
     this.DataSource = datasource;
     _controller = controller;
 }
Esempio n. 2
0
 public SubtitleTableDelegate(SubtitleTableDataSource datasource, IChangeSubtitleTableSelection controller)
 {
     this.DataSource = datasource;
     _controller     = controller;
 }
        private void ReloadSubtitle(Subtitle subtitle, bool keepSelected)
        {
            var ds = new SubtitleTableDataSource(subtitle, this);
            Window.SubtitleTable.DataSource = ds;
            Window.SubtitleTable.Delegate = new SubtitleTableDelegate(ds, this);

            var selectedIndices = Window.SubtitleTable.SelectedRows;
            Window.SubtitleTable.ReloadData();
            if (keepSelected)
            {
                foreach (var index in selectedIndices)
                {
                    Window.SubtitleTable.SelectRow((nint)index, true);
                }
            }
            else
            {
                ShowSubtitleRow(0);
            }
        }
        private void ShowSubtitle()
        {
            nint selectRow = 0;
            if (_tableSubtitle.SelectedRows.Count > 0)
            {
                selectRow = _tableSubtitle.SelectedRow;
            }

            var ds = new SubtitleTableDataSource (_subtitle, null);
            _tableSubtitle.DataSource = ds;
            _tableSubtitle.Delegate = new SubtitleTableDelegate (ds, this);

            ShowSubtitleRow(selectRow);
        }
 private void SetNewSubtitle(Subtitle subtitle)
 {
     _selectedParagraph = null;
     var ds = new SubtitleTableDataSource(subtitle, this);
     Window.SubtitleTable.DataSource = ds;
     Window.SubtitleTable.Delegate = new SubtitleTableDelegate(ds, this);
     ShowSubtitleRow(0);
     _subtitleOriginalHash = subtitle.GetFastHashCode();
     _subtitleOrginalFormat = GetCurrentSubtitleFormat().FriendlyName;
     SetTitle();
 }