日期:2014-05-20  浏览次数:20867 次

无法修改“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