-
Notifications
You must be signed in to change notification settings - Fork 1
/
MainWindow.cs
81 lines (68 loc) · 2.4 KB
/
MainWindow.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
namespace VideoEditor
{
partial class MainWindow : Form
{
Hashtable buttons = new Hashtable();
public MainWindow()
{
/*FileStream fs = new FileStream(@"sub\log.txt", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
StreamReader reader = new StreamReader(fs);
Console.WriteLine("fs.Length = " + fs.Length);
fs.Seek(2, System.IO.SeekOrigin.Begin);
Console.WriteLine(reader.ReadLine());
Console.WriteLine(reader.ReadLine());*/
Console.WriteLine(Environment.CurrentDirectory);
SuspendLayout();
FormBorderStyle = FormBorderStyle.FixedSingle;
MaximizeBox = false;
Text = "Video Editor";
Size = new Size(900, 600);
buttons["watch"] = new Button()
{
Text = "Watch",
Location = new Point(0, 0),
Size = new Size(100, 100),
};
buttons["merge"] = new Button()
{
Text = "Merge",
Location = new Point(0, 100),
Size = new Size(100, 100),
};
buttons["cut"] = new Button()
{
Text = "Cut",
Location = new Point(0, 200),
Size = new Size(100, 100),
};
((Button)buttons["watch"]).Click += new EventHandler(watchButtonClicked);
((Button)buttons["merge"]).Click += new EventHandler(mergeButtonClicked);
((Button)buttons["cut"]).Click += new EventHandler(cutButtonClicked);
foreach (Button b in buttons.Values)
{
b.Font = new Font(b.Font.OriginalFontName, 16);
Controls.Add(b);
}
ResumeLayout(false);
}
void watchButtonClicked(object sender, EventArgs e)
{
var watchWindow = new WatchWindow();
watchWindow.ShowDialog(this);
}
void mergeButtonClicked(object sender, EventArgs e)
{
var mergeWindow = new MergeWindow();
mergeWindow.ShowDialog(this);
}
void cutButtonClicked(object sender, EventArgs e)
{
var cutWindow = new CutWindow();
cutWindow.ShowDialog(this);
}
}
}