Example #1
0
        public void ProfileOpenAction(object sender, EventArgs e)
        {
            OpenFileDialog dialog   = new OpenFileDialog();
            FileInfo       fileInfo = new FileInfo(m_options.coreOptionsFileName);

            if (fileInfo.Exists)
            {
                dialog.FileName         = m_options.coreOptionsFileName;
                dialog.InitialDirectory = fileInfo.Directory.ToString();
            }
            else
            {
                dialog.InitialDirectory = Resources.ProfilesPath;
            }
            dialog.DefaultExt = "xml";
            dialog.Filter     = "Antidupl profile files (*.xml)|*.xml";
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                if (string.Compare(dialog.FileName, m_options.coreOptionsFileName) != 0)
                {
                    m_coreOptions.Save(m_options.coreOptionsFileName);
                    ProgressForm saveProgressForm = new ProgressForm(ProgressForm.Type.SaveResults, m_core, m_options, m_coreOptions, m_mainSplitContainer);
                    saveProgressForm.Execute();
                    m_options.coreOptionsFileName = dialog.FileName;
                }

                CoreOptions coreOptions = CoreOptions.Load(m_options.coreOptionsFileName, m_core, m_options.onePath);
                coreOptions.CopyTo(ref m_coreOptions);
                ProgressForm loadProgressForm = new ProgressForm(ProgressForm.Type.LoadResults, m_core, m_options, m_coreOptions, m_mainSplitContainer);
                loadProgressForm.Execute();

                m_mainForm.UpdateCaption();
                m_options.Change();
            }
        }
Example #2
0
        public MainForm()
        {
            m_core    = new CoreLib(Resources.UserPath);
            m_options = Options.Load();
            if (m_options.loadProfileOnLoading)
            {
                m_coreOptions = CoreOptions.Load(m_options.coreOptionsFileName, m_core, m_options.onePath);
            }
            else
            {
                m_options.coreOptionsFileName = Options.GetDefaultCoreOptionsFileName();
                m_coreOptions = new CoreOptions(m_core);
            }
            Resources.Strings.SetCurrent(m_options.Language);

            StartFinishForm startFinishForm = new StartFinishForm(m_core, m_options);

            startFinishForm.ExecuteStart();

            InitializeComponents();
        }