Example #1
0
		/// <summary> If this index is the special value "Last", then its explicit value is returned. Otherwise, its this instance is simply returned. </summary>
		/// <param name="box"> The box in which this internal index points. </param>
		/// <param name="elementIndex"> The index of the element in which this internal index points. </param>
		internal InternalIndex MakeLastExplicit(BoxElementsCollection box, ElementIndex elementIndex)
		{
			if (this != Last)
				return this;
			IBoxElement element = (IBoxElement)box[elementIndex];
			return MakeLastExplicit(element);
		}
Example #2
0
		public ExplicitIndex(ElementIndex elementIndex, InternalIndex indexInElement)
			: this()
		{
			this.ElementIndex = elementIndex;
			this.IndexInElement = indexInElement;
		}
Example #3
0
		/// <summary> Returns whether the specified element is at the specified index in that element's Box. Returns false if the index is out of range in the element.Box.Elements collection. </summary>
		/// <param name="element"> The element to check to be present at the specified index. </param>
		/// <param name="index"> The index to be checked for being in range and pointing to the specified element. </param>
		private static bool ElementIsAt(ElementIndex index, IBoxElement element)
		{
			return 0 <= index
				&& index < element.Box.Elements.ElementCount
				&& element.Box[index] == element;
		}
Example #4
0
		public ExplicitIndex(ElementIndex elementIndex) : this(elementIndex, new InternalIndex(0)) { }
		/// <summary> Translates the element indices to palpable indices. </summary>
		private int ToPalpableIndex(ElementIndex elementIndex)
		{
			return elementIndex.ToPalpableIndex(owner);
		}