/// <exception cref="ArgumentException">
/// <paramref name="memberType"/> is empty string.
/// </exception>
/// <exception cref="ArgumentNullException">
/// <paramref name="list"/> is null.-or-
/// <paramref name="memberType"/> is null.-or-
/// <paramref name="node"/> is null.-or-
/// <paramref name="parent"/> is null.
/// </exception>
internal static void LoadMembers <T>(IList <T> list, string memberType, XmlNode node,
OperationContainer parent) where T : Member
{
if (list == null)
{
throw new ArgumentNullException("list");
}
if (memberType == null)
{
throw new ArgumentNullException("memberType");
}
if (node == null)
{
throw new ArgumentNullException("node");
}
if (parent == null)
{
throw new ArgumentNullException("parent");
}
if (memberType == "")
{
throw new ArgumentException(
"error_empty_string", "memberType");
}
XmlElement child = node[memberType];
while (child != null)
{
if (child.Name == memberType)
{
string name = child.GetAttribute("name");
string type = child.GetAttribute("type");
try
{
Member member = GetMemberFromName(type, name, parent);
member.InitFromString(child.InnerText);
list.Add((T)member);
}
catch
{
// Skips incorrect node
}
}
child = child.NextSibling as XmlElement;
}
}