Esempio n. 1
0
        public override void Read(Stream stream, int count, FrameContent content)
        {
            CodecState state     = new CodecState();
            CodecItem  codecItem = CodecItemByFrameId(FrameId);

            (content as FrameContentText).Text = codecItem.Read(state, stream) as string;
        }
Esempio n. 2
0
        public override void Write(Stream stream, FrameContent content)
        {
            CodecState state     = new CodecState();
            CodecItem  codecItem = CodecItemByFrameId(FrameId);

            codecItem.Write(state, stream, (content as FrameContentText).Text);
        }
Esempio n. 3
0
        private static CodecItem CodecItemByFrameId(string frameId)
        {
            if (!codecItemsByFrameId.ContainsKey(frameId))
            {
                codecItemsByFrameId[frameId] = new CodecItem(
                    CreateSerializerByFrameId(frameId),
                    CreateConverterByFrameId(frameId),
                    CodecItem.Dsts.Content,
                    ContentPropertyNameByFrameId(frameId));
            }

            return(codecItemsByFrameId[frameId]);
        }
Esempio n. 4
0
        public override void Read(Stream stream, int count, FrameContent content)
        {
            state.ItemCount = codecItems.Count;

            for (state.ItemIndex = 0; state.ItemIndex < state.ItemCount; state.ItemIndex++)
            {
                CodecItem entry = codecItems[state.ItemIndex];

                object value  = entry.Read(state, stream);
                object target = ObjectByTarget(entry.DestinationObject, content);
                SetProperty(PropInfo(target, entry.PropertyName), target, value);
            }
        }