Пример #1
0
        public static Ellipse ReadEllipse(this MsgPackReader reader)
        {
            var ellipse = new Ellipse();

            reader.ReadPrefix(TypePrefixes.FixMap);
            for (int i = 0; i < 3; i++)
            {
                var key = reader.ReadString();
                switch (key)
                {
                case "center": ellipse.Center = reader.ReadPoint2d(); break;

                case "angle": ellipse.Angle = reader.ReadDouble(); break;

                case "axes": ellipse.Axes = reader.ReadPoint2d(); break;

                default: throw new InvalidOperationException(Resources.ParseError);
                }
            }
            return(ellipse);
        }