Пример #1
0
        public override void AddToTree(Shape s, bool allowAddInChildren)
        {
            string rationallyType = s.CellsU[VisioFormulas.Cell_RationallyType].ResultStr["Value"];

            if (AuthorLabel.IsAuthorLabel(s.Name))
            {
                Children.Add(new AuthorLabel(Page, s));
            }
            else if (DateLabel.IsDateLabel(s.Name))
            {
                Children.Add(new DateLabel(Page, s));
            }
            else if (VersionLabel.IsVersionLabel(s.Name))
            {
                Children.Add(new VersionLabel(Page, s));
            }
            else if (TextLabel.IsTextLabel(s.Name) && ((rationallyType == "informationVersionLabel") || (rationallyType == "informationDateLabel") || (rationallyType == "informationAuthorLabel")))
            {
                Children.Add(new PaddedTextLabel(Page, s));
            }
        }
Пример #2
0
        public InformationContainer(Page page, Shape s) : base(page, false)
        {
            Shape = s;
            RationallyModel model = Globals.RationallyAddIn.Model;

            if ((s.ContainerProperties.GetMemberShapes((int)VisContainerFlags.visContainerFlagsExcludeNested).Length == 0) && !Globals.RationallyAddIn.Application.IsUndoingOrRedoing)
            {
                InitContent(page, model.Author, model.DateString, model.Version);
            }
            else
            {
                Array        ident  = Shape.ContainerProperties.GetMemberShapes((int)VisContainerFlags.visContainerFlagsExcludeNested);
                List <Shape> shapes = (new List <int>((int[])ident)).Select(i => page.Shapes.ItemFromID[i]).ToList();
                foreach (Shape shape in shapes)
                {
                    if (TextLabel.IsTextLabel(shape.Name))
                    {
                        Children.Add(new PaddedTextLabel(page, shape));
                    }
                    else if (AuthorLabel.IsAuthorLabel(shape.Name))
                    {
                        Children.Add(new AuthorLabel(page, shape));
                        model.Author = shape.Text;
                    }
                    else if (DateLabel.IsDateLabel(shape.Name))
                    {
                        Children.Add(new DateLabel(page, shape));
                        model.DateString = shape.Text;
                    }
                    else if (VersionLabel.IsVersionLabel(shape.Name))
                    {
                        Children.Add(new VersionLabel(page, shape));
                        model.Version = shape.Text;
                    }
                }
                Children = Children.OrderBy(c => c.Order).ToList();
            }
        }