Ejemplo n.º 1
0
        private void m_btnBar1Save_Click(object sender, EventArgs e)
        {
            CCSupportBarInfo info       = new CCSupportBarInfo();
            SaveFileDialog   DialogSave = new SaveFileDialog();

            DialogSave.Filter           = "Ini file (*.ini)|";
            DialogSave.DefaultExt       = "ini";
            DialogSave.InitialDirectory = info.IniDirPath;
            DialogSave.RestoreDirectory = false;

            if (DialogSave.ShowDialog() == DialogResult.OK)
            {
                if (DialogSave.FileName != "")
                {
                    IniFile iniFile = new IniFile(DialogSave.FileName);

                    iniFile.WriteValue("Glass Bar 1", "Start Position", m_tbxBar1StartPos.Text);
                    iniFile.WriteValue("Glass Bar 1", "End Position", m_tbxBar1EndPos.Text);

                    iniFile.WriteValue("Glass Bar 2", "Start Position", m_tbxBar2StartPos.Text);
                    iniFile.WriteValue("Glass Bar 2", "End Position", m_tbxBar2EndPos.Text);
                }
            }
            DialogSave.Dispose();
            DialogSave = null;
        }
Ejemplo n.º 2
0
        public CCSupportBarControl1()
        {
            InitializeComponent();

            // 將資料交由 InfoObjectFactory 管理
            CCSupportBarInfo info = new CCSupportBarInfo();

            InfoObjectFactory.AddInfoObj(info.Name, info);
        }