Ejemplo n.º 1
0
        protected override void InitUIOnShown()
        {
            HintProvider.WaitingDone(Application.ProductName);
            base.InitUIOnShown();

            this.pnlButtom.Visible = false;
            this.btnMin.Visible    = true;
            ControlUtilityTool.SetControlDefaultFont(this.lblCaption, 15, FontStyle.Bold);

            //this.lblCaption.Text = "网络设备参数设置工具";
            string strVersion = string.Format("V{0}", StrUtils.GetFileVersion(Path.Combine(Application.StartupPath, "ParamsSettingTool.exe")));

            title = "网络设备参数设置工具" + "(" + strVersion + ")";
            this.lblCaption.Text = title;

            f_UserControls = new Dictionary <string, GeneralUserControl>();

            //启动Udp监听
            int udpPort = StrUtils.StrToIntDef(AppXmlConfig.Singleton[AppXmlConfig.UDP_SOURCE_PORT].ToString(), AppConst.UDP_SOURCE_PORT);

            f_UdpListener = new UdpListener(udpPort);
            string errMsg = string.Empty;

            if (!f_UdpListener.StartUdp(ref errMsg))
            {
                HintProvider.ShowAutoCloseDialog(this, string.Format("启动Udp监听失败,错误:{0}", errMsg));
            }
            AppXmlConfig.Singleton.Save();


            //暂时无云对讲设备
            this.nbItemCloudIntercom.Visible = false;
        }
 protected virtual void InitUIOnShown()
 {
     if (UtilityTool.IsDesignMode())
     {
         return;
     }
     this.InitUIEvents();
     this.SetCaptionPosition();
     ControlUtilityTool.SetITLSimpleButtonFlatStyle(this.btnOK);
     ControlUtilityTool.SetPanelControlBorderLines(this.pnlButtom, false, true, true, true);
     ControlUtilityTool.SetPanelControlBorderLines(this.pnlMain, false, true, true, true);
     ControlUtilityTool.SetControlDefaultFont(this.lblCaption, 12, FontStyle.Bold);
     ControlUtilityTool.SetControlDefaultColor(this.lblCaption, Color.White, ColorType.ctForeColor);
     ControlUtilityTool.SetControlDefaultColor(this.pnlMain, ControlUtilityTool.PubBackColorNormal);
     ControlUtilityTool.SetControlDefaultColor(this.pnlButtom, ControlUtilityTool.PubBackColorNormal);
     ControlUtilityTool.SetSuperToolTip(this.btnMin, "最小化");
     ControlUtilityTool.SetSuperToolTip(this.btnMax, "最大化");
     ControlUtilityTool.SetSuperToolTip(this.btnClose, "关闭");
     this.btnOK.Top      = (this.pnlButtom.Height - this.btnOK.Height) / 2;
     this.btnOK.Left     = this.pnlButtom.Width - 25 - this.btnOK.Width;
     this.btnMin.Visible = false;
     this.btnMax.Visible = false;
 }