예제 #1
0
		static void Main(string[] args)
		{
			RegistryHelper.ProductName = "FieldWorks";
			// needed to access proper registry values
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);
			bool fBadArg = false;
			bool fInstall = false;
			for (int i = 0; i < args.Length; ++i)
			{
				if (args[i] == "-i" || args[i] == "-install" || args[i] == "--install")
					fInstall = true;
				else
					fBadArg = true;
			}
			if (fInstall)
			{
				PUAMigrator migrator = new PUAMigrator();
				migrator.Run();
			}
			else if (fBadArg)
			{
				MessageBox.Show("Only one command line argument is recognized:" + Environment.NewLine +
					"\t-i means to install the custom character definitions (as a command line program).",
					"Unicode Character Editor");
			}
			else
			{
				using (var window = new CharEditorWindow())
					Application.Run(window);
			}
		}
예제 #2
0
        static void Main(string[] args)
        {
            RegistryHelper.ProductName = "FieldWorks";
            // needed to access proper registry values
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            bool fBadArg  = false;
            bool fInstall = false;

            for (int i = 0; i < args.Length; ++i)
            {
                if (args[i] == "-i" || args[i] == "-install" || args[i] == "--install")
                {
                    fInstall = true;
                }
                else
                {
                    fBadArg = true;
                }
            }
            if (fInstall)
            {
                PUAMigrator migrator = new PUAMigrator();
                migrator.Run();
            }
            else if (fBadArg)
            {
                MessageBox.Show("Only one command line argument is recognized:" + Environment.NewLine +
                                "\t-i means to install the custom character definitions (as a command line program).",
                                "Unicode Character Editor");
            }
            else
            {
                using (var window = new CharEditorWindow())
                    Application.Run(window);
            }
        }
예제 #3
0
        static void Main(string[] args)
        {
            RegistryHelper.ProductName = "FieldWorks";
            // needed to access proper registry values
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            bool fBadArg  = false;
            bool fInstall = false;

            for (int i = 0; i < args.Length; ++i)
            {
                if (args[i] == "-i" || args[i] == "-install" || args[i] == "--install")
                {
                    fInstall = true;
                }
                else if (args[i] == "--cleanup")
                {
                    if (i + 1 >= args.Length)
                    {
                        return;
                    }

                    var iterationCount = 0;
                    var pid            = int.Parse(args[i + 1]);
                    while (Process.GetProcesses().Any(p => p.Id == pid) && iterationCount < 300)
                    {
                        // wait 1s then try again
                        Thread.Sleep(1000);
                        iterationCount++;
                    }
                    if (iterationCount < 300)
                    {
                        DeleteTemporaryFiles();
                    }
                    return;
                }
                else
                {
                    fBadArg = true;
                }
            }
            if (fInstall)
            {
                PUAMigrator migrator = new PUAMigrator();
                migrator.Run();
            }
            else if (fBadArg)
            {
                MessageBox.Show("Only one command line argument is recognized:" + Environment.NewLine +
                                "\t-i means to install the custom character definitions (as a command line program).",
                                "Unicode Character Editor");
            }
            else
            {
                using (var window = new CharEditorWindow())
                    Application.Run(window);
            }

            LogFile.Release();

            StartCleanup();
        }