Server/Program.cs
author sl
Sun, 11 Jan 2015 19:00:16 +0100
changeset 86 829dd13b1048
parent 31 f19b04646b6a
child 92 787dee27fc0a
permissions -rw-r--r--
Adding app exit event handler.
sl@0
     1
using System;
sl@0
     2
using System.Collections.Generic;
sl@0
     3
using System.Linq;
sl@0
     4
using System.Threading.Tasks;
sl@0
     5
using System.Windows.Forms;
sl@0
     6
sl@0
     7
namespace SharpDisplayManager
sl@0
     8
{
sl@0
     9
    static class Program
sl@0
    10
    {
sl@31
    11
        //WARNING: This is assuming we have a single instance of our program.
sl@31
    12
        //That is what we want but we should enforce it somehow.
sl@17
    13
        public static MainForm iMainForm;
sl@0
    14
        /// <summary>
sl@0
    15
        /// The main entry point for the application.
sl@0
    16
        /// </summary>
sl@0
    17
        [STAThread]
sl@0
    18
        static void Main()
sl@86
    19
        {	
sl@86
    20
			Application.ApplicationExit += new EventHandler(OnApplicationExit);
sl@86
    21
			//
sl@0
    22
            Application.EnableVisualStyles();
sl@0
    23
            Application.SetCompatibleTextRenderingDefault(false);
sl@17
    24
            iMainForm = new MainForm();
sl@17
    25
            Application.Run(iMainForm);
sl@0
    26
        }
sl@86
    27
sl@86
    28
		/// <summary>
sl@86
    29
		/// Occurs after form closing.
sl@86
    30
		/// </summary>
sl@86
    31
		/// <param name="sender"></param>
sl@86
    32
		/// <param name="e"></param>
sl@86
    33
		static private void OnApplicationExit(object sender, EventArgs e)
sl@86
    34
		{
sl@86
    35
sl@86
    36
		}
sl@0
    37
    }
sl@0
    38
}