static IntegrationTestHelper() { IDictionary <String, String> fontPathToNameMap = new Dictionary <String, String>(); fontPathToNameMap.Put(NOTO_SANS_FONT_PATH, "NotoSans"); fontPathToNameMap.Put(NOTO_SANS_THAI_FONT_PATH, "NotoSansThai"); fontPathToNameMap.Put(KOSUGI_FONT_PATH, "Kosugi"); fontPathToNameMap.Put(NOTO_SANS_SC_FONT_PATH, "NotoSansSC"); fontPathToNameMap.Put(CAIRO_FONT_PATH, "Cairo"); fontPathToNameMap.Put(FREE_SANS_FONT_PATH, "FreeSans"); FONT_PATH_TO_FONT_NAME_MAP = JavaCollectionsUtil.UnmodifiableMap(fontPathToNameMap); }
static CommonCssConstants() { IDictionary <String, String> keywordValues = new Dictionary <String, String>(); keywordValues.Put(CommonCssConstants.XX_SMALL, "9px"); keywordValues.Put(CommonCssConstants.X_SMALL, "10px"); keywordValues.Put(CommonCssConstants.SMALL, "13px"); keywordValues.Put(CommonCssConstants.MEDIUM, "16px"); keywordValues.Put(CommonCssConstants.LARGE, "18px"); keywordValues.Put(CommonCssConstants.X_LARGE, "24px"); keywordValues.Put(CommonCssConstants.XX_LARGE, "32px"); FONT_ABSOLUTE_SIZE_KEYWORDS_VALUES = JavaCollectionsUtil.UnmodifiableMap(keywordValues); }
public virtual void JavaCollectionsUtilTest() { IList <int> emptyList = JavaCollectionsUtil.EmptyList <int>(); Assert.IsEmpty(emptyList); Assert.Throws <NotSupportedException>(() => emptyList.Add(10)); IDictionary <int, int> emptyMap = JavaCollectionsUtil.EmptyMap <int, int>(); Assert.IsEmpty(emptyMap); Assert.Throws <NotSupportedException>(() => { emptyMap[5] = 10; }); IEnumerator <int> emptyIterator = JavaCollectionsUtil.EmptyIterator <int>(); Assert.False(emptyIterator.MoveNext()); IList <int> unmodifiableList = JavaCollectionsUtil.UnmodifiableList <int>(new int[] { 10, 20, 30, 20 }.ToList()); Assert.Throws <NotSupportedException>(() => unmodifiableList.Insert(0, 20)); Assert.Throws <NotSupportedException>(() => { unmodifiableList[2] = 50; }); int test = unmodifiableList[3]; Assert.Throws <NotSupportedException>(() => JavaCollectionsUtil.Sort(unmodifiableList)); IDictionary <int, int> unodifiableMap = JavaCollectionsUtil.UnmodifiableMap(new Dictionary <int, int>() { { 1, 20 }, { 2, 40 }, { 70, 80 }, }); test = unodifiableMap[2]; Assert.Throws <KeyNotFoundException>(() => { int temp = unodifiableMap[3]; }); Assert.Throws <NotSupportedException>(() => { unodifiableMap[11] = 11; }); IList <int> singletonList = JavaCollectionsUtil.SingletonList(4); Assert.AreEqual(4, singletonList[0]); Assert.Throws <NotSupportedException>(() => singletonList.Add(9)); List <int> x = new int[] { 60, 50, 20 }.ToList(); JavaCollectionsUtil.Sort(x); Assert.AreEqual(20, x[0]); Assert.AreEqual(60, x[2]); x = new int[] { -1, 0, 1 }.ToList(); JavaCollectionsUtil.Reverse(x); Assert.AreEqual(1, x[0]); Assert.AreEqual(0, x[1]); }
static FilterHandlers() { IDictionary <PdfName, IFilterHandler> map = new Dictionary <PdfName, IFilterHandler>(); map.Put(PdfName.FlateDecode, new FlateDecodeFilter()); map.Put(PdfName.Fl, new FlateDecodeFilter()); map.Put(PdfName.ASCIIHexDecode, new ASCIIHexDecodeFilter()); map.Put(PdfName.AHx, new ASCIIHexDecodeFilter()); map.Put(PdfName.ASCII85Decode, new ASCII85DecodeFilter()); map.Put(PdfName.A85, new ASCII85DecodeFilter()); map.Put(PdfName.LZWDecode, new LZWDecodeFilter()); map.Put(PdfName.CCITTFaxDecode, new CCITTFaxDecodeFilter()); map.Put(PdfName.Crypt, new DoNothingFilter()); map.Put(PdfName.RunLengthDecode, new RunLengthDecodeFilter()); defaults = JavaCollectionsUtil.UnmodifiableMap(map); }
static FilterHandlers() { // Dev note: we eventually want to refactor PdfReader so all of the existing filter functionality is moved into this class // it may also be better to split the sub-classes out into a separate package IDictionary <PdfName, IFilterHandler> map = new Dictionary <PdfName, IFilterHandler>(); map[PdfName.FlateDecode] = new FlateDecodeFilter(); map[PdfName.Fl] = new FlateDecodeFilter(); map[PdfName.ASCIIHexDecode] = new ASCIIHexDecodeFilter(); map[PdfName.AHx] = new ASCIIHexDecodeFilter(); map[PdfName.ASCII85Decode] = new ASCII85DecodeFilter(); map[PdfName.A85] = new ASCII85DecodeFilter(); map[PdfName.LZWDecode] = new LZWDecodeFilter(); map[PdfName.CCITTFaxDecode] = new CCITTFaxDecodeFilter(); map[PdfName.Crypt] = new DoNothingFilter(); map[PdfName.RunLengthDecode] = new RunLengthDecodeFilter(); defaults = JavaCollectionsUtil.UnmodifiableMap(map); }