예제 #1
0
 IFormattedLine AddLineTransform(IFormattedLine line, double yPosition, ViewRelativePosition placement)
 {
     if (line != null)
     {
         var lineTransform = lineTransformProvider.GetLineTransform(line, yPosition, placement);
         if (lineTransform != line.LineTransform)
         {
             line.SetLineTransform(lineTransform);
             line.SetChange(TextViewLineChange.NewOrReformatted);
         }
     }
     return(line);
 }
예제 #2
0
            IFormattedLine?GetLineAfter(IFormattedLine line)
            {
                var physLine = GetPhysicalLine(line);
                int index    = physLine.Lines.IndexOf(line);

                if (index < 0)
                {
                    throw new InvalidOperationException();
                }
                if (index + 1 < physLine.Lines.Count)
                {
                    return(physLine.Lines[index + 1]);
                }
                if (physLine.IsLastLine)
                {
                    return(null);
                }
                physLine = GetPhysicalLine(physLine.BufferSpan.End);
                return(physLine.Lines[0]);
            }
예제 #3
0
            IFormattedLine?GetLineBefore(IFormattedLine line)
            {
                var physLine = GetPhysicalLine(line);
                int index    = physLine.Lines.IndexOf(line);

                if (index < 0)
                {
                    throw new InvalidOperationException();
                }
                if (index > 0)
                {
                    return(physLine.Lines[index - 1]);
                }
                if (physLine.BufferSpan.Start.Position == 0)
                {
                    return(null);
                }
                physLine = GetPhysicalLine(physLine.BufferSpan.Start - 1);
                return(physLine.Lines[physLine.Lines.Count - 1]);
            }
예제 #4
0
 public LineInfo(IFormattedLine line)
 {
     Line   = line;
     Visual = line.GetOrCreateVisual();
 }
예제 #5
0
 public LineInfo(IFormattedLine line, double y)
 {
     Line = line;
     Y    = y;
 }
예제 #6
0
 PhysicalLine GetPhysicalLine(IFormattedLine line) => toPhysicalLine[line];
예제 #7
0
				public LineInfo(IFormattedLine line, double y) {
					Line = line;
					Y = y;
				}
예제 #8
0
			PhysicalLine GetPhysicalLine(IFormattedLine line) => toPhysicalLine[line];
예제 #9
0
			IFormattedLine GetLineAfter(IFormattedLine line) {
				var physLine = GetPhysicalLine(line);
				int index = physLine.Lines.IndexOf(line);
				if (index < 0)
					throw new InvalidOperationException();
				if (index + 1 < physLine.Lines.Count)
					return physLine.Lines[index + 1];
				if (physLine.IsLastLine)
					return null;
				physLine = GetPhysicalLine(physLine.BufferSpan.End);
				return physLine.Lines[0];
			}
예제 #10
0
			IFormattedLine GetLineBefore(IFormattedLine line) {
				var physLine = GetPhysicalLine(line);
				int index = physLine.Lines.IndexOf(line);
				if (index < 0)
					throw new InvalidOperationException();
				if (index > 0)
					return physLine.Lines[index - 1];
				if (physLine.BufferSpan.Start.Position == 0)
					return null;
				physLine = GetPhysicalLine(physLine.BufferSpan.Start - 1);
				return physLine.Lines[physLine.Lines.Count - 1];
			}
예제 #11
0
			IFormattedLine AddLineTransform(IFormattedLine line, double yPosition, ViewRelativePosition placement) {
				if (line != null) {
					var lineTransform = lineTransformProvider.GetLineTransform(line, yPosition, placement);
					if (lineTransform != line.LineTransform) {
						line.SetLineTransform(lineTransform);
						line.SetChange(TextViewLineChange.NewOrReformatted);
					}
				}
				return line;
			}
예제 #12
0
			public LineInfo(IFormattedLine line) {
				Line = line;
				Visual = line.GetOrCreateVisual();
			}