private static string StyledSettings(DfmProperty property) { Guard.Ensure.IsTrue(property.HasValues, "StyledSettings property has no value error."); var sb = new StringBuilder(); sb.Append("["); foreach (var value in property.Values) { sb.Append($"TStyledSetting.{value.Content}, "); } sb.Length -= 2; sb.Append("]"); return(sb.ToString()); }
public static string Adapt(DfmObject obj, DfmProperty property) { var name = property.Name.ToLowerInvariant(); if (name == "viewport.width") { return("Width"); } if (name == "viewport.height") { return("Height"); } if (name == "designermasterstyle") { return(string.Empty); } return(property.Name); }
public static string Adapt(string name, DfmProperty property) { name = name.ToLowerInvariant(); if (name.EndsWith("color")) { return(Color(property.Value)); } if (name.EndsWith("align")) { return(Alignment(property)); } if (name.EndsWith("anchors")) { return(Anchors(property)); } if (name.EndsWith("dragmode")) { return(DragMode(property.Value)); } if (name.EndsWith("devices")) { return(Devices(property)); } if (name.EndsWith("styledsettings")) { return(StyledSettings(property)); } return(property.Value); }
private static string Devices(DfmProperty property) { Guard.Ensure.IsTrue(property.HasValues, "Device property has no value error."); return($"TDeviceKinds.{property.Value}"); }
private static string Alignment(DfmProperty property) { Guard.Ensure.IsTrue(property.HasValues, "Alignment property has no value error."); return($"TAlignLayout.{property.Value}"); }