namespace ConsoleApp1
{
public class TestCls
{
public delegate void DelGetMessage();
public delegate void DelMethod(int x, int y);
public delegate string MyDel(string str);
public event MyDel myEvent;
public TestCls() {
this.myEvent += new MyDel(WelComeUser);
}
public string WelComeUser(string user)
{
return "Welcome " + user;
}
public void GetValue()
{
Console.WriteLine("Test");
}
public string GetMsg()
{
DelGetMessage delGetMessage = new DelGetMessage(GetValue);
delGetMessage.Invoke();
return "Teststr";
}
public void plus_Method1(int x, int y)
{
Console.Write("You are in plus_Method");
Console.WriteLine(x + y);
}
public void subtract_Method2(int x, int y)
{
Console.Write("You are in subtract_Method");
Console.WriteLine(x - y);
}
}
class Student
{
public int StudentID { get; set; }
public String StudentName { get; set; }
public int Age { get; set; }
}
}
No comments:
Post a Comment