using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Configuration;
using Core.Mes.ClientFrameWork;

namespace Core.Mes.ClientManager
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);



            
            //add maliang
            InitApp();
            //end and
            Application.Run(new MainForm());
        }
  

        #region addd maliang
        private static void InitApp()
        {
            //step1
            CoreClientOption.Application_Path = System.Environment.CurrentDirectory;
            CoreFS.CA06.OpeCommunicationConfig.Application_Path = System.Environment.CurrentDirectory;
            //step2
            InitOption();
            //step3
            InitRemotingServer();
        }
        private static void InitOption()
        {
            if (CoreClientOption.StaticCoreClientOption == null)
            {
                CoreClientOption cco = new CoreClientOption();
                cco.Load();
            }
        }
        private static void InitRemotingServer()
        {
            string url = ConfigurationSettings.AppSettings["RemoteServerUrl"];
            ClientCommon._RemotingHelp.InitServerUrlList("ServerCommon", url);
        }
        #endregion
    }
}