F
Flare
Hi...Why can´t I access a property thorug property?
Eg.
class Foo {
public SizeF MySize
{ get { return ms; }
set { ms = value; }
}}
Now, if i try to:
Foo.MySize.Width = 5;
I get: Cannot modify the return value of 'Foo.MySize' because it is not a
variable
Why is it so? Im creating a structure of Shape classes where the base unit
was supossed to have public properties on eg its location and size etc.
As i see i have to make public attributes instead wich not optimal since i
might want to do some validation on set accessors. Of course I could make my
own get/set methods but thats kind of wrong when C#(.net) has properties.
reagards
Anders
Eg.
class Foo {
public SizeF MySize
{ get { return ms; }
set { ms = value; }
}}
Now, if i try to:
Foo.MySize.Width = 5;
I get: Cannot modify the return value of 'Foo.MySize' because it is not a
variable
Why is it so? Im creating a structure of Shape classes where the base unit
was supossed to have public properties on eg its location and size etc.
As i see i have to make public attributes instead wich not optimal since i
might want to do some validation on set accessors. Of course I could make my
own get/set methods but thats kind of wrong when C#(.net) has properties.
reagards
Anders