private void cFile_Open_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.FileName = "default.mkmr"; dialog.InitialDirectory = System.Environment.CurrentDirectory; dialog.Filter = "設定ファイル(*.mkmr)|*.mkmr"; dialog.FilterIndex = 0; dialog.Title = "開くファイルを選択してください"; dialog.RestoreDirectory = true; dialog.CheckFileExists = true; dialog.CheckPathExists = true; if (dialog.ShowDialog() == DialogResult.OK) { MyLib.File.XmlOperator xml = new MyLib.File.XmlOperator(); this.cKeyList.SetSerializeValue(xml.Deserialize <List <List <string> > >(dialog.FileName)); } }
/// <summary> /// add key mapping to key list /// </summary> /// <param name="file"></param> private void SaveKeyList(string file) { MyLib.File.XmlOperator xml = new MyLib.File.XmlOperator(); xml.Serialize <List <List <string> > >(file, this.cKeyList.GetSerializeValue()); }