Exemple #1
0
        private void FrmMain_Load(object sender, EventArgs e)
        {
            this.handle = (UInt32)this.Handle;
            fontName    = ConfigurationManager.AppSettings["FontName"];
            fontColor   = Convert.ToInt32(ConfigurationManager.AppSettings["FontColor"], 16);
            fontSize    = Convert.ToInt32(ConfigurationManager.AppSettings["FontSize"]);
            fontStyle   = Convert.ToInt32(ConfigurationManager.AppSettings["FontStyle"]);
            var position = ConfigurationManager.AppSettings["Position"].Split(',');

            rectText = new Rectangle(
                Convert.ToInt32(position[0]),
                Convert.ToInt32(position[1]),
                Convert.ToInt32(position[2]),
                Convert.ToInt32(position[3]));
            this.client.ServerIP   = ip;
            this.client.ServerPort = ushort.Parse(port);
            this.client.ClientType = ClientType.LEDDisplay;
            this.client.ClientName = clientName;
            this.client.Start();
            this.client.OnResult += (msgType, msgText) =>
            {
                this.messageIndicator1.SetState(StateType.Success, msgText);
            };
            this.client.OnDisconnect += () =>
            {
                this.messageIndicator1.SetState(StateType.Error, "未连接");
            };
            this.client.OnMessage += new Action <QueueMessage.Message>(client_OnMessage);
            LEDSender              = new CLEDSender();
            LEDSender.Do_LED_Startup();
            this.listLedControl = this.ledControlBll.GetModelList();
            this.listLedWin     = this.ledWinBll.GetModelList();
            this.Close();
            this.notifyIcon1.ShowBalloonTip(3000);
        }