예제 #1
0
        internal static PropertyDeclarationSyntax BuildOverridableProperty(IPropertySymbol propertySymbol,
                                                                           string indentation = DefaultIndentation)
        {
            var propertyName      = propertySymbol.Name;
            var propertyType      = propertySymbol.Type.SimplifyTypeName();
            var propertyModifiers = propertySymbol.GetAccessModifiersWithOverride(indentation);
            var accessorList      = propertySymbol.GetAccessorList(indentation);

            var propertyDecl = PropertyDeclaration(
                IdentifierName(propertyType.ToIdentifier()),
                propertyName.ToIdentifier())
                               .WithModifiers(propertyModifiers)
                               .WithAccessorList(accessorList);

            return(propertyDecl);
        }