コード例 #1
0
ファイル: FamilyParser.cs プロジェクト: hasaki/ragetanks
        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));
            });
        }