Ejemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            SplashScreen.ShowSplashScreen();

            //1、检查只允许一个实例运行
            Process[] ps = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
            if (ps.Length > 1)
            {
                XtraMessageBox.Show("质检Demo程序已经启动!", COMMONCONST.MESSAGEBOX_WARING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                SplashScreen.CloseForm();
                return;
            }


            //2、检查公司的lic权限

            //3、检查arcgis license权限
            LicenseInitializer m_AOLicenseInitializer = new LicenseInitializer();

            if (!m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB },
                                                              new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst }))
            {
                SplashScreen.CloseForm();
                XtraMessageBox.Show("Arcgis许可验证失败", COMMONCONST.MESSAGEBOX_WARING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            //应用dev的主题
            DevExpress.UserSkins.OfficeSkins.Register();
            DevExpress.UserSkins.BonusSkins.Register();
            if (!DevExpress.Skins.SkinManager.AllowFormSkins ||
                !NativeVista.IsVista)
            {
                DevExpress.Skins.SkinManager.EnableFormSkins();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            //开启日志记录
            OperationalLogManager.SetAutoFlush(true);

            OperationalLogManager.AppendSeparator();
            OperationalLogManager.AppendSeparator();

            //读取环境变量
            ConfigManager.GetEnvironVariable();

            //运行主程序
            Application.Run(new RibbonFrmMain());
        }
Ejemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            SplashScreen.ShowSplashScreen();

            //1、检查只允许一个实例运行
            Process[] ps = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
            if (ps.Length > 1)
            {
                XtraMessageBox.Show("质检Demo程序已经启动!", COMMONCONST.MESSAGEBOX_WARING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                SplashScreen.CloseForm();
                return;
            }

            //2、检查公司的lic权限

            //3、检查arcgis license权限
            LicenseInitializer m_AOLicenseInitializer = new LicenseInitializer();
            if (!m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB },
            new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst }))
            {
                SplashScreen.CloseForm();
                XtraMessageBox.Show("Arcgis许可验证失败", COMMONCONST.MESSAGEBOX_WARING, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            //应用dev的主题
            DevExpress.UserSkins.OfficeSkins.Register();
            DevExpress.UserSkins.BonusSkins.Register();
            if (!DevExpress.Skins.SkinManager.AllowFormSkins ||
               !NativeVista.IsVista)
            {
                DevExpress.Skins.SkinManager.EnableFormSkins();
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.ApplicationExit += new EventHandler(Application_ApplicationExit);
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            //开启日志记录
            OperationalLogManager.SetAutoFlush(true);

            OperationalLogManager.AppendSeparator();
            OperationalLogManager.AppendSeparator();

            //读取环境变量
            ConfigManager.GetEnvironVariable();

            //运行主程序
            Application.Run(new RibbonFrmMain());
        }