/
Form1.cs
53 lines (48 loc) · 1.65 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Linq;
using System.Windows.Forms;
using WebViewTranslate.Logic;
namespace WebViewTranslate
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
using (var form = new MainForm(new Subtitle { Paragraphs =
{
new Paragraph("<i>Previously on</i>\r\nRiverdale...",0,0),
new Paragraph("I'm Fine?",0,0),
new Paragraph("How nice of you to join us today" + Environment.NewLine +
"so we all can work on the project together",0,0),
new Paragraph("Tuesday",0,0),
new Paragraph("Wedensday",0,0),
new Paragraph("Thursday",0,0),
new Paragraph("Friday",0,0),
new Paragraph("Godbye.",0,0),
}
}, "test", "descr", this))
{
form.ShowDialog(this);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
{
var sub = new Subtitle();
new SubRip().LoadSubtitle(sub, System.IO.File.ReadAllLines(openFileDialog1.FileName).ToList(), null);
using (var form = new MainForm(sub, "test", "descr", this))
{
form.ShowDialog(this);
}
}
}
private void openFileDialog1_FileOk(object sender, System.ComponentModel.CancelEventArgs e)
{
}
}
}