示例#1
0
文件: Form1.cs 项目: Kempaf/CabiNet
        private void toolStripLabel2_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();

            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                TextReader    reader     = new StreamReader(dialog.FileName);
                XmlSerializer serializer = new XmlSerializer(Cabinet.GetType());
                Cabinet = (CabinetGenerator)serializer.Deserialize(reader);
                reader.Close();
            }
        }
示例#2
0
文件: Form1.cs 项目: Kempaf/CabiNet
 private void toolStripLabel2_Click(object sender, EventArgs e)
 {
     OpenFileDialog dialog = new OpenFileDialog();
     if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         TextReader reader = new StreamReader(dialog.FileName);
         XmlSerializer serializer = new XmlSerializer(Cabinet.GetType());
         Cabinet = (CabinetGenerator)serializer.Deserialize(reader);
         reader.Close();
     }
 }