示例#1
0
        public Net.PropertyAccessor EnsureAccessorInto(IMethodSymbol method, Net.Property Owner)
        {
            string name = helper.FullMethodName(method);

            return(Methods.EntityNamedIfNone <Net.PropertyAccessor>(name,
                                                                    () => { return this.CreateNewAccessor(method, Owner); }));
        }
示例#2
0
 public Property EnsureProperty(IPropertySymbol symbol)
 {
     Net.Property property = this.CreateNewEntity <Net.Property>(typeof(Net.Property).FullName);;
     property.accessibility = helper.AccessibilityName(symbol.DeclaredAccessibility);
     property.declaredType  = this.EnsureType(symbol.Type);
     property.name          = helper.FullPropertyName(symbol);
     return(property);
 }
    public override void VisitPropertyDeclaration(PropertyDeclarationSyntax node)
    {
        string propertyName = node.Identifier.ToString();
        var    prop         = AddProperty(node, propertyName);

        if (prop is Net.Property)
        {
            currentProperty = prop as Net.Property;
        }
        base.VisitPropertyDeclaration(node);
        currentProperty = null;
    }
示例#4
0
 private Net.PropertyAccessor CreateNewAccessor(IMethodSymbol method, Net.Property Owner)
 {
     Net.PropertyAccessor NetAccessor = this.CreateNewEntity <Net.PropertyAccessor>(typeof(Net.PropertyAccessor).FullName);
     ConfigureMethodWith(NetAccessor, method);
     NetAccessor.property = Owner;
     if (method.MethodKind == MethodKind.PropertySet)
     {
         Owner.setter = NetAccessor;
     }
     else if (method.MethodKind == MethodKind.PropertyGet)
     {
         Owner.getter = NetAccessor;
     }
     else
     {
         throw new System.Exception("Unexpected non accessor method in accessor statement ");
     }
     return(NetAccessor);
 }