Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            //保存するクラス(SampleClass)のインスタンスを作成
            Data data = new Data();
            data.ProcessName = processNameTB.Text;
            data.Path = pathTB.Text;
            data.CheckInterval = int.Parse(numericUpDown1.Value.ToString());
            data.ResetHour = int.Parse(resetHour.Value.ToString());
            data.ResetMinute = int.Parse(resetMinute.Value.ToString());

            XMLFileManager xmlFileManager = new XMLFileManager();
            xmlFileManager.save(data);
        }
Beispiel #2
0
 private void loadXML()
 {
     XMLFileManager xmlFileManager = new XMLFileManager();
     Data data = xmlFileManager.load();
     if (data.isNull)
     {
         // 読めなかったので無視
     }
     else
     {
         processNameTB.Text = data.ProcessName;
         pathTB.Text = data.Path;
         numericUpDown1.Value = data.CheckInterval;
         resetHour.Value = data.ResetHour;
         resetMinute.Value = data.ResetMinute;
     }
 }