Beispiel #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            _providerFactory = new CodeProviderFactory();
            cboCodeProvider.Items.AddRange(_providerFactory.GetAvailableProviderNames());
            if (cboCodeProvider.Items.Count > 0)
            {
                cboCodeProvider.SelectedIndex = 0;
            }

            RefreshProcessList();

            _currentProject = new RecorderProject();
            recorderProjectBindingSource.DataSource = _currentProject;
            _currentProject.IsDirty = false;
            UpdateTitle();
            InitializeMru();
        }
Beispiel #2
0
        private void LoadProject(string fileName)
        {
            try
            {
                using (var stream = File.OpenRead(fileName))
                {
                    var formatter = new BinaryFormatter();
                    _currentProject = (RecorderProject)formatter.Deserialize(stream);
                }

                LoadControlValuesFromProject();

                _currentProject.FileName = fileName;
                _currentProject.IsDirty  = false;
                UpdateTitle();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Loading project failed.\r\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }