/// <summary>
 /// this method check the segments for been common for two parcels
 /// </summary>
 /// <param name="seg">segment to check</param>
 /// <param name="j">number of segment in array</param>
 private void DuplicatedSegment(BorderSegment seg, int i)
 {
     for (int j = 0; j < listOfSegments.Count; j++)
     {
         if ((j != i) && (((BorderSegment)listOfSegments[i]).Name() == seg.Name()))
         {
             listOfSegments[j] = null;
         }
     }
 }
        /// <summary>
        /// This method performs the check about whether current border segment was already added to the array of border segments
        /// </summary>
        /// <param name="num">number of segment whitch should be checked</param>
        /// <returns></returns>
        private bool CheckForDuplicatesSegments(BorderSegment seg)
        {
            bool index = false;

            foreach (BorderSegment item in listOfSegments)
            {
                if ((seg.Name() == ((BorderSegment)item).Name()))
                {
                    index = true;
                }
            }
            return(index);
        }
 /// <summary>
 /// this method returns the cadastral number of the parcel which is right to the segment
 /// </summary>
 /// <param name="currentSegment">the current segment</param>
 /// <returns>cadastral number of a right parcel</returns>
 private string ReturnRightParcelNumber(BorderSegment currentSegment)
 {
     for (int i = 0; i < listOfParcels.Count; i++)
     {
         for (int j = 0; j < ((Parcel)listOfParcels[i]).GetNumber; j++)
         {
             if ((((Parcel)listOfParcels[i]).ReturnSegment(j).Name() == currentSegment.Name()) && (((Parcel)listOfParcels[i]).ReturnSegment(j).LeftOrNot == false))
             {
                 return(Convert.ToString(((Parcel)listOfParcels[i]).CadastralNum));
             }
         }
     }
     return("");
 }