public Database(SessionWrapper sw) { this.sw = sw; sw.Batheinit_Complete += this.Batheinit_Complete; sw.Cardchange_Complete += this.Cardchange_Complete; sw.Searchnext_Complete += this.Searchnext_Complete; sw.Groupexit_Complete += this.Groupexit_Complete; sw.Cardmultidel_Complete += this.Cardmultidel_Complete; sw.Restset_Complete += this.Restset_Complete; sw.Restinit_Complete += this.Restinit_Complete; }
static void Main() { bool run = true; #if !DEBUG // 二重起動を防止する using (Mutex mutex = new Mutex(false, Application.ProductName)) { run = mutex.WaitOne(0, false); } #endif if (run) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var login = LoginInfo.Load(); if (!login.IsExists()) { var frm = new LoginForm(); if (frm.ShowDialog() == DialogResult.OK) { login = frm.LoginData; LoginInfo.Save(login); } } if (login.IsExists()) { var sw = new SessionWrapper(8892); var database = new Database(sw); Application.Run(new MainForm(database)); } } }
static void Main(string[] args) { SessionWrapper sw = new SessionWrapper(8892); while (true) System.Threading.Thread.Sleep(1000); }