コード例 #1
0
        public void ParseDefaultElement(XmlElement element)
        {
            var pluginTypePath = new TypePath(element.GetAttribute(PLUGIN_TYPE));


            _builder.ConfigureFamily(pluginTypePath, family => {
                var scope = findScope(element);
                family.SetScopeTo(scope);

                var memento  = ConfigurationParser.CreateMemento(element);
                var instance = memento.ToInstance(this, family.PluginType);
                family.SetDefault(instance);
            });
        }
コード例 #2
0
ファイル: FamilyParser.cs プロジェクト: hasaki/ragetanks
        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);
            });
        }
コード例 #3
0
        public void ParseInstanceElement(XmlElement element)
        {
            var pluginTypePath = new TypePath(element.GetAttribute(PLUGIN_TYPE));

            _builder.ConfigureFamily(pluginTypePath, family => {
//                InstanceMemento memento = ConfigurationParser.CreateMemento(element);
//                var instance = memento.ToInstance(this, family.PluginType);
//
//                family.AddInstance(instance);
            });
        }
コード例 #4
0
        private void createOverrideInstance(string fullName, XmlElement instanceElement, WriteOverride function,
                                            string profileName)
        {
            string          key     = Profile.InstanceKeyForProfile(profileName);
            InstanceMemento memento = _creator.CreateMemento(instanceElement);

            memento.InstanceKey = key;

            var familyPath = new TypePath(fullName);

            _graphBuilder.ConfigureFamily(familyPath, family =>
            {
                family.AddInstance(memento);
                function(fullName, key);
            });
        }