public ExtensionNode ReadNode(TreeNode tnode, string addin, ExtensionNodeType ntype, ExtensionNodeDescription elem, ModuleDescription module)
{
try {
if (ntype.Type == null) {
if (!InitializeNodeType (ntype))
return null;
}
ExtensionNode node;
node = Activator.CreateInstance (ntype.Type) as ExtensionNode;
if (node == null) {
addinEngine.ReportError ("Extension node type '" + ntype.Type + "' must be a subclass of ExtensionNode", addin, null, false);
return null;
}
tnode.AttachExtensionNode (node);
node.SetData (addinEngine, addin, ntype, module);
node.Read (elem);
return node;
}
catch (Exception ex) {
addinEngine.ReportError ("Could not read extension node of type '" + ntype.Type + "' from extension path '" + tnode.GetPath() + "'", addin, ex, false);
return null;
}
}