P
Prigozhin Roman
But if I do this, then later in the code where I'm implementing set and get
functions
I'm getting error : Class already contains a definition for 'MyProperty'.
Probably I'm not implementing set and get the right way.
Here is my implementation:
public string MyProperty
{
set{ MyProperty = value; }
get{ MyProperty sDirMask; }
}
Obviously, Public string MyProperty is redefinition. Is there any other way
of doing it ?
Thanks
Roman
functions
I'm getting error : Class already contains a definition for 'MyProperty'.
Probably I'm not implementing set and get the right way.
Here is my implementation:
public string MyProperty
{
set{ MyProperty = value; }
get{ MyProperty sDirMask; }
}
Obviously, Public string MyProperty is redefinition. Is there any other way
of doing it ?
Thanks
Roman
message news: said:Prigozhin,
When declaring your interface, you can just do this:
public interface IMyInterface
string MyProperty {get; set;}
You can choose to omit either get or set to get write-only or
read-only
functionality.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]