Ejemplo n.º 1
0
        public MainForm()
        {
            InitializeComponent();

            // Set form name
            Text = Config.App.name + Config.App.verison;

            // Load settings
            AddStatusNewLine(Config.StatusMessages.loadingXMlSettings);
            var settingsStatus = Settings.Read.XML();

            AddStatusInLine(settingsStatus);

            // Force settings form on error
            if (settingsStatus.StartsWith(Config.StatusMessages.error))
            {
                MessageBox.Show(Config.ErrorMessages.noSettingsFiles);
                Settings.SettingsForm settingsForm = new Settings.SettingsForm(this);
                settingsForm.ShowDialog();
                return;
            }

            // Load fixture data XML
            AddStatusNewLine(Config.StatusMessages.loadingXMlFixtureData);
            AddStatusInLine(FixtureTypes.Read.XML());

            // Load fixture profile XML
            FixtureTypes.Read.ProfileXML(this);

            // Load patch data XML
            AddStatusNewLine(Config.StatusMessages.loadingXMlPatchData);
            AddStatusInLine(Patch.Read.XML());

            // Set patch file value
            patchFileTextBox.Text = Patch.Data.ExcelFilePath;

            // Verify patch data and clear all if errors are found
            if (Patch.Verify.ErrorCheckData(this))
            {
                // Clear all patch data
                Patch.Data.ClearAll();

                // Save cleared data to XML
                Patch.Save.XML(patchFileTextBox.Text);
            }

            // Load data grid
            Mapping.Grid.UpdateFromXML(this);

            // Set data grid data source
            SetGridColumnDataSource();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Settings button click
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SettingsButton_Click(object sender, EventArgs e)
 {
     Settings.SettingsForm settingsForm = new Settings.SettingsForm(this);
     settingsForm.ShowDialog();
 }