Exemple #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;
        }
Exemple #2
0
        public override void ApplyState(VObject obj)
        {
            base.ApplyState(obj);
            var s = (SvgVObject)obj;

            s.Svg         = HttpUtility.HtmlDecode(S);
            s.StrokeColor = SC;
        }
Exemple #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;
        }
Exemple #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;
 }
Exemple #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;
        }
Exemple #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;
     }
 }
Exemple #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;
        }
        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);
        }