当前位置: 代码迷 >> .NET面试 >> 无法修改“System.Collections.Generic.List<System.Drawing.Rectangle>this[int]”的返回值解决方案
  详细解决方案

无法修改“System.Collections.Generic.List<System.Drawing.Rectangle>this[int]”的返回值解决方案

热度:345   发布时间:2016-05-02 01:33:38.0
无法修改“System.Collections.Generic.List<System.Drawing.Rectangle>.this[int]”的返回值
本帖最后由 yan_hyz 于 2014-02-11 17:48:32 编辑
    无法修改“System.Collections.Generic.List<System.Drawing.Rectangle>.this[int]”的返回值,
因为它不是变量

部分源码如下:

private List<RectangleEx> CRectLst = new List<RectangleEx>();
private List<Rectangle> RectLst = new List<Rectangle>();


其中RectangleEx为我自定义的类:

 public class RectangleEx
    {
        private Rectangle rect;

        public Rectangle Rect
        {
            get
            {
                return this.rect;
            }
            set
            {
                this.rect = value;
            }
        }

        public int X
        {
            get
            {
                return this.rect.X;
            }
            set
            {
                this.rect.X = value;
            }
        }
        public int Y
        {
            get
            {
                return this.rect.Y;
            }
            set
            {
                this.rect.Y = value;
            }
        }
        public int Width
        {
            get
            {
                return this.rect.Width;
            }
            set
            {
                this.rect.Width = value;
            }
        }
        public int Height
        {
            get
            {
                return this.rect.Height;
            }
            set
            {
                this.rect.Height = value;
            }
        }
        public int Left
        {
            get
            {
                return this.rect.Left;
            }
        }
        public int Right
  相关解决方案