public void ParseFamily(XmlElement familyElement) { TypePath typePath = TypePath.CreateFromXmlNode(familyElement); _builder.ConfigureFamily(typePath, family => { family.DefaultInstanceKey = familyElement.GetAttribute(DEFAULT_KEY_ATTRIBUTE); InstanceScope scope = findScope(familyElement); family.SetScopeTo(scope); attachMementoSource(family, familyElement); attachPlugins(family, familyElement); attachInterceptors(family, familyElement); attachInstances(family, familyElement, _builder); }); }
private void attachPlugin(XmlElement pluginElement, PluginFamily family) { TypePath pluginPath = TypePath.CreateFromXmlNode(pluginElement); string concreteKey = pluginElement.GetAttribute(CONCRETE_KEY_ATTRIBUTE); string context = "creating a Plugin for " + family.PluginType.AssemblyQualifiedName; _builder.WithType(pluginPath, context, pluggedType => { if (concreteKey == string.Empty) { throw new StructureMapException(112, pluggedType.FullName); } Plugin plugin = family.AddPlugin(pluggedType, concreteKey); pluginElement.ForTextInChild("Setter/@Name").Do(prop => plugin.Setters.MarkSetterAsMandatory(prop)); }); }