internal static string ToIconValue(this object icon) { if (icon.IsUsed()) { var value = Convert.ToInt32(icon); if (icon.GetType() == typeof(FlatIcon)) { return(Flat.Get((FlatIcon)value)); } else if (icon.GetType() == typeof(Flat2Icon)) { return(Flat2.Get((Flat2Icon)value)); } else if (icon.GetType() == typeof(FontawesomeIcon)) { return(Fontawesome.Get((FontawesomeIcon)value)); } else if (icon.GetType() == typeof(LineawesomeIcon)) { return(Lineawesome.Get((LineawesomeIcon)value)); } else if (icon.GetType() == typeof(SocIcon)) { return(Soc.Get((SocIcon)value)); } else if (icon.GetType() == typeof(SvgIcon)) { return(Svg.Get((SvgIcon)value)); } } return(""); }
public void Read_only_properties_with_attributes() { var model = new Flat2 { First = 12, Second = "Ali" }; var result = Read(model); result.Should().HaveCount(1); result[0].Attributes.Should().HaveCount(1); result[0].Attributes.ElementAt(0).Should().BeAssignableTo <RequiredAttribute>(); result[0].Value.Should().Be(12); result[0].Path.Should().BeEquivalentTo(new[] { "first" }); }
protected override string GetIcon() => Flat2.Get(Name);