예제 #1
0
 private void listSubtitles_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listSubtitles.SelectedItems.Count > 0)
     {
         Subtitle subtitle = Subtitle.FromListViewItem(listSubtitles.SelectedItems[0]);
         textSRT.Text   = subtitle.Text;
         textStart.Text = subtitle.Start;
         textEnd.Text   = subtitle.End;
     }
 }
예제 #2
0
 private void listSubtitles_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         double position =
             Subtitle.StringToMilliseconds(Subtitle.FromListViewItem(listSubtitles.SelectedItems[0]).Start);
         wmp.Ctlcontrols.currentPosition = position;
     }
     catch
     {
     }
 }
예제 #3
0
        private void Save()
        {
            _saveFileDialog.Filter   = @"SRT File|*.srt";
            _saveFileDialog.FileName = RemoveExtension(_openFileDialog.FileName + "");
            if (_saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                //textSrtFile.Text = sfd.FileName;
                var sw = new StreamWriter(_saveFileDialog.FileName);

                int index = 1;
                foreach (var item in listSubtitles.Items)
                {
                    var subtitle = Subtitle.FromListViewItem((ListViewItem)item);
                    sw.Write(index++ + "\r\n" + subtitle.Start + " --> " + subtitle.End + "\r\n" + subtitle.Text + "\r\n\r\n");
                }

                sw.Close();
            }

            start = false;
        }