GetAccess() public static method

public static GetAccess ( IAccessibleMember member ) : TypeMemberModifiers
member IAccessibleMember
return TypeMemberModifiers
Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }