using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Microsoft.VisualBasic.ApplicationServices;

namespace SystemConfig
{
    static class Program
    {
        /// <summary>
        /// 单实例应用程序类
        /// </summary>
        class SingleInstanceApplication : WindowsFormsApplicationBase
        {
            static SingleInstanceApplication application;
            internal static SingleInstanceApplication Application
            {
                get
                {
                    if (application == null)
                    {
                        application = new SingleInstanceApplication();
                    }

                    return application;
                }
            }

            public SingleInstanceApplication()
            {
                this.IsSingleInstance = true;
            }
            protected override void OnCreateMainForm()
            {
                this.MainForm = FrmSystemConfig.FormInstance;
            }

        }
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            SingleInstanceApplication.Application.Run(args);

        }
    }
}