コード例 #1
0
 public static bool IsReadWrite(this BasePropertyDeclarationSyntax @this)
 {
     if (@this == null)
     {
         throw new ArgumentNullException(nameof(@this));
     }
     return(@this.Getter() != null && @this.Setter() != null);
 }
コード例 #2
0
        public static bool IsAutoImplentedProperty(this BasePropertyDeclarationSyntax @this)
        {
            if (@this == null)
            {
                throw new ArgumentNullException(nameof(@this));
            }

            if (@this.IsAbstract())
            {
                return(false);
            }
            var getter = @this.Getter();

            return(getter != null && //Auto-properties must have getter
                   getter.Body == null);
        }