|
I follow the sample code in the Entities sample for the most part in creating anchor points.
// set connection points ArrayList al = new ArrayList(); //t is the Mindfusion table control for (int i = 0; i < t.RowCount; i++) { al.Clear(); //B.block.InputList contains the collection of inputs. //There could be several outputs if (i < B.block.InputsList.Count) { t[0, i].PicturePos = ImageAlign.Center; t[0, i].Picture = images.Images[0]; IOInfo input = B.block.InputsList[i] as IOInfo; t[1, i].Text = input.Id.ToString(); AnchorPoint ptin = new AnchorPoint(50, 50, false, true, Color.Red, 0, input.Id); ptin.MarkStyle = MarkStyle.None; al.Add(ptin); } //B.block.OutputList contains the collection of //outputs. Usally there will be only one output.
if (i < B.block.OutputsList.Count) { t[3, i].PicturePos = ImageAlign.Center; t[3, i].Picture = images.Images[1]; IOInfo output = B.block.OutputsList[i] as IOInfo; t[2, i].Text = output.Id.ToString(); t[2, i].TextFormat.Alignment = StringAlignment.Far; AnchorPoint ptout = new AnchorPoint(50, 50, true, false, Color.Red, 3, output.Id); ptout.MarkStyle = MarkStyle.None; al.Add(ptout); }
t.Rows[i].AnchorPattern = new AnchorPattern( (AnchorPoint[])al.ToArray(typeof(AnchorPoint)));
|