コード例 #1
0
 internal Spire.Doc.Fields.TextBox method_69()
 {
     if (this.AutoShapeTextCollection.Count <= 0)
     {
         return(null);
     }
     Spire.Doc.Fields.TextBox box = this.AutoShapeTextCollection[0].Clone() as Spire.Doc.Fields.TextBox;
     box.method_0(this.method_74());
     box.Format.Width               = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Width) / 20f) : ((float)base.Width);
     box.Format.Height              = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Height) / 20f) : ((float)base.Height);
     box.Format.TextWrappingStyle   = this.TextWrappingStyle;
     box.Format.TextWrappingType    = this.TextWrappingType;
     box.Format.HorizontalAlignment = this.HorizontalAlignment;
     box.Format.VerticalAlignment   = this.VerticalAlignment;
     box.Format.HorizontalOrigin    = this.HorizontalOrigin;
     box.Format.VerticalOrigin      = this.VerticalOrigin;
     box.Format.HorizontalPosition  = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Left) / 20f) : ((float)base.Left);
     box.Format.VerticalPosition    = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (((float)base.Top) / 20f) : ((float)base.Top);
     box.Format.OrderIndex          = (base.Owner.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup) ? (base.Owner as ShapeGroup).ZOrderEx : base.ZOrderEx;
     box.Format.NoLine              = true;
     box.Format.FillColor           = Color.Empty;
     box.Format.LineWidth           = 0f;
     box.Format.LineColor           = Color.Empty;
     box.Format.FillEfects.Type     = BackgroundType.NoBackground;
     box.Format.IsInShape           = true;
     return(box);
 }
コード例 #2
0
        private Spire.Doc.Fields.TextBox method_71(ShapeObject A_0)
        {
            if (((A_0 == null) || (A_0.InternerTextbox == null)) || (A_0.InternerTextbox.ChildObjects.Count <= 0))
            {
                return(null);
            }
            Spire.Doc.Fields.TextBox box   = A_0.InternerTextbox.Clone() as Spire.Doc.Fields.TextBox;
            DocumentObject           owner = A_0.Owner;
            ShapeGroup    group            = null;
            List <PointF> list             = new List <PointF> {
                A_0.BoundsInPoints.Location
            };

            while (owner != null)
            {
                if (owner is Paragraph)
                {
                    break;
                }
                if (owner is ShapeGroup)
                {
                    group = owner as ShapeGroup;
                    list.Add(group.BoundsInPoints.Location);
                }
                owner = owner.Owner;
            }
            PointF tf = new PointF();

            if (list.Count > 1)
            {
                int num   = 1;
                int count = list.Count;
                while (num < count)
                {
                    PointF tf3 = list[num - 1];
                    PointF tf4 = list[num];
                    PointF tf5 = list[num - 1];
                    PointF tf6 = list[num];
                    PointF tf2 = new PointF(tf3.X - tf4.X, tf5.Y - tf6.Y);
                    tf.X += tf2.X;
                    tf.Y += tf2.Y;
                    num++;
                }
            }
            list = null;
            bool flag = (group != null) && (group.DocumentObjectType == Spire.Doc.Documents.DocumentObjectType.ShapeGroup);

            box.method_0(owner);
            if (flag)
            {
                box.Format.Width  = A_0.BoundsInPoints.Width;
                box.Format.Height = A_0.BoundsInPoints.Height;
                if (flag)
                {
                    box.Format.HorizontalAlignment = group.HorizontalAlignment;
                    box.Format.VerticalAlignment   = group.VerticalAlignment;
                    box.Format.HorizontalOrigin    = group.HorizontalOrigin;
                    box.Format.VerticalOrigin      = group.VerticalOrigin;
                    box.Format.HorizontalPosition  = tf.X;
                    box.Format.VerticalPosition    = tf.Y;
                    box.Format.OrderIndex          = group.ZOrderEx;
                }
                else
                {
                    box.Format.HorizontalPosition = A_0.HorizontalPosition;
                    box.Format.VerticalPosition   = A_0.VerticalPosition;
                    box.Format.OrderIndex         = A_0.ZOrderEx;
                }
            }
            box.Format.IsInShape      = true;
            box.ShapeInfo             = flag ? group : A_0;
            box.Format.IsInGroupShape = flag;
            if (A_0.TextBox != null)
            {
                box.Format.TextAnchor            = this.method_73(A_0.TextBox.method_14());
                box.Format.TextBoxWrapMode       = A_0.TextBox.method_12();
                box.Format.IsFitShapeToText      = A_0.TextBox.method_8();
                box.Format.InternalMargin.Bottom = (float)A_0.TextBox.method_6();
                box.Format.InternalMargin.Left   = (float)A_0.TextBox.method_0();
                box.Format.InternalMargin.Right  = (float)A_0.TextBox.method_2();
                box.Format.InternalMargin.Top    = (float)A_0.TextBox.method_4();
                box.Format.LayoutFlowAlt         = this.method_72(A_0.TextBox.method_10());
            }
            return(box);
        }