public static AllowedAssemblyReferenceIncludeLoader Serialize(
                AllowedAssemblyReferenceIncludeLoader instance, SimpleXmlSerializerBase serializer
                )
            {
                instance = instance ?? new AllowedAssemblyReferenceIncludeLoader();
                FileIncludeLoader <IAllowedAssemblyReference> .Serialize(instance, serializer);

                return(instance);
            }
            public static IgnoredMemberReferencesIncludeLoader Serialize(
                IgnoredMemberReferencesIncludeLoader instance, SimpleXmlSerializerBase serializer
                )
            {
                instance = instance ?? new IgnoredMemberReferencesIncludeLoader();
                FileIncludeLoader <IIgnoredMemberReference> .Serialize(instance, serializer);

                return(instance);
            }
コード例 #3
0
        public static InjecteeAssembly Serialize(InjecteeAssembly instance, SimpleXmlSerializerBase serializer)
        {
            instance = instance ?? new InjecteeAssembly();

            serializer.ProcessStartElement(nameof(InjecteeAssembly));
            {
                serializer.ProcessAttributeString(nameof(AssemblyPath), s => instance.AssemblyPath = s, () => instance.AssemblyPath);
                serializer.ProcessEnterChildOnRead();

                serializer.ProcessWithFlags(SimpleXmlSerializerFlags.IsOptional | SimpleXmlSerializerFlags.CollectionUnorderedRequired, () => {
                    serializer.ProcessUnorderedSequence(() => {
                        if (serializer.ProcessStartElement(nameof(IgnoredMemberReferences)))
                        {
                            serializer.ProcessEnterChildOnRead();
                            serializer.ProcessCollectionAsReadOnly(
                                v => instance.IgnoredMemberReferences = v,
                                () => instance.IgnoredMemberReferences,
                                itemSerializer =>
                                serializer.CreateByKnownInheritors <IIgnoredMemberReference>(
                                    serializer.CurrentXmlElement.Name,
                                    itemSerializer
                                    )
                                );
                        }
                        serializer.ProcessEndElement();

                        if (serializer.ProcessStartElement(nameof(AllowedAssemblyReferences)))
                        {
                            serializer.ProcessEnterChildOnRead();
                            serializer.ProcessCollectionAsReadOnly(
                                v => instance.AllowedAssemblyReferences = v,
                                () => instance.AllowedAssemblyReferences,
                                itemSerializer =>
                                serializer.CreateByKnownInheritors <IAllowedAssemblyReference>(
                                    serializer.CurrentXmlElement.Name,
                                    itemSerializer
                                    )
                                );
                        }
                        serializer.ProcessEndElement();
                    });
                });
            }
            serializer.ProcessEndElement();

            return(instance);
        }
コード例 #4
0
        public static InjectedMethod Serialize(InjectedMethod instance, SimpleXmlSerializerBase serializer)
        {
            instance = instance ?? new InjectedMethod();

            serializer.ProcessStartElement(nameof(InjectedMethod));
            {
                serializer.ProcessAttributeString(nameof(AssemblyPath), s => instance.AssemblyPath     = s, () => instance.AssemblyPath);
                serializer.ProcessAttributeString(nameof(MethodFullName), s => instance.MethodFullName = s, () => instance.MethodFullName);
                serializer.ProcessWithFlags(
                    SimpleXmlSerializerFlags.IsOptional,
                    () => {
                    serializer.ProcessEnumAttribute(nameof(InjectionPosition), s => instance.InjectionPosition = s, () => instance.InjectionPosition);
                });
            }
            serializer.ProcessEnterChildOnRead();
            serializer.ProcessEndElement();

            return(instance);
        }
コード例 #5
0
 public static AllowedAssemblyReferenceInclude Serialize(AllowedAssemblyReferenceInclude instance, SimpleXmlSerializerBase serializer)
 {
     instance = instance ?? new AllowedAssemblyReferenceInclude();
     InjectionConfigurationFileInclude.Serialize(instance, serializer);
     return(instance);
 }
コード例 #6
0
        public static AllowedAssemblyReference Serialize(AllowedAssemblyReference instance, SimpleXmlSerializerBase serializer)
        {
            instance = instance ?? new AllowedAssemblyReference();

            serializer.ProcessStartElement(serializer.GetXmlRootName(typeof(AllowedAssemblyReference)));
            {
                serializer.ProcessAttributeString(nameof(Name), s => instance.Name = s, () => instance.Name);
                serializer.ProcessWithFlags(
                    SimpleXmlSerializerFlags.IsOptional,
                    () => {
                    serializer.ProcessAttributeString(nameof(Path), s => instance.Path = s, () => instance.Path);
                    serializer.ProcessAttributeString(
                        nameof(StrictNameCheck),
                        s => instance.StrictNameCheck = Convert.ToBoolean(s),
                        () => Convert.ToString(instance.StrictNameCheck)
                        );
                });
            }
            serializer.ProcessEndElement();

            return(instance);
        }
コード例 #7
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);
        }
コード例 #8
0
 public static IgnoredMemberReferenceInclude Serialize(IgnoredMemberReferenceInclude instance, SimpleXmlSerializerBase serializer)
 {
     instance = instance ?? new IgnoredMemberReferenceInclude();
     InjectionConfigurationFileInclude.Serialize(instance, serializer);
     return(instance);
 }
コード例 #9
0
        public static IgnoredMemberReference Serialize(IgnoredMemberReference instance, SimpleXmlSerializerBase serializer)
        {
            instance = instance ?? new IgnoredMemberReference();

            serializer.ProcessStartElement(serializer.GetXmlRootName(instance.GetType()));
            {
                serializer.ProcessAttributeString(nameof(Filter), s => instance.Filter = s, () => instance.Filter);
                serializer.ProcessWithFlags(
                    SimpleXmlSerializerFlags.IsOptional,
                    () => {
                    serializer.ProcessFlagsEnumAttributes(kDefaultFilterOptions, s => instance.FilterFlags = s, () => instance.FilterFlags);
                });
            }
            serializer.ProcessEnterChildOnRead();
            serializer.ProcessEndElement();

            return(instance);
        }
コード例 #10
0
        public static InjectionConfigurationFileInclude Serialize(InjectionConfigurationFileInclude instance, SimpleXmlSerializerBase serializer)
        {
            instance = instance ?? throw new ArgumentNullException(nameof(instance));

            serializer.ProcessStartElement(serializer.GetXmlRootName(instance.GetType()));
            {
                serializer.ProcessAttributeString(nameof(Path), s => instance.Path = s, () => instance.Path);
            }
            serializer.ProcessEnterChildOnRead();
            serializer.ProcessEndElement();

            return(instance);
        }
            public static FileIncludeLoader <TItem> Serialize(FileIncludeLoader <TItem> instance, SimpleXmlSerializerBase serializer)
            {
                instance = instance ?? throw new ArgumentNullException(nameof(instance));

                // Skip root element when reading
                serializer.ProcessEnterChildOnRead();

                serializer.ProcessCollection(
                    instance.Items,
                    itemSerializer => serializer.CreateByKnownInheritors <TItem>(
                        serializer.CurrentXmlElement.Name,
                        itemSerializer
                        ));

                return(instance);
            }