System.Xml.Serialization.ReflectionXmlSerializationWriter.WriteArrayItems C# (CSharp) Method

WriteArrayItems() private method

private WriteArrayItems ( ElementAccessor elements, TextAccessor text, ChoiceIdentifierAccessor choice, TypeDesc arrayTypeDesc, object o ) : void
elements ElementAccessor
text TextAccessor
choice ChoiceIdentifierAccessor
arrayTypeDesc TypeDesc
o object
return void
        private void WriteArrayItems(ElementAccessor[] elements, TextAccessor text, ChoiceIdentifierAccessor choice, TypeDesc arrayTypeDesc, object o)
        {
            TypeDesc arrayElementTypeDesc = arrayTypeDesc.ArrayElementTypeDesc;

            var a = o as IEnumerable;

            //  #10593: This assert may not be true. We need more tests for this method.
            Debug.Assert(a != null);

            var e = a.GetEnumerator();

            if (e != null)
            {
                while (e.MoveNext())
                {
                    object ai = e.Current;
                    WriteElements(ai, null/*choiceName + "i"*/, elements, text, choice, (string)null/*arrayName + "a"*/, true, true);
                }
            }
        }