Example #1
0
        private void btnFileOldDatabase_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = txtPathOldDatabase.Text;
            DialogResult r = openFileDialog1.ShowDialog();

            if (r == System.Windows.Forms.DialogResult.OK)
            {
                txtFileOldDatabase.Text = Path.GetFileName(openFileDialog1.FileName);
                txtPathOldDatabase.Text = Path.GetDirectoryName(openFileDialog1.FileName);
            }
            if (!File.Exists(txtPathOldDatabase.Text + "\\" + txtFileOldDatabase.Text))
            {
                Console.Beep();
                return;
            }
            dbOld = new DbAndBusiness(
                txtPathOldDatabase.Text + "\\" + txtFileOldDatabase.Text);

            treeOld = new TreeMptt(trwOldTopics,
                                   txtOldTopicName, txtOldDescription, txtSearchOld, null, txtCodOldTopic,
                                   Commons.globalPicLed, DragDropEffects.Copy);
            treeOld.AddNodesToTreeviewByBestMethod();
            treeOld.ClearBackColorOnClick = false;

            highligthDifferences();
        }
Example #2
0
        private void btnFileNewDatabase_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = txtPathNewDatabase.Text;
            DialogResult r = openFileDialog1.ShowDialog();

            if (r == System.Windows.Forms.DialogResult.OK)
            {
                txtFileNewDatabase.Text = Path.GetFileName(openFileDialog1.FileName);
                txtPathNewDatabase.Text = Path.GetDirectoryName(openFileDialog1.FileName);
            }

            dbNew = new DbAndBusiness(txtPathNewDatabase.Text + "\\" + txtFileNewDatabase.Text);
            //List<Topic> lNew = dbNew.GetTopicsByParent();

            treeNew = new TreeMptt(dbNew, trwNewTopics,
                                   txtNewTopicName, txtNewDescription, null, null, txtCodNewTopic,
                                   Commons.globalPicLed, DragDropEffects.Copy);
            treeNew.AddNodesToTreeviewByBestMethod();
            treeNew.ClearBackColorOnClick = false;
        }
        private void btnFileOldDatabase_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = txtPathOldDatabase.Text;
            DialogResult r = openFileDialog1.ShowDialog();

            if (r == System.Windows.Forms.DialogResult.OK)
            {
                txtFileOldDatabase.Text = Path.GetFileName(openFileDialog1.FileName);
                txtPathOldDatabase.Text = Path.GetDirectoryName(openFileDialog1.FileName);
            }
            if (!File.Exists(txtPathOldDatabase.Text + "\\" + txtFileOldDatabase.Text))
            {
                Console.Beep();
                return;
            }
            DataLayer dlOld = new DataLayer(
                txtPathOldDatabase.Text + "\\" + txtFileOldDatabase.Text);

            treeOld = new TreeMptt(dlOld, trwOldTopics,
                                   txtOldTopicName, txtOldDescription, txtSearchOld, null, txtCodOldTopic,
                                   CommonsWinForms.globalPicLed, DragDropEffects.Copy);
            treeOld.Name = "treeOld";
            treeOld.AddNodesToTreeviewByBestMethod();
            treeOld.ClearBackColorOnClick = false;

            // stop background saving thread when using this form so it will not interfere
            // locks a concurrent modification of syncronyzing variables
            lock (CommonsWinForms.LockBackgroundSavingVariables)
            {
                CommonsWinForms.BackgroundSavingEnabled = false;
                CommonsWinForms.BackgroundTaskClose     = true;
            }
            // we wait for the saving Thread to finish
            // (it aborts in a point in which status is preserved)
            CommonsWinForms.BackgroundSaveThread.Join(3000);

            highligthDifferences();
        }
Example #4
0
        private void frmTopicsRecover_Load(object sender, EventArgs e)
        {
            Commons.ReadConfigFile();
            txtPathNewDatabase.Text = Commons.PathDatabase;
            txtPathOldDatabase.Text = Commons.PathDatabase;
            txtFileNewDatabase.Text = Commons.FileDatabase;

            DbAndBusiness dbNew = new DbAndBusiness(txtPathNewDatabase.Text + "\\" + txtFileNewDatabase.Text);

            treeNew = new TreeMptt(trwNewTopics,
                                   txtNewTopicName, txtNewDescription, txtSearchNew, null, txtCodNewTopic,
                                   Commons.globalPicLed, DragDropEffects.Copy);
            treeNew.AddNodesToTreeviewByBestMethod();
            treeNew.ClearBackColorOnClick = false;

            picNewOnly.BackColor  = colorNewOnly;
            picOldOnly.BackColor  = colorOldOnly;
            picSameId.BackColor   = colorSameId;
            picSameName.BackColor = colorSameName;
            picSameDesc.BackColor = colorSameDesc;
            picSameNodeChangedParent.BackColor   = colorSameNodeChangedParent;
            picSameNodeChangedPosition.BackColor = colorSameNodeChangedPosition;
        }