See this example here.
I have created an interface.
Now create a class.
it's do that with rick.
Right click on inter face name near (:) sign.
It will pop up a menu, where you found "Implement Interface" menu.
Click on that menu.
It's a very small but useful example during the development of code.
I have created an interface.
public interface myInterFace1it have two methods. Operation and myName.
{
void Operation(string myParam);
string myName();
}
Now create a class.
class ProgramNow, lets inherit with interface.
{
}
class Program:myInterFace1Now I'm using myInterFace1 in Program class, So I need to write down all methods of that interface in my class.
{
}
it's do that with rick.
Right click on inter face name near (:) sign.
It will pop up a menu, where you found "Implement Interface" menu.
Click on that menu.
All method of that interface will be write down there in that class automatically.
class Program:myInterFace1
{
static void Main(string[] args)
{
}
#region myInterFace1 Members
public void Operation(string myParam)
{
throw new Exception("The method or operation is not implemented.");
}
public string myName()
{
throw new Exception("The method or operation is not implemented.");
}
#endregion
}
It's a very small but useful example during the development of code.
0 comments :
Post a Comment