Ejemplo n.º 1
0
 public static void Case3(WelcomeForm welcome)
 {
     welcome.Load += (sender, e) =>
     {
         string path = @"C:\swabhav\C# Win Form\ConsoleWinApp\ConsoleWinApp\h1.txt";
         Console.WriteLine("\nInside lamnda func function");
         Console.WriteLine("Writing to Text file");
         File.WriteAllText(path, "Writing to first file using event");
     };
 }
Ejemplo n.º 2
0
 public static void Case2(WelcomeForm welcome)
 {
     welcome.Load += delegate(object sender, EventArgs e)
     {
         string path = @"C:\swabhav\C# Win Form\ConsoleWinApp\ConsoleWinApp\h1.txt";
         Console.WriteLine("\nInside anonymous func function");
         Console.WriteLine("Writing to Text file");
         File.WriteAllText(path, "Writing to first file using event");
     };
 }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            WelcomeForm welcome = new WelcomeForm();

            Case1(welcome);
            Case2(welcome);
            Case3(welcome);
            Application.Run(welcome);
        }
Ejemplo n.º 4
0
 public static void Case1(WelcomeForm welcome)
 {
     welcome.Load += Log;
 }