Ejemplo n.º 1
0
        /// <summary>
        /// Выполнить поиск дублирующихся строк программного кода
        /// </summary>
        /// <param name="AllSourceRows"></param>
        public override void FindDuplicatedRows(List <CExtendedCodeUnit> AllSourceRows)
        {
            OnCloneSearchStart();

            if (!GetCancelOperationFlag())
            {
                for (int rows_counter = 0; rows_counter < AllSourceRows.Count; rows_counter++)
                {
                    if (!GetCancelOperationFlag())
                    {
                        try
                        {
                            m_ClonedRowsContainer.Add(AllSourceRows[rows_counter]);
                        }
                        catch
                        {
                            System.Diagnostics.Debug.Assert(false, "Исключение в FindDuplicatedRows()");
                        }
                        OnCloneSearchProgress();
                    }
                    else
                    {
                        break;
                    }
                }
            }

            OnCloneSearchEnd();
        }
Ejemplo n.º 2
0
        private void AddAndTestValue(ref CClonedRowsContainer target, CExtendedCodeUnit item, int number)
        {
            Assert.IsNotNull(item);
            target.Add(item);

            List <CExtendedCodeUnit> rows = target.GetEqualRows(item);

            Assert.AreEqual(rows.Count, number);
            Assert.AreEqual(rows[number - 1], item);
        }