原文:
    属性的可访问性(accessibility)是指它是public,private,还是protected的。可访问性是在声明属性的时候指定的。不过可以为get和set这两种accessor指定不同的可访问性。例如,下面演示的这个版本的ScreenPosition struct将X和Y属性的set accessor定义成private,而get accessor仍然为public:
 struct ScreenPosition
 {
      ...
      public int X
      {
          get{return this.x;}
          private set{this.x = rangeCheckedX(value);}
      }
      public int Y
      {
          get{return this.y;}
          private set{this.y = rangeCheckedY(value);}
       }
       ...
      private int x,y;
 }
为两个accessor定义互不相同的可访问性时,必须遵守以下规则:
 1、定义时,只能改变一个accessor的可访问性。将属性定义为public,但将它的两个accessor都变成private,这样做是毫无意义的。
 2、修饰符(也就是public,private,protected)所指定的可访问性在限制程度上必须大于属性的可访问性。例如,假如属性声明为private,就不能将get accessor声明为public;相反,在这个例子中,你可以使属性为public,但要使get accessor为private.我现目前的晕呼呼的理解:
1.
 struct ScreenPosition
 {
      ...
      public int X//1.这里是public公共的
      {
          get{return this.x;}//1.这里是不是也默认为public
          set{this.x = rangeCheckedX(value);}//1.这里是不是也默认为public
      }
      public int Y
      {
          get{return this.y;}
          private set{this.y = rangeCheckedY(value);}
       }
       ...
      private int x,y;
 }
2.我对“假如属性声明为private,就不能将get accessor声明为public;”理解:
 struct ScreenPosition
 {
      ...
      private int X//这里是private私有的
      {
          get{return this.x;}//这里是不是默认就是private,并且不能声明为公共的。还是要加上private get{return this.x;}
          set{this.x = rangeCheckedX(value);}//这句只能get起作用吗?set呢?
      }
      public int Y
      {
          get{return this.y;}
          private set{this.y = rangeCheckedY(value);}
       }
       ...
      private int x,y;
 }
3.”相反,在这个例子中,你可以使属性为public,但要使get accessor为private.“这句我就矛盾了。
 struct ScreenPosition
 {
      ...
      public int X//明明可以像下面4行这样。
      {
          get{return this.x;}
          set{this.x = rangeCheckedX(value);}
      }
      public int Y//它的意思就是下面这4行这样吗?
      {
          private get{return this.y;}
          set{this.y = rangeCheckedY(value);}
       }
       ...
      private int x,y;
 }