public static bool IsDependencyProperty(MrProperty prop) { if (prop.GetName() == "Property") { return(false); // special case Windows.UI.Xaml.DependencyPropertyChangedEventArgs.Property } return(prop.GetName().EndsWith("Property") && prop.GetPropertyType().GetName() == "DependencyProperty"); }
private static int CompareProps(MrProperty p1, MrProperty p2) { #if DEBUG var c = p1.GetName().CompareTo(p2.GetName()); if (c != 0) { return(c); } var inheritanceDepthComp = Util.GetTypeInheritanceDepth(p1.DeclaringType).CompareTo(Util.GetTypeInheritanceDepth(p2.DeclaringType)); if (inheritanceDepthComp != 0) { return(inheritanceDepthComp); } return(p1.DeclaringType.GetName().CompareTo(p2.DeclaringType.GetName())); #else var h1 = GetPropertySortKey(p1); var h2 = GetPropertySortKey(p2); if (h1.CompareTo(h2) != 0) { return(h1.CompareTo(h2)); } else { return(p1.DeclaringType.GetName().CompareTo(p2.DeclaringType.GetName())); } #endif }
public static string ToJsName(MrProperty prop) { if (IsDependencyProperty(prop)) { return(ToJsName($"{prop.DeclaringType.GetName()}{Util.MinusPropertySuffix(prop.GetName())}")); } var fullName = GetPropFullName(prop); if (propNameMap.ContainsKey(fullName)) { return(propNameMap[fullName]); } return(ToJsName(prop.GetName())); }
private static uint GetPropertySortKey(MrProperty p1) { return(HashName(p1.GetName())); }
public static string GetPropFullName(MrProperty p) { return($"{p.DeclaringType.GetFullName()}.{p.GetName()}"); }