コード例 #1
0
 public static string Serialize(UxSize len)
 {
     return
         (len.PointsValue.Select(Serialize).Or(() =>
                                               len.PixelsValue.Select(Serialize).Or(() =>
                                                                                    len.PercentagesValue.Select(Serialize).OrThrow())));
 }
コード例 #2
0
 public static IAttribute <UxSize> GetSize(this IElement element, string property, UxSize defaultValue)
 {
     return(element[property].Convert(
                parse: TryParseLength,
                serialize: Serialize,
                defaultValue: defaultValue));
 }