Exemplo n.º 1
0
 private void cmdSaveConfig_Click(object sender, EventArgs e)
 {
     try
     {
         FileOperator.WriteConfig(configPath, config);
     }
     catch (Exception)
     {
         MessageBox.Show("Konfiguration konnte nicht gespeichert werden");
     }
 }
Exemplo n.º 2
0
        public MainInterfacefrm()
        {
            #region initialize
            InitializeComponent();
            // read config from file
            try
            {
                config = FileOperator.ReadConfig(configPath);
            }
            catch (Exception)
            {
                MessageBox.Show("Konfiguration konnte nicht gelesen werden.\nStandardkonfiguration wurde erstellt");
                config = new Configuration()
                {
                    EnginePause = 20
                };

                // add standard positions
            }
            controlList = new ControlList();

            #region initializeControls
            cboPorts.Items.AddRange(SerialPort.GetPortNames());
            numericEnginePause.Value = config.EnginePause;
            cboSavedPositions.Items.Add("slider input");
            cboSavedPositions.SelectedIndex = 0;
            foreach (SavedPosition p in config.StandardPositions)
            {
                cboSavedPositions.Items.Add(p.Name);
            }
            #endregion
            #endregion

            #region appearance
            MaterialSkinManager materialSkinManager = MaterialSkinManager.Instance;
            materialSkinManager.AddFormToManage(this);
            materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;

            materialSkinManager.ColorScheme = new ColorScheme(
                Primary.Orange400, Primary.Orange800,
                Primary.Orange500, Accent.DeepOrange700,
                TextShade.WHITE);
            #endregion
        }