Esempio n. 1
0
 public virtual void Add(ItemClass c)
 {
     if (false == this.Children.ContainsKey(c.ID))
     {
         this.Children.Add(c.ID, c);
         c.Group = this;
     }
 }
Esempio n. 2
0
 public void Init(ItemClass i)
 {
     this.item = i;
     this.Text = this.Item.Name;
     this.ImageIndex = this.IsGroup() ? 0 : 1;
     this.SelectedImageIndex = this.ImageIndex;
     if (this.Item is GroupClass) {
         return;
     }
     CameraClass c = this.Item as CameraClass;
     if (c != null)
     {
         Motion.PlugIns.IPlugInVideoSource s = c.PlugInVideoSource;
         if (s != null)
         {
             this.ToolTipText = s.LabelText;
         }
     }
 }
Esempio n. 3
0
        public CameraTreeNode FindCameraTreeNode(ItemClass c, TreeNode node)
        {
            TreeNodeCollection nodes;
            CameraTreeNode r = null;

            nodes = (node == null) ? this.treeViewCamera.Nodes : node.Nodes;
            foreach (TreeNode n in nodes)
            {
                if (n is CameraTreeNode)
                {
                    CameraTreeNode t = (CameraTreeNode)n;
                    if (t.Item.ID == c.ID)
                    {
                        return t;
                    }
                    r = FindCameraTreeNode(c, n);
                    if (r != null)
                    {
                        return r;
                    }
                }
            }
            return null;
        }
Esempio n. 4
0
 public CameraTreeNode(ItemClass i)
 {
     this.Init(i);
 }
Esempio n. 5
0
 private CameraTreeNode NodeAdd(ItemClass c)
 {
     CameraTreeNode p = this.GetSelectedGroupNode();
     return this.NodeAdd(c, p);
 }
Esempio n. 6
0
        private CameraTreeNode NodeAdd(ItemClass c, CameraTreeNode p)
        {
            if (c is CameraClass && this.AtTheEdge()) {
                return null;
            }
            CameraTreeNode n;
            n = new CameraTreeNode(c);
            if (p == null)
            {
                this.treeViewCamera.Nodes.Add(n);
                RootClass.Instance.Add(c);
            }
            else
            {
                GroupClass g = p.Item as GroupClass;
                g.Add(c);
                p.Nodes.Add(n);
            }

            this.treeViewCamera.SelectedNode = n;
            return n;
        }