OSDN Git Service

29d8839aaa9c53e9043ab84b21630b76627de549
[maildivsender/maildivsender.git] / MailDivSender / ServerSettingDlg.cs
1 using System;
2 using System.Collections.Generic;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Linq;
7 using System.Text;
8 using System.Threading.Tasks;
9 using System.Windows.Forms;
10 using System.Configuration;
11
12 namespace MailDivSender
13 {
14     /// <summary>
15     /// サーバー設定ダイアログ
16     /// </summary>
17     public partial class ServerSettingDlg : Form
18     {
19         /// <summary>
20         /// コンストラクタ
21         /// </summary>
22         public ServerSettingDlg()
23         {
24             InitializeComponent();
25         }
26
27         /// <summary>
28         /// OKボタン押下
29         /// </summary>
30         /// <param name="sender"></param>
31         /// <param name="e"></param>
32         private void OkBtn_Click(object sender, EventArgs e)
33         {
34             SaveSetting();
35         }
36
37         /// <summary>
38         /// 設定保存
39         /// </summary>
40         protected void SaveSetting()
41         {
42             Properties.Settings.Default.User = UserTxt.Text;
43             Properties.Settings.Default.Pass = PassTxt.Text;
44             Properties.Settings.Default.Imap4Server = Imap4ServerTxt.Text;
45             Properties.Settings.Default.Imap4Port = (int)Imap4ServerPort.Value;
46             Properties.Settings.Default.SMTPServer = SMTPServerTxt.Text;
47             Properties.Settings.Default.SMTPPort = (int)SMTPServerPort.Value;
48             Properties.Settings.Default.Signature = SignatureTxt.Text;
49
50             Properties.Settings.Default.Save();
51         }
52
53         /// <summary>
54         /// 設定読み込み
55         /// </summary>
56         protected void LoadSetting()
57         {
58             UserTxt.Text = Properties.Settings.Default.User;
59             PassTxt.Text = Properties.Settings.Default.Pass;
60             Imap4ServerTxt.Text = Properties.Settings.Default.Imap4Server;
61             Imap4ServerPort.Value = Properties.Settings.Default.Imap4Port;
62             SMTPServerTxt.Text = Properties.Settings.Default.SMTPServer;
63             SMTPServerPort.Value = Properties.Settings.Default.SMTPPort;
64             SignatureTxt.Text = Properties.Settings.Default.Signature;
65         }
66
67         /// <summary>
68         /// ロードインベト
69         /// </summary>
70         /// <param name="sender"></param>
71         /// <param name="e"></param>
72         private void ServerSettingDlg_Load(object sender, EventArgs e)
73         {
74             LoadSetting();
75         }
76     }
77 }