示例#1
0
        private void SetViewRelation(int index, CompExtention.ComponentRelation co)
        {
            // var co = new CompExtention.ViewComponent() { ComponentID = "", ChildComponentID = "" };
            //view.Components.Add(co);
            int defaultHeight = 25;
            var h             = 0;

            foreach (Control c in grContainer.Controls)
            {
                h = c.Height + h;
            }
            if (index != 0)
            {
                var r = new ViewRelation(co, connection);
                r.Name     = "r_" + index;
                r.Location = new Point(10, 20 + h);
                r.Height   = defaultHeight;
                //r.OnHeightChanged += heighchanged;
                //r.OnRelationItemRemove += relationitemremoved;
                grContainer.Controls.Add(r);
            }
            else
            {
                var r = new ViewRelation(co, connection);
                r.Name     = "r_" + index;
                r.Location = new Point(10, 20);
                r.Height   = defaultHeight;
                //r.OnRelationItemRemove += relationitemremoved;
                //r.OnHeightChanged += heighchanged;
                grContainer.Controls.Add(r);
            }
        }
 public ViewRelation(CompExtention.ComponentRelation vc, string connection)
 {
     InitializeComponent();
     Connection = connection;
     Component  = vc;
 }