internal Member(XmlSerializationReaderCodeGen outerClass, string source, string arraySource, string arrayName, int i, MemberMapping mapping, bool multiRef, string choiceSource) {
this.source = source;
this.arrayName = arrayName + "_" + i.ToString(CultureInfo.InvariantCulture);
this.choiceArrayName = "choice_" + this.arrayName;
this.choiceSource = choiceSource;
ElementAccessor[] elements = mapping.Elements;
if (mapping.TypeDesc.IsArrayLike) {
if (arraySource != null)
this.arraySource = arraySource;
else
this.arraySource = outerClass.GetArraySource(mapping.TypeDesc, this.arrayName, multiRef);
isArray = mapping.TypeDesc.IsArray;
isList = !isArray;
if (mapping.ChoiceIdentifier != null) {
this.choiceArraySource = outerClass.GetArraySource(mapping.TypeDesc, this.choiceArrayName, multiRef);
string a = choiceArrayName;
string c = "c" + a;
bool choiceUseReflection = mapping.ChoiceIdentifier.Mapping.TypeDesc.UseReflection;
string choiceTypeFullName = mapping.ChoiceIdentifier.Mapping.TypeDesc.CSharpName;
string castString = choiceUseReflection?"":"(" + choiceTypeFullName + "[])";
string init = a + " = " + castString +
"EnsureArrayIndex(" + a + ", " + c + ", " + outerClass.RaCodeGen.GetStringForTypeof(choiceTypeFullName, choiceUseReflection) + ");";
this.choiceArraySource = init + outerClass.RaCodeGen.GetStringForArrayMember(a, c + "++", mapping.ChoiceIdentifier.Mapping.TypeDesc);
}
else {
this.choiceArraySource = this.choiceSource;
}
}
else {
this.arraySource = arraySource == null ? source : arraySource;
this.choiceArraySource = this.choiceSource;
}
this.mapping = mapping;
}