Beispiel #1
0
		public static HexBufferSpan GetLineAnchorSpan(HexSelection selection) {
			if (selection == null)
				throw new ArgumentNullException(nameof(selection));
			if (selection.IsEmpty)
				return selection.HexView.Caret.ContainingHexViewLine.BufferSpan;
			var anchorExtent = selection.HexView.GetHexViewLineContainingBufferPosition(selection.AnchorPoint).BufferSpan;
			if (selection.AnchorPoint >= selection.ActivePoint) {
				if (anchorExtent.Start == selection.AnchorPoint && selection.AnchorPoint > selection.HexView.BufferLines.BufferStart)
					anchorExtent = selection.HexView.GetHexViewLineContainingBufferPosition(selection.AnchorPoint - 1).BufferSpan;
			}
			return anchorExtent;
		}
Beispiel #2
0
			public SelectionState(HexSelection selection) {
				state = (byte)(selection.IsEmpty ? 1 : 0);
			}