Exemplo n.º 1
0
        static void Main()
        {
            Process process = ProcessCheck.RuningInstance();

            if (process != null)
            {
                ProcessCheck.HandleRunningInstance(process);
                //System.Threading.Thread.Sleep(1000);
                System.Environment.Exit(1);
            }
            try
            {
                bool licensed = m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngine, esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced },
                                                                             new esriLicenseExtensionCode[] { esriLicenseExtensionCode.esriLicenseExtensionCodeSpatialAnalyst });
                if (!licensed)
                {
                    XtraMessageBox.Show(m_AOLicenseInitializer.LicenseMessage(), "初始化许可失败", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new frmMain());
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message + ex.StackTrace, "启动失败", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            finally
            {
                m_AOLicenseInitializer.ShutdownApplication();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Ensure target process is opened
 /// </summary>
 /// <param name="processName">Target process</param>
 private void processAttachHook(string processName)
 {
     while (!ProcessCheck.programExistChecking(processName))
     {
         Dialog dialog = Dialog.Instance;
         dialog.showMsgBox("Error", "BlueStacks is not opened!");
     }
 }
Exemplo n.º 3
0
        public Result Visit(ProcessCheck processCheck)
        {
            var result = new Result();

            foreach (var conditionProperty in processCheck.PropertiesCondition)
            {
                result.IsValid &= conditionProperty.Visit(this).IsValid;
            }

            return(result);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            ExampleWithComparisons();

            try
            {
                var pEntity = new Person("James");
                pEntity.DoSomeWriting();
            }
            catch (Exception ex)
            {
                ex = ex;
            }

            onClassFinished();

            var          userInput          = Console.ReadLine();
            ProcessCheck userPickedFunction = null;

            if (userInput == "op1")
            {
                userPickedFunction = op1;
            }

            else if (userInput == "op2")
            {
                userPickedFunction = op2;
            }
            bool finalResult;

            if (userPickedFunction(out finalResult))
            {
            }


            var newObject     = new System.Diagnostics.Process();
            var anotherObject = new Program();

            string pString = newObject.ToString();
        }