public bool SavePref()
        {
            bool       ret         = true;
            Preference perfInst    = Preference.GetInstace();
            string     curVsmdPort = cmbPort.SelectedItem.ToString();
            int        curBaudrate = int.Parse(cmbBaudrate.SelectedItem.ToString());
            bool       pumpExist   = bool.Parse(ConfigurationManager.AppSettings["PumpExist"]);
            string     pumpPort    = perfInst.PumpPort;

            if (pumpExist)
            {
                cmbPumpPort.SelectedItem.ToString();
            }
            if (perfInst.VsmdPort != curVsmdPort ||
                perfInst.Baudrate != curBaudrate ||
                perfInst.PumpPort != pumpPort)
            {
                perfInst.VsmdPort = curVsmdPort;
                perfInst.Baudrate = curBaudrate;
                perfInst.PumpPort = pumpPort;
                ret = perfInst.Save();
            }


            return(ret);
        }
Exemple #2
0
        public bool SavePref()
        {
            bool       ret               = true;
            Preference perfInst          = Preference.GetInstace();
            BoardMeta  selectedBoardMeta = cmbBoards.SelectedItem as BoardMeta;

            if (selectedBoardMeta != null && selectedBoardMeta.ID != perfInst.BoardID)
            {
                perfInst.BoardID = selectedBoardMeta.ID;
                ret = perfInst.Save();
            }

            return(ret);
        }
        public bool SavePref()
        {
            bool       ret         = true;
            Preference perfInst    = Preference.GetInstace();
            string     curVsmdPort = cmbPort.SelectedItem.ToString();
            int        curBaudrate = int.Parse(cmbBaudrate.SelectedItem.ToString());
            string     pumpPort    = cmbPumpPort.SelectedItem.ToString();

            if (perfInst.VsmdPort != curVsmdPort ||
                perfInst.Baudrate != curBaudrate ||
                perfInst.PumpPort != pumpPort)
            {
                perfInst.VsmdPort = curVsmdPort;
                perfInst.Baudrate = curBaudrate;
                perfInst.PumpPort = pumpPort;
                ret = perfInst.Save();
            }


            return(ret);
        }