private static NameInstance ToNameInstance(char c, Markup markup, LinearPosition position)
		{
			var glyphNameInstance = CharacterVariationsTranslation.ToNameInstance(c, markup);
			//either the glyph name has markup or diacritics, in which case it is a CNI, which should be encapsulated in the linear position
			//otherwise, a name instance with dummy linear position is returned, whose dummy value should be replaced with the palpable index
			if (glyphNameInstance is CompositeNameInstance)
				return new CompositeNameInstance(glyphNameInstance.ToSingletonList(), position);
			else
				return new AtomicNameInstance(c, position);
		}
		private CompositeNameInstance ToNameInstance(BoxCompositionViewModel newComposition, LinearPosition position)
		{
			//Contract.Assert(newComposition.Boxes.Count == newComposition.Arranger.Positions.Count);
			Contract.AssertForAll(newComposition.Arranger.Positions, NotNull);

			return new CompositeNameInstance(Enumerable.Zip(newComposition.Boxes, newComposition.Arranger.Positions, GetMutation).ToList(), position);
		}
Exemple #3
0
		private static bool AreSequential(LinearPosition first, LinearPosition second)
		{
			return first.EndIndex == second.StartIndex;
		}
Exemple #4
0
		public LinearPosition(LinearPosition start, LinearPosition end)
			: this(start.StartIndex, end.EndIndex)
		{

		}
Exemple #5
0
		public bool Equals(LinearPosition other)
		{
			return other != null
				   && other.StartIndex == this.StartIndex
				   && other.EndIndex == this.EndIndex;
		}