public void ProcessAddForm(ModeAdd modeAddForm) { DialogResult result = modeAddForm.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { string modeName = modeAddForm.GetModeName(); string[] fileName = modeAddForm.GetImageFile().Split('\\'); string ownImagePath = "Image/" + fileName[fileName.Length - 1]; if (!File.Exists(ownImagePath)) File.Copy(modeAddForm.GetImageFile(), ownImagePath); // if mode is exist, must pop alert Mode mode = AddMode(modeAddForm.GetModeName()); mode.SetImage(ownImagePath); } }
//新增軟體button click事件 private void ClickAddButton(object sender, EventArgs e) { ModeAdd modeAddForm = new ModeAdd(_presentationModel); _presentationModel.ProcessAddForm(modeAddForm); }