Пример #1
0
        private EllipseItem DeserializeEllipse(string[] m)
        {
            var ellipseItem = new EllipseItem();

            ellipseItem.Id       = int.Parse(m[1]);
            ellipseItem.X        = double.Parse(m[2]);
            ellipseItem.Y        = double.Parse(m[3]);
            ellipseItem.Width    = double.Parse(m[4]);
            ellipseItem.Height   = double.Parse(m[5]);
            ellipseItem.IsFilled = bool.Parse(m[6]);
            ellipseItem.Stroke   = new ItemColor()
            {
                Alpha = byte.Parse(m[7]),
                Red   = byte.Parse(m[8]),
                Green = byte.Parse(m[9]),
                Blue  = byte.Parse(m[10])
            };
            ellipseItem.Fill = new ItemColor()
            {
                Alpha = byte.Parse(m[11]),
                Red   = byte.Parse(m[12]),
                Green = byte.Parse(m[13]),
                Blue  = byte.Parse(m[14])
            };
            return(ellipseItem);
        }
Пример #2
0
 public void Serialize(StringBuilder sb, EllipseItem ellipse, string indent, ItemSerializeOptions options)
 {
     sb.Append(indent);
     sb.Append("ELLIPSE");
     sb.Append(options.ModelSeparator);
     sb.Append(ellipse.Id);
     sb.Append(options.ModelSeparator);
     sb.Append(ellipse.X);
     sb.Append(options.ModelSeparator);
     sb.Append(ellipse.Y);
     sb.Append(options.ModelSeparator);
     sb.Append(ellipse.Width);
     sb.Append(options.ModelSeparator);
     sb.Append(ellipse.Height);
     sb.Append(options.ModelSeparator);
     sb.Append(ellipse.IsFilled);
     sb.Append(options.ModelSeparator);
     Serialize(sb, ellipse.Stroke, options);
     sb.Append(options.ModelSeparator);
     Serialize(sb, ellipse.Fill, options);
     sb.Append(options.LineSeparator);
 }
Пример #3
0
 public void Move(EllipseItem ellipse, double x, double y)
 {
     ellipse.X += x;
     ellipse.Y += y;
 }