コード例 #1
0
        //static FormDemo fm_demo;


        public static void Start()
        {
            Application.EnableVisualStyles();

            //////////////////////////////////////////
            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_demo = new FormDemo(host);
            //fm_log.Show();
            //fm_demo.Show();

            //log.Write(LogSystem.HOST_SYSTEM, LogType.NONE, string.Format("Host port public: {0}", host.Port));
            //log.Write(LogSystem.HOST_SYSTEM, LogType.NONE, string.Format("Host port HTTP: {0}", host.PortHTTP));
            //log.Write(LogSystem.HOST_SYSTEM, LogType.NONE, string.Format("Host port Websocket: {0}", host.PortWebSocket));

            Application.Run(icon_tray);
        }
コード例 #2
0
        public static void show_Notification(string msg, int duration_ = 0)
        {
            FormNotification form = new FormNotification(msg, duration_);

            _invoker.Invoke((MethodInvoker) delegate()
            {
                form.Show();
            });
        }
コード例 #3
0
        public static void Start()
        {
            RuntimeTypeModel.Default.Add(typeof(Msg), false).SetSurrogate(typeof(MsgSurrogate));

            Application.EnableVisualStyles();

            noti_Init();

            log  = new Log();
            host = new HostServer(log);

            host.OnClient += (even, client_id, msg_id) =>
            {
                switch (even)
                {
                case MsgConnectEvent.MESSAGE_BINARY:
                    //Msg m = msg.Get(msg_id);
                    break;
                }
            };

            log.OnChange += (system, type, text) => fm_log.ShowLog(system, type, text);


            //////////////////////////////////////////////

            icon_tray = new SystemTray("Host");
            fm_noti   = new FormNotification();
            fm_log    = new FormLogger();
            //fm_demo = new FormDemo(host);


            host.Start();

            fm_log.Show();
            //fm_demo.Show();

            log.Write(LogSystem.HOST_SYSTEM, LogType.NONE, string.Format("Host port public: {0}", host.Port));
            log.Write(LogSystem.HOST_SYSTEM, LogType.NONE, string.Format("Host port HTTP: {0}", host.PortHTTP));
            log.Write(LogSystem.HOST_SYSTEM, LogType.NONE, string.Format("Host port Websocket: {0}", host.PortWebSocket));

            Application.Run(icon_tray);
        }
コード例 #4
0
 public ContextMenuNotification(FormNotification form, bool enableCustomMenu) : base(form)
 {
     this.form             = form;
     this.enableCustomMenu = enableCustomMenu;
 }
コード例 #5
0
 public TweetDeckBridge(FormBrowser form, FormNotification notification)
 {
     this.form         = form;
     this.notification = notification;
 }
コード例 #6
0
        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);
        }
コード例 #7
0
        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);
        }