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); }
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); }
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); }
public static AllowedAssemblyReferenceInclude Serialize(AllowedAssemblyReferenceInclude instance, SimpleXmlSerializerBase serializer) { instance = instance ?? new AllowedAssemblyReferenceInclude(); InjectionConfigurationFileInclude.Serialize(instance, serializer); return(instance); }
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); }
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); }
public static IgnoredMemberReferenceInclude Serialize(IgnoredMemberReferenceInclude instance, SimpleXmlSerializerBase serializer) { instance = instance ?? new IgnoredMemberReferenceInclude(); InjectionConfigurationFileInclude.Serialize(instance, serializer); return(instance); }
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); }
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); }