public static bool IsSame(this PropertyMember m1, PropertyMember m2)
 {
     if (m1 == null || m2 == null)
     {
         return(m1 == m2);
     }
     return(m1.Name == m2.Name &&
            IsSamePropertyDeclaration(m1, m2));
 }
 /// <summary>
 /// returns true, if properties are same in declaration part, i.e. only names can differ
 /// </summary>
 public static bool IsSamePropertyDeclaration(this PropertyMember m1, PropertyMember m2)
 {
     if (m1 == null || m2 == null)
     {
         return(m1 == m2);
     }
     return(m1.MemberType.IsSame(m2.MemberType) &&
            m1.IsOptional == m2.IsOptional &&
            m1.Initialization.IsSame(m2.Initialization));
 }
Example #3
0
 private void Generate(PropertyMember m)
 {
     Generate(m.Accessibility);
     Formatter.Write(m.Name);
     if (m.IsOptional)
     {
         Formatter.Write("?");
     }
     if (m.MemberType != null)
     {
         Formatter.Write(": ");
         Generate(m.MemberType);
     }
     if (m.Initialization != null)
     {
         Formatter.Write(" = ");
         Generate(m.Initialization);
     }
     Formatter.Write(";");
 }