Example #1
0
        static void Main(string[] args)
        {
            //string url = "http://www.google.com";
            //Console.WriteLine("Begin  " + GetID());
            //ASyncDown(url).Execte();
            ////SyncDown(url);
            //Console.WriteLine("");

            //System.Collections.Concurrent.ConcurrentDictionary<int, int> dic = new ConcurrentDictionary<int, int>();

            //var s = Guid.Empty.ToString();
            //Guid ss = Guid.NewGuid();

            System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(typeof(List <AlarmParameter>));
            AlarmParameter ap = new AlarmParameter();

            ap.Name      = "AL";
            ap.Code      = "AL";
            ap.Value     = null;
            ap.Precision = 0;

            List <AlarmParameter> itemlist = new List <AlarmParameter>();

            itemlist.Add(ap);
            File.Delete("a.xml");

            var f = File.Create("a.xml");

            x.Serialize(f, itemlist);
            f.Close();



            Console.ReadKey();
        }
Example #2
0
        private void button_Add_Click(object sender, EventArgs e)
        {
            AlarmParameter temp = new AlarmParameter();
            EditChecked    add  = new EditChecked(temp, this);

            add.Owner = this;
            add.Show();
        }
Example #3
0
        private void button_Update_Click(object sender, EventArgs e)
        {
            AlarmParameter temp = new AlarmParameter();

            temp.fuc   = "update";
            temp.Title = "update";

            temp.selectIndex = dataGridView1.CurrentCell.RowIndex;
            EditChecked add = new EditChecked(temp, this);

            add.Owner = this;
            add.Show();
        }
        private void button_Update_Click(object sender, EventArgs e)
        {
            AlarmParameter temp = new AlarmParameter();

            temp.fuc   = "update";
            temp.Title = "update";

            temp.selectIndex = dataGridView1.CurrentCell.RowIndex;
            string        nodeName = dataGridView1.Rows[temp.selectIndex].Cells["Device_Name"].Value.ToString();
            AddCollection add      = new AddCollection(temp, this);

            add.Owner = this;
            if (add.ShowDialog() == DialogResult.OK)
            {
                if (add.newDeviceName != nodeName)
                {
                    TreeExXML.TreeExXMLCls xt2 = new TreeExXML.TreeExXMLCls();
                    xt2.UpdateXmlNodeByXPath("D:\\MyVidio\\myxml.xml", add.newDeviceName, nodeName);
                    fath.ReloadTreeView();
                }
            }
        }