Пример #1
0
 public ClassMemberCollection Add(ClassMember classMember, bool addGetterSetter = true)
 {
     ClassMembers.Add(classMember);
     classMember.Owner = Owner;
     if (!classMember.NonAccessModifiers.Contains(Abstract) && !classMember.NonAccessModifiers.Contains(Final) && !classMember.NonAccessModifiers.Contains(Static) && addGetterSetter)
     {
         GetterFunctions.Add(new GetterFunction(classMember));
         SetterFunctions.Add(new SetterFunction(classMember));
     }
     return(this);
 }
Пример #2
0
        public void Replace(string name, ClassMember classMember)
        {
            for (int i = 0; i < ClassMembers.Count; i++)
            {
                if (ClassMembers[i].Name == name)
                {
                    classMember.Owner = ClassMembers[i].Owner;

                    GetterFunctions.Remove(GetterFunctions.First(x => x.ClassMember.Name == ClassMembers[i].Name));
                    SetterFunctions.Remove(SetterFunctions.First(x => x.ClassMember.Name == ClassMembers[i].Name));
                    ClassMembers.RemoveAt(i);
                    GetterFunctions.Insert(i, new GetterFunction(classMember));
                    SetterFunctions.Insert(i, new SetterFunction(classMember));
                    ClassMembers.Insert(i, classMember);

                    break;
                }
            }
        }
Пример #3
0
 private static ReferenceValue GetReferenceValue(Class c, ClassMember cm) =>
 new ReferenceValue($"{c.Name}.{cm.Name}", true, c);