Example #1
0
        /// <summary>
        /// Init code to be called on the application startup.
        /// Return false if no merge utility was found and user wanted to quit the app.
        /// </summary>
        public bool Initialize()
        {
            // Verify the application default merge utility
            AppHelper app = new AppHelper(Properties.Settings.Default.MergeAppHelper);

            if (File.Exists(app.Path))
            {
                Configure(app);
                return(true);
            }

            // Search for any of the predefined tools
            merge = GetDetected();

            // If none of the pre-set merge apps are present, show the missing merge dialog
            // and return with its selection of whether to continue or quit the app
            if (merge.Count == 0)
            {
                FormMergeMissing formMergeMissing = new FormMergeMissing();
                return(formMergeMissing.ShowDialog() == DialogResult.OK);
            }

            // Otherwise, at least one merge app is present, select it as default
            Properties.Settings.Default.MergeAppHelper = merge[0].ToString();

            Configure(merge[0]);
            return(true);
        }
Example #2
0
        /// <summary>
        /// Init code to be called on the application startup.
        /// Return false if no merge utility was found and user wanted to quit the app.
        /// </summary>
        public bool Initialize()
        {
            // Verify the application default merge utility
            AppHelper app = new AppHelper(Properties.Settings.Default.MergeAppHelper);
            if (File.Exists(app.Path))
            {
                Configure(app);
                return true;
            }

            // Search for any of the predefined tools
            merge = GetDetected();

            // If none of the pre-set merge apps are present, show the missing merge dialog
            // and return with its selection of whether to continue or quit the app
            if (merge.Count == 0)
            {
                FormMergeMissing formMergeMissing = new FormMergeMissing();
                return formMergeMissing.ShowDialog() == DialogResult.OK;
            }

            // Otherwise, at least one merge app is present, select it as default
            Properties.Settings.Default.MergeAppHelper = merge[0].ToString();

            Configure(merge[0]);
            return true;
        }