private Array ArraySetElementValue(int[] lengths, StreamExtractorHandler streamExtractor) //заполнение элементов массива значениями { IConcreteAction action = MakeActionForElementType(); var arrayIndex = new ArrayIterator(lengths); for (int i = 0; i < array.Length; i++) { object elementValue = action.Deserialize(streamExtractor); int[] indices = arrayIndex.GetNext(); array.SetValue(elementValue, indices); } return(array); }
object IConcreteAction.Deserialize(StreamExtractorHandler streamExtractor) { object recordObject = Activator.CreateInstance(type); FieldInfo[] fieldInfos = type.GetFields(); foreach (FieldInfo field in fieldInfos) { IConcreteAction action = ActionFactory.MakeAction(field.FieldType); object fieldValue = action.Deserialize(streamExtractor); field.SetValue(recordObject, fieldValue); } return(recordObject); }
internal object ObjectRecord(Type type) { IConcreteAction action = ActionFactory.MakeAction(type); return(action.Deserialize(StreamExtractor)); }