public static GetAccess ( IAccessibleMember member ) : TypeMemberModifiers | ||
member | IAccessibleMember | |
리턴 | TypeMemberModifiers |
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); }
Method CreateMethodStub(IMethod baseMethod) { var stub = CreateMethodFromPrototype(baseMethod, TypeSystemServices.GetAccess(baseMethod) | TypeMemberModifiers.Virtual); var notImplementedException = new MethodInvocationExpression { Target = new MemberReferenceExpression(new ReferenceExpression("System"), "NotImplementedException") }; stub.Body.Statements.Add(new RaiseStatement(notImplementedException) { LexicalInfo = LexicalInfo.Empty }); return(stub); }