Suppose I declare some variables in a class...
I can set these variables in the class and whatnot. However, I can also create property types to set these class varibles, like this:Code:public: String ^name; int ilImageName; int id; TEX_TYPE type; TEX_FORMAT format;
My question here is; is there any real point to using properties? And if not this, what exactly would you use properties for?Code:protected: String ^name; int ilImageName; int id; TEX_TYPE type; TEX_FORMAT format; public: property String ^Name{ String ^get() { return(name); } void set(String ^value) { name = value; } } property int ID{ int get() { return(id); } void set(int value) { id = value; } } property TEX_TYPE Type{ TEX_TYPE get() { return(type); } void set(TEX_TYPE value) { type = value; } } property TEX_FORMAT Format{ TEX_FORMAT get() { return(format); } void set(TEX_FORMAT value) { format = value; } }
Thanks.



LinkBack URL
About LinkBacks


