public ForceHeaderRow(Page page, Shape forceHeaderShape) : base(page, false) { Shape = forceHeaderShape; Array ident = forceHeaderShape.ContainerProperties.GetMemberShapes((int)VisContainerFlags.visContainerFlagsExcludeNested); List <Shape> shapes = new List <int>((int[])ident).Select(i => page.Shapes.ItemFromID[i]).ToList(); if (Children.Count == 0) { foreach (Shape shape in shapes) { if (ForceAlternativeHeaderComponent.IsForceAlternativeHeaderComponent(shape.Name)) { Children.Add(new ForceAlternativeHeaderComponent(page, shape)); } else if (shape.CellExistsU[VisioFormulas.Cell_RationallyType, (short)VisExistsFlags.visExistsAnywhere] == Constants.CellExists) { VisioShape toAdd = new VisioShape(page) { Shape = shape }; Children.Add(toAdd); } } } MarginTop = 0.4; UsedSizingPolicy |= SizingPolicy.ShrinkYIfNeeded | SizingPolicy.ExpandXIfNeeded; LayoutManager = new InlineLayout(this); }
public override void AddToTree(Shape s, bool allowAddOfSubpart) { if (ForceAlternativeHeaderComponent.IsForceAlternativeHeaderComponent(s.Name)) { ForceAlternativeHeaderComponent com = new ForceAlternativeHeaderComponent(Page, s); int index = com.Shape.Text[0] - 63;//text is of the form "A:"; A = 65 and should be inserted at index 2, after the concern and desc column if (Children.Count < index) { Children.Add(com); } else { Children.Insert(index, com); } } }