예제 #1
0
        public static InjectionConfiguration Serialize(InjectionConfiguration instance, SimpleXmlSerializerBase serializer)
        {
            instance = instance ?? new InjectionConfiguration();

            serializer.ProcessStartElement(serializer.GetXmlRootName(instance.GetType()));
            serializer.ProcessEnterChildOnRead();
            {
                serializer.ProcessWithFlags(SimpleXmlSerializerFlags.CollectionUnorderedRequired, () => {
                    serializer.ProcessUnorderedSequence(() => {
                        if (serializer.ProcessStartElement(nameof(InjecteeAssemblies)))
                        {
                            serializer.ProcessEnterChildOnRead();
                            {
                                serializer.ProcessCollectionAsReadOnly(v => instance.InjecteeAssemblies = v, () => instance.InjecteeAssemblies);
                            }
                            serializer.ProcessEndElement();
                        }

                        if (serializer.ProcessStartElement(nameof(InjectedMethods)))
                        {
                            serializer.ProcessEnterChildOnRead();
                            {
                                serializer.ProcessCollectionAsReadOnly(v => instance.InjectedMethods = v, () => instance.InjectedMethods);
                            }
                            serializer.ProcessEndElement();
                        }
                    });
                });
            }
            serializer.ProcessEndElement();

            return(instance);
        }
 protected ResolvedInjectionConfigurationLoader(InjectionConfiguration injectionConfiguration)
 {
     _injectionConfiguration = injectionConfiguration;
 }
 public static ResolvedInjectionConfiguration LoadFromInjectionConfiguration(InjectionConfiguration injectionConfiguration)
 {
     return(new ResolvedInjectionConfigurationLoader(injectionConfiguration).Load());
 }