private static BuilderSkeleton <TBuilder> WithTagMapping <TBuilder>(this BuilderSkeleton <TBuilder> builder, IEnumerable <KeyValuePair <string, Type> > mapping) where TBuilder : BuilderSkeleton <TBuilder>
 {
     foreach (var(tagName, tagType) in mapping)
     {
         builder.WithTagMapping(tagName, tagType);
     }
     return(builder);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Adds type converters for Color, Point, Rectangle, Size, and Vector2,3,4.
 /// </summary>
 /// <typeparam name="TBuilder"></typeparam>
 /// <param name="builder"></param>
 /// <returns></returns>
 public static TBuilder WithTypeConvertersForBasicStructures <TBuilder>(this BuilderSkeleton <TBuilder> builder)
     where TBuilder : BuilderSkeleton <TBuilder>
 {
     return(builder
            .WithTypeConverter(new ColorConverterYaml())
            .WithTypeConverter(new PointConverterYaml())
            .WithTypeConverter(new RectangleConverterYaml())
            .WithTypeConverter(new SizeConverterYaml())
            .WithTypeConverter(new Vector2ConverterYaml())
            .WithTypeConverter(new Vector3ConverterYaml())
            .WithTypeConverter(new Vector4ConverterYaml())
            .WithTypeConverter(new BorderSideStyleYaml())
            .WithTypeConverter(new FontStylePropertiesYaml())
            .WithTypeConverter(new LayoutBoxConverterYaml())
            );
 }