示例#1
0
        public override void ApplyState(VObject obj)
        {
            // Backward compatibility
            Path textPath;

            if (TPth == null && Pth != null)
            {
                textPath = Path.FromSvgString(Pth);
                Pth      = null;
            }
            else
            {
                textPath = Path.FromSvgString(TPth);
            }

            base.ApplyState(obj);

            var t = (CurvedTextVObject)obj;

            t.TextPath         = textPath;
            t.FitToPath        = FTP;
            t.Stretch          = Str;
            t.OriginalFontSize = OFS;
            t.FitToPathStep    = FTPS;
            t.ActualAngle      = AA;
            t.PathStart        = PS;
            t.PathEnd          = PE;
        }
示例#2
0
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);
            var s = (SvgVObject)obj;

            s.Svg         = HttpUtility.HtmlDecode(S);
            s.StrokeColor = SC;
        }
示例#3
0
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);

            var t = (PathBoundedTextVObject)obj;

            t.BoundingPaths = BP != null?BP.Select(Path.FromSvgString).ToArray() : null;

            t.IsVertical = IV;
        }
示例#4
0
 public virtual void ApplyState(VObject obj)
 {
     obj.Name          = N;
     obj.Locked        = L;
     obj.Visible       = V;
     obj.ControlPoints = P;
     obj.Transform.Copy(T);
     obj.Tag         = Tg;
     obj.UniqueId    = ID;
     obj.Permissions = Prm;
 }
示例#5
0
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);

            var t = (BoundedTextVObject)obj;

            t.WrappingRectangles = WR;
            t.WrappingMargin     = WM;
            t.ParagraphSettings  = PS;
            t.VerticalAlignment  = VA;
            t.IsVertical         = IV;
        }
示例#6
0
 public VObjectData(VObject obj)
 {
     if (obj != null)
     {
         N   = obj.Name;
         L   = obj.Locked;
         V   = obj.Visible;
         P   = obj.ControlPoints;
         T   = obj.Transform;
         Tg  = obj.Tag;
         ID  = obj.UniqueId;
         Prm = (Permission)obj.Permissions;
     }
 }
示例#7
0
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);
            var p = (PlaceholderVObject)obj;

            p.ShowMaskedContent = SMC;
            p.IsStubContent     = ISC;

            var type = CT != null?Type.GetType(typeof(VObject).Namespace + "." + CT) : null;

            if (type == null)
            {
                return;
            }

            var content = (ContentVObject)Activator.CreateInstance(type);

            content.Data = CD;
            p.Content    = content;
        }
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);

            var s = (ShapeVObject)obj;

            // Backward compatibility
            if (Pth == null)
            {
                var rectangle = new RectangleF(P[0].X, P[0].Y, P[1].X - P[0].X, P[1].Y - P[0].Y);
                s.Path = obj is EllipseVObject?Path.CreateEllipsePath(rectangle) : Path.CreateRectanglePath(rectangle);
            }
            else
            {
                s.Path = Path.FromSvgString(Pth);
            }

            s.FillColor        = FC;
            s.BorderColor      = BC;
            s.BorderWidth      = BW;
            s.FixedBorderWidth = FBW;
        }
示例#9
0
        public static VObject CreateVObject(
            PsdFrame frame,
            bool skipGroupPrefix = false,
            Regex markersRegex   = null,
            bool forceRichText   = false,
            bool getRichTextForBoundedTextOnly = false)
        {
            if (frame == null)
            {
                throw new ArgumentNullException("frame");
            }

            VObject vObject = null;

            switch (frame.Type)
            {
            case FrameType.Group:
                break;

            case FrameType.Text:
                vObject = CreateTextVObject((PsdTextFrame)frame, forceRichText, getRichTextForBoundedTextOnly);
                break;

            case FrameType.Shape:
                vObject = CreateShapeVObject((PsdShapeFrame)frame);
                break;

            default:
                vObject = CreateImageVObject(frame);
                break;
            }

            if (vObject != null)
            {
                vObject.Name = GetVObjectName(frame, skipGroupPrefix, markersRegex);
            }

            return(vObject);
        }