Beispiel #1
0
 private void tsSave_Click(object sender, EventArgs e)
 {
     if (m_hmiDataFile != null)
     {
         if (m_hmiDataFile.FileName != null)
         {
             m_hmiDataFile.SaveFile();
         }
         else
         {
             tsSaveAs_Click(sender, e);
         }
     }
 }
Beispiel #2
0
        private void tsNew_Click(object sender, EventArgs e)
        {
            SaveFileDialog SaveFileDialog1 = new SaveFileDialog();

            SaveFileDialog1.InitialDirectory = System.Windows.Forms.Application.StartupPath + "\\configfile";
            SaveFileDialog1.Filter           = "CFG files (*.dat)|*.dat";
            SaveFileDialog1.FilterIndex      = 1;
            SaveFileDialog1.RestoreDirectory = true;

            if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                m_hmiDataFile = new HmiData();
                m_hmiDataFile.SaveFile(SaveFileDialog1.FileName);
                if (tvPortInfo.Nodes.Count > 0)
                {
                    tvPortInfo.Nodes.Clear();
                }
                SetPortConfigDisplay();
            }
        }