コード例 #1
0
        public void GetMovie(IMovie m)
        {
            _selectedMovie = m;
            var subs = new SubtitleList();
            subs.AddRange(m.Subtitles);

            for (int x = 0; x < subs.Count; x++)
            {
                var s = subs[x];
                SubGrid.Rows.Add();
                var c = SubGrid.Rows[x].Cells[0];
                c.Value = s.Frame;
                c = SubGrid.Rows[x].Cells[1];
                c.Value = s.X;
                c = SubGrid.Rows[x].Cells[2];
                c.Value = s.Y;
                c = SubGrid.Rows[x].Cells[3];
                c.Value = s.Duration;
                c = SubGrid.Rows[x].Cells[4];
                c.Value = String.Format("{0:X8}", s.Color);
                c.Style.BackColor = Color.FromArgb((int)s.Color);
                c = SubGrid.Rows[x].Cells[5];
                c.Value = s.Message;
            }
        }
コード例 #2
0
        public void GetMovie(IMovie m)
        {
            _selectedMovie = m;
            var subs = new SubtitleList();

            subs.AddRange(m.Subtitles);

            for (int x = 0; x < subs.Count; x++)
            {
                var s = subs[x];
                SubGrid.Rows.Add();
                var c = SubGrid.Rows[x].Cells[0];
                c.Value           = s.Frame;
                c                 = SubGrid.Rows[x].Cells[1];
                c.Value           = s.X;
                c                 = SubGrid.Rows[x].Cells[2];
                c.Value           = s.Y;
                c                 = SubGrid.Rows[x].Cells[3];
                c.Value           = s.Duration;
                c                 = SubGrid.Rows[x].Cells[4];
                c.Value           = $"{s.Color:X8}";
                c.Style.BackColor = Color.FromArgb((int)s.Color);
                c                 = SubGrid.Rows[x].Cells[5];
                c.Value           = s.Message;
            }
        }
コード例 #3
0
        private void EditSubtitlesForm_Load(object sender, EventArgs e)
        {
            var subs = new SubtitleList();

            subs.AddRange(_selectedMovie.Subtitles);

            for (int x = 0; x < subs.Count; x++)
            {
                var s = subs[x];
                SubGrid.Rows.Add();
                var c = SubGrid.Rows[x].Cells[0];
                c.Value           = s.Frame;
                c                 = SubGrid.Rows[x].Cells[1];
                c.Value           = s.X;
                c                 = SubGrid.Rows[x].Cells[2];
                c.Value           = s.Y;
                c                 = SubGrid.Rows[x].Cells[3];
                c.Value           = s.Duration;
                c                 = SubGrid.Rows[x].Cells[4];
                c.Value           = $"{s.Color:X8}";
                c.Style.BackColor = Color.FromArgb((int)s.Color);
                c                 = SubGrid.Rows[x].Cells[5];
                c.Value           = s.Message;
            }

            if (_readOnly)
            {
                // Set all columns to read only
                for (int i = 0; i < SubGrid.Columns.Count; i++)
                {
                    SubGrid.Columns[i].ReadOnly = true;
                }

                Text = "View Subtitles";
            }

            if (SubGrid.Rows.Count > 8)
            {
                var x = Height + ((SubGrid.Rows.Count - 8) * 21);
                Height = x < 600 ? x : 600;
            }
        }