Esempio n. 1
0
        // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

        static public void Exec(TStrings _Lines, TStrings Text1, TStrings Text2)
        {
            bool Continue;

            Lines = _Lines;
            File1 = Text1;
            File2 = Text2;

            //ToDo: //ToDo: Basics.ShowWaitCursor(true);

            try
            {
                //
                // - - -  - - -

                //Last[ 1 ]      = 0;
                //Last[ 2 ]      = 0;
                LastEqualLine = 0;
                Nr            = 0;

                Continue = true;

                while (Continue)
                {
                    Continue = ReadUntilDiff();

                    if (Continue)
                    {
                        Continue = ReSync();
                    }
                }

                //if( !Continue ) Beenden();
            }
            finally
            {
            }

            while (Lines.Count < File1.Count)
            {
                Lines.Add("=");
            }
            ;

            while (Lines.Count < File2.Count)
            {
                Lines.Add("=");
            }
            ;

            for (int i = 0; i < Lines.Count; i++)
            {
                try
                {
                    if ((Lines[i] == "#") && (File1.GetObject(i) == null))
                    {
                        Lines[i] = ">";
                    }
                }
                catch
                {
                    Lines[i] = ">";
                };

                try
                {
                    if ((Lines[i] == "#") && (File2.GetObject(i) == null))
                    {
                        Lines[i] = "<";
                    }
                }
                catch
                {
                    Lines[i] = "<";
                };
            }
            ;

            //ToDo: Basics.ShowWaitCursor(false);
        }
Esempio n. 2
0
        private void DisplayCompareFiles()
        {
            listView.OwnerDraw = !blackWhiteToolStripMenuItem.Checked;

            listView.Items.Clear();
            for (int i = 0; i < Lines.Count; i++)
            {
                ListViewItem lvi = listView.Items.Add("");

                try
                {
                    if (Lines[i] == " ")
                    {
                        lvi.ImageIndex = 0;
                    }
                    if (Lines[i] == "=")
                    {
                        lvi.ImageIndex = 0;
                    }
                    if (Lines[i] == "<")
                    {
                        lvi.ImageIndex = 1;
                    }
                    if (Lines[i] == ">")
                    {
                        lvi.ImageIndex = 2;
                    }
                    if (Lines[i] == "#")
                    {
                        lvi.ImageIndex = 3;
                    }
                }
                catch { };

                lvi.SubItems.Add("");
                DisplayCompareFilesLineNo(lvi, i);

                ListViewItem.ListViewSubItem SubItem;

                if (i < File1.Count)
                {
                    SubItem     = lvi.SubItems.Add(File1[i]);
                    SubItem.Tag = File1.GetObject(i);
                }
                else
                {
                    SubItem = lvi.SubItems.Add("");
                    //SubItem.Tag = File1.GetObject( i );
                    lvi.ImageIndex = 2;
                };

                if (i < File2.Count)
                {
                    SubItem     = lvi.SubItems.Add(File2[i]);
                    SubItem.Tag = File2.GetObject(i);
                }
                else
                {
                    SubItem = lvi.SubItems.Add("");
                    //SubItem.Tag = File1.GetObject( i );
                    lvi.ImageIndex = 1;
                };
            }
            ;
        }