示例#1
0
 public bool addTable(tableInfo tb)
 {
     if (!this.tables.ContainsKey(tb.m_name))
     {
        this.tables.Add(tb.m_name, tb);
     }
     return true;
 }
示例#2
0
        //
        private bool initTables()
        {
            XmlTextReader xml = new XmlTextReader("Config\\tables.xml");
            XmlDocument doc = new XmlDocument();
            xml.Read();
            doc.Load(xml);

            //сначала считаем данные для базового потока
            XmlNodeList cnl = doc["tables"].ChildNodes;
            int countTables = cnl.Count;

            for (int i = 0; i < countTables; i++)
            {
                XmlAttributeCollection atr = cnl[i].Attributes;

                tableInfo tb = new tableInfo(atr["name"].Value);
                tb.l_dellAllType = atr["del_all_type"].Value;
                if (atr["use_broker_id"].Value=="1")
                    tb.l_UseBrokerId = true;

                if (atr["rev"].Value == "1")
                    tb.l_Rev = true;

                this.tablesT.Add(atr["name"].Value,atr["thread"].Value);

                this.parent.listSteams_Add(atr["name"].Value);

                if (this.DataBufferThreads.ContainsKey(atr["thread"].Value)){
                    DataBuffer db=(DataBuffer)this.DataBufferThreads[atr["thread"].Value];
                    db.addTable(tb);
                }
                else{
                    DataBuffer db=new DataBuffer(atr["thread"].Value,this);
                    this.parent.listDataThreads_Add(atr["thread"].Value);
                    db.addTable(tb);
                    this.DataBufferThreads.Add(atr["thread"].Value, db);
                }
            }

            xml.Close();
            System.Windows.Forms.Application.DoEvents();
            return true;
        }