Esempio n. 1
0
        static void Main(string[] args)
        {
            bool registryProcessed = false;

            try
            {
                registryProcessed = SetRegistry.CheckCommandLineArgs(args);  // If specified in the args, updates the registry
            }
            catch (Exception ex)
            {
                registryProcessed = true;
                MessageBox.Show(ex.Message, "Error updating the registry", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (!registryProcessed)
            {
                SearchAndReplaceParameters searchAndReplaceParameters = new SearchAndReplaceParameters(args);

                if (searchAndReplaceParameters.NoUI)
                {
                    SearchAndReplace.SearchAndReplaceInFile(searchAndReplaceParameters);
                }
                else
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new FormJSearchAndReplace(searchAndReplaceParameters));
                }
            }
        }
Esempio n. 2
0
        private void buttonGo_Click(object sender, EventArgs e)
        {
            SearchAndReplaceParameters searchAndReplaceParameters = GetSearchAndReplaceParameters();

            SearchAndReplace.SearchAndReplaceInFile(searchAndReplaceParameters);
        }