| ofs | hex dump | ascii |
|---|
| 0000 | 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 01 f1 00 00 02 58 08 06 00 00 00 72 c9 df | .PNG........IHDR.......X.....r.. |
| 0020 | c6 00 00 20 00 49 44 41 54 78 9c ec dd 79 90 6c d9 5d 1f f8 ef 39 e7 6e b9 56 d6 fa ea 2d fd fa | .....IDATx...y.l.]...9.n.V...-.. |
| 0040 | f5 53 ab d5 b4 1a 49 28 04 34 a8 05 2d 8f c0 16 01 58 48 34 f6 20 c0 b2 41 08 f0 18 8f 67 8c b1 | .S....I(.4..-....XH4....A....g.. |
| 0060 | 67 82 71 13 31 13 0a 8f 30 33 08 b7 70 4b e1 91 b1 84 b0 5b f3 c7 30 e3 d1 80 c0 b4 04 42 10 d0 | g.q.1...03..pK.....[..0......B.. |
| 0080 | 1b ad a5 5b ad 5e de d6 ef d5 ab 35 f7 bc 79 97 73 e6 8f 9b 99 95 b5 57 65 65 55 6e df 4f 44 bd | ...[.^.....5..y.s......WeeUn.OD. |
| 00a0 | 57 95 cb cd 5f 65 55 e5 37 cf b9 67 11 20 a2 a1 f2 f0 a3 4f 64 61 d9 33 91 0e f3 32 36 69 48 91 | W..._eU.7..g.......Oda.3...26iH. |
| 00c0 | 87 30 79 a1 55 56 48 93 36 46 e4 01 31 65 84 c9 c2 c0 13 42 e4 61 60 01 da 13 90 9e 81 71 00 64 | .0y.UVH.6F..1e.....B.a`......q.d |
| 00e0 | 85 00 60 50 68 1d 36 0f c0 02 00 88 2d 0f 27 5b d7 ed 26 02 50 dd e3 ba 3a 00 1f 40 20 92 cf 35 | ..`Ph.6.....-.'[..&.P...:..@...5 |
| 0100 | 20 8a c9 55 a6 0c 21 b4 30 ba 0a 21 02 63 44 d1 08 5d 13 46 54 8d 41 15 12 45 69 64 dd e8 b8 6a | ...U..!.0..!.cD..].FT.A..Eid...j |
| 0120 | 84 2a 6b a9 cb 8e 0a cb 39 5d 58 ff f8 87 de 16 f5 fc c4 11 4d 20 71 f0 4d 88 a8 57 3f f4 d8 93 | .*k.....9]X.........M.q.M..W?... |
| 0140 | 69 27 6e 2c 0a a3 17 61 e2 39 28 b5 08 a3 17 20 c4 2c 8c 99 11 10 33 06 28 00 98 e9 fa 70 f6 3f | i'n,...a.9(......,....3.(....p.? |
| 0160 | ea e1 fe 6c f7 bc 55 9f ff ea fb 7c b8 aa 80 58 d7 30 eb 10 58 17 30 eb 10 62 1d c6 ac 43 88 15 | ...l..U....|...X.0..X.0..b.// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using Tango.Scripting.Editors.Document;
namespace Tango.Scripting.Editors.Editing
{
/// <summary>
/// Represents a selected segment.
/// </summary>
public class SelectionSegment : ISegment
{
readonly int startOffset, endOffset;
readonly int startVC, endVC;
/// <summary>
/// Creates a SelectionSegment from two offsets.
/// </summary>
public SelectionSegment(int startOffset, int endOffset)
{
this.startOffset = Math.Min(startOffset, endOffset);
this.endOffset = Math.Max(startOffset, endOffset);
this.startVC = this.endVC = -1;
}
/// <summary>
/// Creates a SelectionSegment from two offsets and visual columns.
/// </summary>
public SelectionSegment(int startOffset, int startVC, int endOffset, int endVC)
{
if (startOffset < endOffset || (startOffset == endOffset && startVC <= endVC)) {
this.startOffset = startOffset;
this.startVC = startVC;
this.endOffset = endOffset;
this.endVC = endVC;
} else {
this.startOffset = endOffset;
this.startVC = endVC;
this.endOffset = startOffset;
this.endVC = startVC;
}
}
/// <summary>
/// Gets the start offset.
/// </summary>
public int StartOffset {
get { return startOffset; }
}
/// <summary>
/// Gets the end offset.
/// </summary>
public int EndOffset {
get { return endOffset; }
}
/// <summary>
/// Gets the start visual column.
/// </summary>
public int StartVisualColumn {
get { return startVC; }
}
/// <summary>
/// Gets the end visual column.
/// </summary>
public int EndVisualColumn {
get { return endVC; }
}
/// <inheritdoc/>
int ISegment.Offset {
get { return startOffset; }
}
/// <inheritdoc/>
public int Length {
get { return endOffset - startOffset; }
}
/// <inheritdoc/>
public override string ToString()
{
return string.Format("[SelectionSegment StartOffset={0}, EndOffset={1}, StartVC={2}, EndVC={3}]", startOffset, endOffset, startVC, endVC);
}
}
}
|