Ejemplo n.º 1
0
 public netForm_Universal(netdata netdata, string mac, netForm parent)
 {
     tForm = parent;
     InitializeComponent();
     button3.Text = translate.getInfo("form2", "button3");
     button4.Text = translate.getInfo("form2", "button4");
     for (int i = 0; i < label.Length; i++)
     {
         label[i] = (Label)Controls.Find("RF_label" + i.ToString(), true)[0];
     }
     for (int i = 1; i < comboBox.Length; i++)
     {
         comboBox[i] = (ComboBox)Controls.Find("RF_C" + (i - 1).ToString(), true)[0];
     }
     for (int i = 0; i < textBox.Length; i++)
     {
         textBox[i] = (TextBox)Controls.Find("RF_T" + i.ToString(), true)[0];
     }
     Rf.ControlEnable(label, textBox, comboBox, false);
     xServer        = new submenuTUdpServer1(1901);
     _syncContext   = SynchronizationContext.Current;
     xServer.UIForm = this;
     _Netdata       = netdata;
     _Mac           = mac;
     Rf.GetConfigFile(netdata.Version - 1);
 }
Ejemplo n.º 2
0
        public HomePage()
        {
            InitializeComponent();
            netform = new netForm();
            netform.UdpserverStop();
            e70 = new E70();
            try
            {
                Form_Num = File.ReadAllText(@"C:\Users\Public\Documents\Ebyte_Config1.txt");
                if (Form_Num == "3")
                {
                    netcfg.E830_ETH2A.E830ETH_Flag = true;
                }
                else
                {
                    netcfg.E830_ETH2A.E830ETH_Flag = false;
                }
            }
            catch (Exception)
            {
            }

            object    sender = new object();
            EventArgs e      = new EventArgs();

            switch (Form_Num)
            {
            case "1":
                eToolStripMenuItem_Click(sender, e);
                break;

            case "2":
                e70ToolStripMenuItem_Click(sender, e);
                break;

            case "3":
                E830toolStripMenuItem_Click(sender, e);
                break;

            default:
                eToolStripMenuItem_Click(sender, e);
                break;
            }
        }
Ejemplo n.º 3
0
        private void eToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FileInfo     form_num = new FileInfo(@"C:\Users\Public\Documents\Ebyte_Config1.txt");
            StreamWriter sw       = form_num.CreateText();

            netcfg.E830_ETH2A.E830ETH_Flag = false;
            Form_Num = "1";
            sw.Write("1");
            sw.Close();
            netform.Close();
            netform.UdpserverStop();
            netform = new netForm();
            Width   = netform.Width;
            Height  = netform.Height + 30;
            netform.FormBorderStyle = FormBorderStyle.None; //隐藏子窗体边框(去除最小花,最大化,关闭等按钮)
            netform.TopLevel        = false;                //指示子窗体非顶级窗体
            panel1.Controls.Clear();
            panel1.Controls.Add(netform);
            netform.Show();
        }