Esempio 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");
     };
 }
Esempio 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");
     };
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            WelcomeForm welcome = new WelcomeForm();

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