static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainForm form = new MainForm(); MessageService service = new MessageService(); FileManager manager = new FileManager(); MainPresenter presenter = new MainPresenter(form, manager, service); Application.Run(form); }
private static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //---собственный код---- MainForm form = new MainForm(); MessageService service = new MessageService(); FileManager manager = new FileManager(); Presenter presenter = new Presenter(form, manager, service ); //---------------------- Application.Run(form); }
/// <summary> /// 编辑数据 /// </summary> /// <param name="table">输入数据</param> /// <return>是否编辑成功</return> public override bool EditData(Hashtable table) { bool editSuccess = false; string content = table["data"] as string; if(content == null) { content = "请输入编辑内容"; } MainForm mainForm = new MainForm(content); DialogResult result = mainForm.ShowDialog(); if(result == DialogResult.OK) { text = mainForm.Content; data = mainForm.Content; editSuccess = true; } return editSuccess; }