-
Notifications
You must be signed in to change notification settings - Fork 1
/
RecordingService.cs
46 lines (37 loc) · 1.17 KB
/
RecordingService.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
using System;
using System.Windows.Forms;
namespace DVBViewerController
{
public partial class RecordingService : Form
{
DVBServer mainForm = null;
public RecordingService(DVBServer form)
{
this.mainForm = form;
InitializeComponent();
if(this.mainForm.recIP != null)
tbIP.Text = this.mainForm.recIP;
if(this.mainForm.recPort != null)
tbPort.Text = this.mainForm.recPort;
}
private void btnSubmit_Click(object sender, EventArgs e)
{
ushort port;
try
{
port = UInt16.Parse(tbPort.Text);
if(!DVBServer.IsIPv4(tbIP.Text))
throw new Exception();
this.mainForm.recIP = tbIP.Text;
this.mainForm.recPort = port.ToString();
Properties.Settings.Default.recIP = tbIP.Text;
Properties.Settings.Default.recPort = port.ToString();
this.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}