+ public sealed class MultiFormatWriter : Writer\r
+ {\r
+ \r
+ public ByteMatrix encode(System.String contents, BarcodeFormat format, int width, int height)\r
+ {\r
+ \r
+ return encode(contents, format, width, height, null);\r
+ }\r
+ \r
+ public ByteMatrix encode(System.String contents, BarcodeFormat format, int width, int height, System.Collections.Hashtable hints)\r
+ {\r
+ \r
+ if (format == BarcodeFormat.EAN_8)\r
+ {\r
+ return new EAN8Writer().encode(contents, format, width, height, hints);\r
+ }\r
+ else if (format == BarcodeFormat.EAN_13)\r
+ {\r
+ return new EAN13Writer().encode(contents, format, width, height, hints);\r
+ }\r
+ else if (format == BarcodeFormat.QR_CODE)\r
+ {\r
+ return new QRCodeWriter().encode(contents, format, width, height, hints);\r
+ }\r
+ else\r
+ {\r
+ throw new System.ArgumentException("No encoder available for format " + format);\r
+ }\r
+ }\r
+ }\r
+}
\ No newline at end of file