Пример #1
0
        private void Write(ISwfStreamWriter writer, IShapeRecord record, bool allowBigArray, ref uint fillBitsCount, ref uint lineBitsCount)
        {
            var ctx = new ShapeRecordWriteContext {
                FillStyleBits = fillBitsCount,
                LineStyleBits = lineBitsCount,
                AllowBigArray = allowBigArray,
                Writer        = writer
            };

            ctx           = record.AcceptVisitor(this, ctx);
            fillBitsCount = ctx.FillStyleBits;
            lineBitsCount = ctx.LineStyleBits;
        }
Пример #2
0
 public static void AreEqual(IShapeRecord expected, IShapeRecord actual, string message)
 {
     if (expected is StyleChangeShapeRecord && actual is StyleChangeShapeRecord)
     {
         AreEqual((StyleChangeShapeRecord)expected, (StyleChangeShapeRecord)actual, message);
     }
     else if (expected is StraightEdgeShapeRecord && actual is StraightEdgeShapeRecord)
     {
         AreEqual((StraightEdgeShapeRecord)expected, (StraightEdgeShapeRecord)actual, message);
     }
     else if (expected is EndShapeRecord && actual is EndShapeRecord)
     {
         AreEqual((EndShapeRecord)expected, (EndShapeRecord)actual, message);
     }
     else
     {
         throw new NotSupportedException(string.Format("{0}: Can't compare {1} and {2}", message,
                                                       expected.GetType(), actual.GetType()));
     }
 }
Пример #3
0
 public static XElement ToXml(IShapeRecord shapeRecord)
 {
     return(shapeRecord.AcceptVisitor(_writer, null));
 }