Example #1
0
 /// <summary>
 /// Creates a new comparison item and add it to the CopmparisonRepository
 /// </summary>
 /// <param name="id">The comparison unit Id</param>
 /// <param name="comparsionSide">The side of the first string to compare</param>
 /// <param name="str">The string to compare</param>
 private void CreateNewComparisonUnit(string id, ComparisonSide comparsionSide, string str)
 {
     lock (LockObj)//for thread saftey
     {
         var comparisonUnit = new ComparisonUnit(_stringCoparerService);
         //Adds the string to the proper side
         AssignString(comparisonUnit, comparsionSide, str);
         ComparisonRepository.Add(id, comparisonUnit);
     }
 }
Example #2
0
        private void AssignString(ComparisonUnit comparisonUnit, ComparisonSide comparsionSide, string str)
        {
            switch (comparsionSide)
            {
            case ComparisonSide.Right:
                comparisonUnit.Right = str;
                break;

            case ComparisonSide.Left:
                comparisonUnit.Left = str;
                break;
            }
        }