Array GetChildObjectsInternal(Type arrayElementType, bool reuseCachedInstance)
{
ArrayList list = new ArrayList(ChildNodes.Count);
for (int n = 0; n < ChildNodes.Count; n++)
{
InstanceExtensionNode node = ChildNodes [n] as InstanceExtensionNode;
if (node == null)
{
addinEngine.ReportError("Error while getting object for node in path '" + Path + "'. Extension node is not a subclass of InstanceExtensionNode.", null, null, false);
continue;
}
try {
if (reuseCachedInstance)
{
list.Add(node.GetInstance(arrayElementType));
}
else
{
list.Add(node.CreateInstance(arrayElementType));
}
}
catch (Exception ex) {
addinEngine.ReportError("Error while getting object for node in path '" + Path + "'.", node.AddinId, ex, false);
}
}
return(list.ToArray(arrayElementType));
}