public static void Start() { ////Func<string, DateTime> func = delegate (string item) ////{ //// return DateTime.ParseExact(item, "yyMMddHHmmss", null); ////}; ////demo[] dt = new demo[] { new demo() { time = DateTime.Now.ToString("yyMMddHHmmss") } }; //////var l0 = dt.AsQueryable().Select(typeof(Result), @"new @out (@0(it.time) as data)", func); ////var l0 = dt.AsQueryable().Select(@"new (@0(it.time) as data)", func); //////var l1 = (IList)typeof(List<>).MakeGenericType(l0.ElementType).GetConstructor(Type.EmptyTypes).Invoke(null); //////foreach (var elem in l0) l1.Add(elem); ////IList l2 = new List<object>(); ////foreach (var elem in l0) l2.Add(elem); Application.EnableVisualStyles(); db = new DataHost(); ////////////////////////////////////////////// ////RuntimeTypeModel.Default.Add(typeof(Msg), false).SetSurrogate(typeof(MsgSurrogate)); //////////////////////////////////////////// ////////log = new Log(); ////////host = new HostListener(log); ////host.Start(); ////////////////////////////////////////////// noti_Init(); icon_tray = new SystemTray("Host"); fm_noti = new FormNotification(); fm_log = new FormLogger(); fm_login = new FormLogin(); fm_login.OnExit += () => Exit(); icon_tray.OnClick += () => show_Form(fm_DB); icon_tray.OnExit += () => Exit(); ////////////////////////////////////////// db.OnOpen += (string[] a) => { if (db.Open) { fm_DB = new FormDB(db); fm_DB.OnExit += () => Exit(); init_Form(); show_Form(fm_DB); //show_Form(new FormModelAdd(db)); //show_Form(new FormItemAdd(db, "ITEM")); ////show_Form(new FormColorPicker(true)); //show_Form(new FormLookupItem(db)); //fm_login.OnLogin += (user, pass) => //{ // bool login = db.Login(user, pass); // if (login) // show_Form(fm_DB); // else // { // show_Form(fm_login); // MessageBox.Show("Username and Password wrong. Please input again.", "LOGIN AGAIN"); // } //}; //show_Form(fm_login); } else { MessageBox.Show("SYSTEM CAN NOT OPEN. PLEASE CHECK DATA FILE.", "SYSTEM OPEN"); } }; db.Start(); Application.Run(icon_tray); }
public static void Start() { run_Cassini(); //string htm = File.ReadAllText("demo.html"); //List<string> listMp3 = new List<string>(); //var ps2 = Regex.Matches(htm, "http(.+?)mp3", RegexOptions.IgnoreCase | RegexOptions.Multiline); //foreach (Match mi in ps2) //{ // string img = mi.ToString(); // listMp3.Add(img); //} Application.EnableVisualStyles(); ////Func<string, DateTime> func = delegate (string item) ////{ //// return DateTime.ParseExact(item, "yyMMddHHmmss", null); ////}; ////demo[] dt = new demo[] { new demo() { time = DateTime.Now.ToString("yyMMddHHmmss") } }; //////var l0 = dt.AsQueryable().Select(typeof(Result), @"new @out (@0(it.time) as data)", func); ////var l0 = dt.AsQueryable().Select(@"new (@0(it.time) as data)", func); //////var l1 = (IList)typeof(List<>).MakeGenericType(l0.ElementType).GetConstructor(Type.EmptyTypes).Invoke(null); //////foreach (var elem in l0) l1.Add(elem); ////IList l2 = new List<object>(); ////foreach (var elem in l0) l2.Add(elem); db = new DataHost(); ////////////////////////////////////////////// ////RuntimeTypeModel.Default.Add(typeof(Msg), false).SetSurrogate(typeof(MsgSurrogate)); //////////////////////////////////////////// ////////log = new Log(); ////////host = new HostListener(log); ////host.Start(); ////////////////////////////////////////////// noti_Init(); icon_tray = new SystemTray("Host"); fm_noti = new FormNotification(); fm_log = new FormLogger(); fm_login = new FormLogin(); fm_search = new FormELSearch(db); fm_login.OnExit += () => Exit(); icon_tray.OnClick += () => { if (string.IsNullOrEmpty(UserCurrent)) { show_Form(fm_login); } else { show_Form(fm_DB); } }; icon_tray.OnExit += () => Exit(); ////////////////////////////////////////// db.OnOpen += (string[] a) => { if (db.Open) { fm_DB = new FormDB(db); fm_DB.OnExit += () => Exit(); show_Form(fm_DB); //show_Form(new FormGecko()); //show_Form(new FormELSearch(db)); //show_Form(new FormDataSplitConfig(db, "http://langmaster.edu.vn/bi-quyet-a15i1040.html")); //show_Form(new FormModelAdd(db)); //show_Form(new FormModelEdit(db, "USER")); //show_Form(new FormModelEdit(db, "JOIN1")); //show_Form(new FormItemAdd(db, "JOIN1")); ////show_Form(new FormColorPicker(true)); //show_Form(new FormLookupItem(db)); //init_Login(); } else { MessageBox.Show("SYSTEM CAN NOT OPEN. PLEASE CHECK DATA FILE.", "SYSTEM OPEN"); } }; db.Start(); while (m_CassiniInited == false) { ; } fm_gecko = new FormGecko(); show_Form(fm_gecko); Application.Run(icon_tray); }