Exemple #1
0
 public void AddItem(ItemSignal v)
 {
     if (v.cName == null)
     {
         v.cName = "";
     }
     this.Items.Add(v.cName);
     this.list.Add(v);
 }
Exemple #2
0
        public bool MatchItem(List <ItemSignal> l, ItemSignal a)
        {
            bool b = false;
            int  i;

            for (i = 0; i < l.Count; i++)
            {
                if (a.cName == l[i].cName)
                {
                    b = true;
                }
            }
            return(b);
        }
Exemple #3
0
 public void DownItem(int index)
 {
     if (index == this.Items.Count - 1)
     {
     }
     else
     {
         v = this.Items[index] as string;
         a = this.list[index];
         this.Items.RemoveAt(index);
         this.list.RemoveAt(index);
         this.Items.Insert(index + 1, v);
         this.list.Insert(index + 1, a);
     }
 }
Exemple #4
0
 public void UpItem(int index)
 {
     if (index == 0)
     {
     }
     else
     {
         v = this.Items[index] as string;
         a = this.list[index];
         this.Items.RemoveAt(index);
         this.list.RemoveAt(index);
         this.Items.Insert(index - 1, v);
         this.list.Insert(index - 1, a);
     }
 }
        public void InsertLine(int pos, int level, ItemSignal cc)
        {
            TreeNodeHard aa = new TreeNodeHard();

            aa.SelectedImageIndex = cc.imageindex;
            aa.ImageIndex         = cc.imageindex;
            aa.isl = cc;

            if (level == -1)
            {
                aa.Text = cc.cName;
                base.Nodes.Add(aa);
            }
            else
            {
                aa.Text = cc.cName;

                if (m_lastnode.Level == cc.level)
                {
                    m_lastnode.Parent.Nodes.Add(aa);
                }
                else if (m_lastnode.Level > cc.level)
                {
                    while (m_lastnode.Level > cc.level)
                    {
                        m_lastnode = (TreeNodeHard)m_lastnode.Parent;
                    }

                    m_lastnode.Parent.Nodes.Add(aa);
                }
                else
                {
                    m_lastnode.Nodes.Add(aa);
                }
            }

            m_lastnode = aa;
            base.ExpandAll();
        }