Property CreatePropertyStub(ClassDefinition node, IProperty baseProperty)
{
//try to complete partial implementation if any
Property property = node.Members[baseProperty.Name] as Property;
if (null == property)
{
property = new Property(LexicalInfo.Empty);
property.Name = baseProperty.Name;
property.Modifiers = TypeSystemServices.GetAccess(baseProperty) | TypeMemberModifiers.Virtual;
property.IsSynthetic = true;
DeclareParameters(property, baseProperty.GetParameters(), baseProperty.IsStatic ? 0 : 1);
property.Type = CreateTypeReference(baseProperty.Type);
}
if (property.Getter == null && null != baseProperty.GetGetMethod())
{
property.Getter = CreateMethodStub(baseProperty.GetGetMethod());
}
if (property.Setter == null && null != baseProperty.GetSetMethod())
{
property.Setter = CreateMethodStub(baseProperty.GetSetMethod());
}
EnsureEntityFor(property);
return(property);
}