void AddChildExtensions (AddinDescription conf, ModuleDescription module, AddinUpdateData updateData, string path, ExtensionNodeDescriptionCollection nodes, bool conditionChildren) { // Don't register conditions as extension nodes. if (!conditionChildren) updateData.RegisterExtension (conf, module, path); foreach (ExtensionNodeDescription node in nodes) { if (node.NodeName == "ComplexCondition") continue; relExtensionNodes++; string id = node.GetAttribute ("id"); if (id.Length != 0) AddChildExtensions (conf, module, updateData, path + "/" + id, node.ChildNodes, node.NodeName == "Condition"); } }
// Collects extension data in a hash table. The key is the path, the value is a list // of add-ins ids that extend that path void CollectExtensionData (AddinDescription conf, AddinUpdateData updateData) { foreach (ExtensionNodeSet nset in conf.ExtensionNodeSets) { try { updateData.RegisterNodeSet (conf, nset); relNodeSetTypes++; } catch (Exception ex) { throw new InvalidOperationException ("Error reading node set: " + nset.Id, ex); } } foreach (ExtensionPoint ep in conf.ExtensionPoints) { try { updateData.RegisterExtensionPoint (conf, ep); relExtensionPoints++; } catch (Exception ex) { throw new InvalidOperationException ("Error reading extension point: " + ep.Path, ex); } } foreach (ModuleDescription module in conf.AllModules) { foreach (Extension ext in module.Extensions) { relExtensions++; updateData.RegisterExtension (conf, module, ext); AddChildExtensions (conf, module, updateData, ext.Path, ext.ExtensionNodes, false); } } }
void CollectModuleExtensionData(AddinDescription conf, ModuleDescription module, AddinUpdateData updateData, AddinIndex index) { foreach (Extension ext in module.Extensions) { updateData.RelExtensions++; updateData.RegisterExtension (conf, module, ext); AddChildExtensions (conf, module, updateData, index, ext.Path, ext.ExtensionNodes, false); } }
void AddChildExtensions(AddinDescription conf, ModuleDescription module, AddinUpdateData updateData, AddinIndex index, string path, ExtensionNodeDescriptionCollection nodes, bool conditionChildren) { // Don't register conditions as extension nodes. if (!conditionChildren) updateData.RegisterExtension (conf, module, path); foreach (ExtensionNodeDescription node in nodes) { if (node.NodeName == "ComplexCondition") continue; updateData.RelExtensionNodes++; string id = node.GetAttribute ("id"); if (id.Length != 0) { bool isCondition = node.NodeName == "Condition"; if (isCondition) { // Find the add-in that provides the implementation for this condition. // Store that id in the condition. The add-in engine will ensure the add-in // is loaded when it tries to evaluate this condition. var condAsm = index.FindCondition (conf, module, id); if (condAsm != null) node.SetAttribute (Condition.SourceAddinAttribute, condAsm); } AddChildExtensions (conf, module, updateData, index, path + "/" + id, node.ChildNodes, isCondition); } } }
void CollectExtensionData (AddinDescription conf, AddinUpdateData updateData) { foreach (ModuleDescription module in conf.AllModules) { foreach (Extension ext in module.Extensions) { updateData.RelExtensions++; updateData.RegisterExtension (conf, module, ext); AddChildExtensions (conf, module, updateData, ext.Path, ext.ExtensionNodes, false); } } }