Exemplo n.º 1
0
		/// <summary>
		/// Returns a range with the smaller Start and the bigger End. The Union of the 2 Range. If one of the range is empty then the return is the other range.
		/// </summary>
		/// <param name="p_Range1"></param>
		/// <param name="p_Range2"></param>
		/// <returns></returns>
		public static Range Union(Range p_Range1, Range p_Range2)
		{
			if (p_Range1.IsEmpty())
				return p_Range2;
			else if (p_Range2.IsEmpty())
				return p_Range1;
			else
				return new Range(Position.MergeMinor(p_Range1.Start, p_Range2.Start),
							Position.MergeMajor(p_Range1.End, p_Range2.End), false);
		}
Exemplo n.º 2
0
 /// <summary>
 /// Returns a range with the smaller Start and the bigger End. The Union of the 2 Range. If one of the range is empty then the return is the other range.
 /// </summary>
 /// <param name="p_Range1"></param>
 /// <param name="p_Range2"></param>
 /// <returns></returns>
 public static Range Union(Range p_Range1, Range p_Range2)
 {
     if (p_Range1.IsEmpty())
     {
         return(p_Range2);
     }
     else if (p_Range2.IsEmpty())
     {
         return(p_Range1);
     }
     else
     {
         return(new Range(Position.MergeMinor(p_Range1.Start, p_Range2.Start),
                          Position.MergeMajor(p_Range1.End, p_Range2.End), false));
     }
 }