コード例 #1
0
        internal static CharDictionary Deserialize(BinaryReader binaryReader)
        {
            CharDictionary dictionary = new CharDictionary();

            binaryReader.ReadInt32();
            dictionary.Length = binaryReader.ReadInt32();
            dictionary.Count  = binaryReader.ReadInt32();
            dictionary.Offset = binaryReader.ReadInt16();
            binaryReader.ReadBytes(0x18);
            dictionary.CharUnitTable = new List <CharUnit>();
            for (int i = 0; i < dictionary.Count; i++)
            {
                dictionary.CharUnitTable.Add(CharUnit.Deserialize(binaryReader));
            }
            binaryReader.ReadInt16();
            return(dictionary);
        }
コード例 #2
0
        static ChineseChar()
        {
            using (var stream = new MemoryStream(Properties.Resources.CharDictionary))
                using (var reader = new BinaryReader(stream))
                    charDictionary = CharDictionary.Deserialize(reader);

            using (var stream = new MemoryStream(Properties.Resources.HomophoneDictionary))
                using (var reader = new BinaryReader(stream))
                    homophoneDictionary = HomophoneDictionary.Deserialize(reader);

            using (var stream = new MemoryStream(Properties.Resources.PinyinDictionary))
                using (var reader = new BinaryReader(stream))
                    pinyinDictionary = PinyinDictionary.Deserialize(reader);

            using (var stream = new MemoryStream(Properties.Resources.StrokeDictionary))
                using (var reader = new BinaryReader(stream))
                    strokeDictionary = StrokeDictionary.Deserialize(reader);
        }
コード例 #3
0
        internal static CharDictionary Deserialize(BinaryReader binaryReader)
        {
            CharDictionary charDictionary = new CharDictionary();

            binaryReader.ReadInt32();
            charDictionary.Length = binaryReader.ReadInt32();
            charDictionary.Count  = binaryReader.ReadInt32();
            charDictionary.Offset = binaryReader.ReadInt16();
            binaryReader.ReadBytes(24);
            charDictionary.CharUnitTable = new List <CharUnit>();
            for (int index = 0; index < charDictionary.Count; ++index)
            {
                charDictionary.CharUnitTable.Add(CharUnit.Deserialize(binaryReader));
            }
            var num = binaryReader.ReadInt16();

            return(charDictionary);
        }