示例#1
0
        public bool ChangeSettings(Point topLeft)
        {
            string module = $"{_product}.{_class}.{MethodBase.GetCurrentMethod().Name}()";

            try
            {
                Telemetry.Write(module, "Verbose", "Called");
                _searcherOptions = new ExampleOptions(SettingsPath);

                ExampleSettings settings = new ExampleSettings();
                settings.Telemetry = Telemetry;
                settings.TopLeft   = topLeft;

                var tempOptions = _searcherOptions.Clone();
                settings.SettingsPath    = SettingsPath;
                settings.SearcherOptions = tempOptions;

                DialogResult dr = settings.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    _searcherOptions = tempOptions.Clone();
                }
                settings.Close();
            }
            catch (Exception ex)
            {
                new ReportError(Telemetry, TopLeft, module, ex).ShowDialog();
            }
            return(true);
        }