コード例 #1
0
        public FrmMain()
        {
            //RegUtil.SetIEBrowserTempPath();
            InitializeComponent();
            //HttpClient.UsedFidder = true;
            //RegUtil.SetIEBrowserTempPathEnd();
            WebShow.ScriptErrorsSuppressed = true;

            WebShow.DocumentCompleted += WebShow_DocumentCompleted;
            WebShow.NewWindow         += WebShow_NewWindow;
            BtnShowBuyList.Click      += (x, xx) =>
            {
                SendLoadBillMessageToServer();
                TryLoadBill(true);
            };
            this.FormClosing      += (x, xx) => { frmClosing = true; RegUtil.SetFormPos(this); };
            ipWebShowUrl.KeyPress += IpWebShowUrl_KeyPress;
            ThreadMonitor          = new Thread(() =>
            {
                int heartBeatCount = 0;
                while (!frmClosing)
                {
                    Thread.Sleep(1000);
                    heartBeatCount++;
                    if (heartBeatCount > 10)
                    {
                        Program.Tcp?.Send(new MsgHeartBeatMessage());
                        heartBeatCount = 0;
                    }
                }
            })
            {
                IsBackground = true
            };

            this.Show();
            int[] tmpBounds = RegUtil.GetFormPos(this);
            this.Left   = tmpBounds[0];
            this.Top    = tmpBounds[1];
            this.Width  = tmpBounds[2];
            this.Height = tmpBounds[3];

            InitTcp();

            ThreadMonitor.Start();
        }
コード例 #2
0
        public Form1()
        {
            InitializeComponent();
            _process                    = new ProcessGroup();
            ui                          = new UI.UI(this);
            InfoShow.DoubleClick       += InfoShow_DoubleClick;
            InfoShow.Icon               = this.Icon;
            InfoShow.BalloonTipClicked += Program.ResponseNoticeClick;
            Program.Running             = true;

            var bound = RegUtil.GetFormPos(this);

            this.Load += (x, xx) => { SetBounds(bound[0], bound[1], bound[2], bound[3]); };

            //OptShow.CallBack["ShowTomato"] = ActionBase.ShowTomato;
            //OptShow.CallBack["ExitInst"] = () => { Program.ExitProgram(); };
        }
コード例 #3
0
        public FrmMain()
        {
            InitializeComponent();

            var bound = RegUtil.GetFormPos(this);

            this.Load += (x, xx) => {
                SetBounds(0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
                Program.ShowNotice(5000,
                                   $"{EasyPlayerPro.Properties.Settings.Default.Title}已启动",
                                   "此版本为测试版本,待优化"
                                   );
                Program.manager         = new EasyPlayerManager(this.Handle);
                Program.frmSetting      = new FrmSetting();
                Program.frmSetting.Icon = this.Icon;
                Program.frmSetting.Show();
                Program.frmMain.WindowState = FormWindowState.Minimized;
            };
        }
コード例 #4
0
        private void FrmSetting_Load(object sender, EventArgs e)
        {
            for (int i = 1; i <= 16; i++)
            {
                OptPrivilege.Items.Add(i);
            }
            OptPrivilege.SelectedIndex = 0;
            foreach (var i in Enum.GetValues(typeof(EasyPlayerAPI.EASY_STREAM_LINK_MODE)))
            {
                OptProtocal.Items.Add(i);
            }
            OptProtocal.SelectedIndex = 0;
            foreach (var i in Enum.GetValues(typeof(EasyPlayerAPI.EASY_VIDEO_RENDER_TYPE)))
            {
                OptVideoRenderType.Items.Add(i);
            }
            OptVideoRenderType.SelectedIndex = 0;
            foreach (var i in Enum.GetValues(typeof(EasyPlayerAPI.EASY_VIDEO_SCALE_MODE)))
            {
                OptVideoClipType.Items.Add(i);
            }
            OptVideoClipType.SelectedIndex = 1;
            var settingVideoFile = Program.manager.RegSetting.In("VideoStream").GetInfo("historyFile");

            if (settingVideoFile.Length > 0)
            {
                LoadVideoStreamFromFile(settingVideoFile);
            }
            var settingStageLayoutFile = Program.manager.RegSetting.In("StageLayout").GetInfo("historyFile");

            if (settingStageLayoutFile.Length > 0)
            {
                LoadLayoutStageSettingFromFile(settingStageLayoutFile);
            }
            var frmBound = RegUtil.GetFormPos(this);

            this.SetBounds(frmBound[0], frmBound[1], frmBound[2], frmBound[3]);
        }
コード例 #5
0
        public FrmMain()
        {
            //RegUtil.SetIEBrowserTempPath();
            InitializeComponent();
            //HttpClient.UsedFidder = true;
            //RegUtil.SetIEBrowserTempPathEnd();
            WebShow.ScriptErrorsSuppressed = true;

            WebShow.DocumentCompleted += WebShow_DocumentCompleted;
            WebShow.NewWindow         += WebShow_NewWindow;
            BtnShowBuyList.Click      += (x, xx) => {
                TryLoadBill(true);
            };
            ipWebShowUrl.KeyPress += IpWebShowUrl_KeyPress;
            var t = new Thread(() => {
                while (true)
                {
                    Thread.Sleep(200);
                    CheckNewCmd();
                }
            })
            {
                IsBackground = true
            };

            this.Show();
            int[] tmpBounds = RegUtil.GetFormPos(this);
            this.Left   = tmpBounds[0];
            this.Top    = tmpBounds[1];
            this.Width  = tmpBounds[2];
            this.Height = tmpBounds[3];
            if (Tcp == null || Tcp.client == null || !Tcp.client.Connected)
            {
                this.Close();
            }
            t.Start();
        }