// ALL RIGHTS RESERVED:
// ====================
// The contents of this file, and associated files in this directory, are 
// Copyright (C) SPT , all rights reserved, 2009.
// All software Source Code, Images, Database-Design and code, Graphics Design 
// and source files, and related content (collectively referred to as SOURCE) are 
// Copyright (c) SPT, 2009, All Rights Reserved.
// http://SerialPortTool.com

// PTZ Controller is a Registered Trademark of SerialPortTool.com.


using System;
using System.Drawing;
using System.Resources;
using System.Reflection;
using System.Windows.Forms;
using System.Collections.Generic;

namespace PTZController
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]

        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                LoadResourceManager();
                Application.Run(new MainForm());

                // Application.Run(new TourForm());
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }


        private static void LoadResourceManager()
        {
            Assembly assembly = Assembly.GetEntryAssembly();

            m_resoueces = new ResourceManager("PTZController.Properties.Resources", assembly);   
        }

        public static Image LoadImage(string name)
        {
            return m_resoueces.GetObject(name) as Image;
        }

        private static  ResourceManager m_resoueces;

        public static ResourceManager Resources
        {
            get { return m_resoueces; }
            set { m_resoueces = value; }
        }
    }
}