private void processOverrideElement(WriteOverride function, XmlElement overrideElement, string profileName)
        {
            string fullName = overrideElement.GetAttribute(TYPE_ATTRIBUTE);

            overrideElement.IfHasNode(INSTANCE_NODE)
                .Do(element => createOverrideInstance(fullName, element, function, profileName))
                .Else(() =>
                {
                    string defaultKey = overrideElement.GetAttribute(DEFAULT_KEY_ATTRIBUTE);
                    function(fullName, defaultKey);
                });
        }
예제 #2
0
        private void attachMementoSource(PluginFamily family, XmlElement familyElement)
        {
            familyElement.IfHasNode(MEMENTO_SOURCE_NODE).Do(node =>
            {
                InstanceMemento sourceMemento = new XmlAttributeInstanceMemento(node);

                string context = string.Format("MementoSource for {0}\n{1}",
                                               family.PluginType.AssemblyQualifiedName, node.OuterXml);
                _builder.WithSystemObject<MementoSource>(sourceMemento, context,
                                                         source => family.AddMementoSource(source));
            });
        }