Esempio n. 1
0
        private void serializeTree()
        {
            CSerialize ser = new CSerialize();

            ser.FileName = sRootDir + sSerializeName;
            ser.Serialize(m_Tree);
        }
Esempio n. 2
0
        private void FormDataBaseSync_Load(object sender, EventArgs e)
        {
            CTool.CheckPathExistOrCreate(m_SerializeConnectsPath);
            if (File.Exists(m_SerializeConnectsPath))
            {
                CSerialize ser = new CSerialize();
                ser.FileName = m_SerializeConnectsPath;
                m_db2Alias   = (List <SDB2Connection>)ser.DeSerialize();
            }
            else
            {
                CDB2ConnectInfo db2Info = new CDB2ConnectInfo();
                m_db2Alias = db2Info.m_conns;
            }

            /*初始化下拉框*/
            {
                this.comboBox_dDB.Items.Clear();
                this.comboBox_sDB.Items.Clear();
                foreach (SDB2Connection con in m_db2Alias)
                {
                    this.comboBox_sDB.Items.Add(con.alias);
                    this.comboBox_dDB.Items.Add(con.alias);
                }
            }
        }
Esempio n. 3
0
        private void deserializeTree()
        {
            CSerialize ser = new CSerialize();

            ser.FileName = sRootDir + sSerializeName;
            if (File.Exists(ser.FileName))
            {
                m_Tree = (List <SKnowledgeNode>)ser.DeSerialize();
            }
            else
            {
                m_Tree = new List <SKnowledgeNode>();
            }
        }
Esempio n. 4
0
        private void button_SaveConfig_Click(object sender, EventArgs e)
        {
            SDB2Connection sConn, dConn;

            getSourceDBAndDestDBInfo(out sConn, out dConn);
            if (sConn != null)
            {
                sConn.user   = textBox_sDBUser.Text;
                sConn.passwd = textBox_sDBPwd.Text;
            }
            if (dConn != null)
            {
                dConn.user   = textBox_dDBUser.Text;
                dConn.passwd = textBox_dDBPwd.Text;
            }

            CTool.CheckPathExistOrCreate(m_SerializeConnectsPath);
            CSerialize ser = new CSerialize();

            ser.FileName = m_SerializeConnectsPath;
            ser.Serialize(m_db2Alias);
        }