Esempio n. 1
0
        //private Thread mdip_Thread = null;
        public void button2_Click(object sender, EventArgs e)
        {
            //_uf_selectedCellCount = dataGridView1.GetCellCount(DataGridViewElementStates.Selected);
            _uf_selectedCellCount = (dataGridView1.Rows.Count - 1);

            if (_uf_selectedCellCount > 0)
            {
                Modify_ip       MForm = new Modify_ip(this);
                DataGridViewRow row   = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex];

                //TODO: Need Error handling
                MForm.String1 = row.Cells[2].Value.ToString();
                MForm.String2 = row.Cells[1].Value.ToString();
                MForm.SetValue();
                MForm.Show();
            }
            else
            {
                MessageBox.Show("Please Select IPcamera first, then try again ");
            }
        }
Esempio n. 2
0
        private void f_sys_xml(Stream S, int devIdx)
        {
            XmlTextReader xmlReader = new XmlTextReader(S);
            Modify_ip     IForm     = new Modify_ip(this);

            IForm.Owner = this;
            DataGridViewRow row = dataGridView1.Rows[devIdx - 1];

            while (xmlReader.Read())
            {
                switch (xmlReader.NodeType)
                {
                case XmlNodeType.Element:
                    //listBox1.Items.Add("<" + xmlReader.Name + ">");

                    switch (xmlReader.Name)
                    {
                    case "System":
                        xmlReader.Read();
                        if (xmlReader.Name.Equals("ModelName"))
                        {
                            //xmlReader.Read();
                            //textBox_model.Text = xmlReader.Value;
                            //modelname = xmlReader.Value;
                        }
                        break;

                    case "SkuName":
                        if (xmlReader.Name.Equals("SkuName"))
                        {
                            xmlReader.Read();
                            //md_type = xmlReader.Name;
                            switch (xmlReader.Value)
                            {
                            case "CA-NF21-N":
                                md_name = "CA-NF21-N";
                                break;

                            case "CA-NF21-W":
                                md_name = "CA-NF21-W";
                                break;

                            case "CA-NF21-WI":
                                md_name = "CA-NF21-WI";
                                break;
                            }
                            //md_name = dataGridView1.Rows[devIdx].Cells[1] ;
                            //dataGridView1.BeginInvoke((MethodInvoker)delegate () { dataGridView1.Rows[devIdx].Cells[1], (string) md_name; });
                            //row.Cells[3].Value = md_name;
                        }
                        break;

                    case "PartNumber":
                        xmlReader.Read();
                        //TextBox_partnum.Text = xmlReader.Value;
                        //partnumber = xmlReader.Value;
                        break;

                    case "PCBASerialNumber":
                        xmlReader.Read();
                        // textBox_pcba.Text = xmlReader.Value;
                        //pcbanumber = xmlReader.Value;
                        break;

                    case "SysSerialNumber":
                        xmlReader.Read();
                        //tb_serial.Text = xmlReader.Value;
                        //sysserialnum = xmlReader.Value;
                        break;

                    case "FWVersion":
                        xmlReader.Read();
                        dev_fw             = xmlReader.Value;
                        row.Cells[4].Value = xmlReader.Value;
                        break;

                    case "LoadDefault":
                        xmlReader.Read();
                        //loaddefault = xmlReader.Value;
                        break;

                    case "MacAddress":
                        xmlReader.Read();
                        //this.textBox_macaddress.Nam = xmlReader.Value;
                        //row.Cells[3].Value = xmlReader.Value;
                        break;

                    case "Token":
                        xmlReader.Read();
                        //_token = xmlReader.Value;
                        break;
                    }
                    break;
                }
            }
        }