Exemplo n.º 1
0
        private DiffMarkerType GetMarkerType(Edit.Type type)
        {
            switch (type)
            {
            case Edit.Type.INSERT:
                return(DiffMarkerType.Added);

            case Edit.Type.DELETE:
                return(DiffMarkerType.Removed);

            case Edit.Type.REPLACE:
                return(DiffMarkerType.Changed);

            default:
                throw new ArgumentOutOfRangeException("type");
            }
        }
Exemplo n.º 2
0
 public override string ToString()
 {
     Edit.Type t = GetType();
     return(t + "(" + beginA + "-" + endA + "," + beginB + "-" + endB + ")");
 }
Exemplo n.º 3
0
        private void WriteLine(StringBuilder @out, List <TextMarker> markers, Text text, int line, Edit.Type editType)
        {
            int start = @out.Length;

            WriteLine(@out, text, line);
            int end = @out.Length;

            Color color;

            switch (editType)
            {
            case Edit.Type.INSERT:
                color = DiffColor.Added.LightColor;
                break;

            case Edit.Type.DELETE:
                color = DiffColor.Removed.LightColor;
                break;

            case Edit.Type.REPLACE:
                color = DiffColor.Changed.LightColor;
                break;

            default:
                throw new ArgumentOutOfRangeException("editType");
            }

            markers.Add(new TextMarker(
                            start,
                            end - start,
                            TextMarkerType.SolidBlock | TextMarkerType.ExtendToBorder,
                            color
                            ));
        }