コード例 #1
0
ファイル: SelectionUtilities.cs プロジェクト: 0xd4d/dnSpy
		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;
		}
コード例 #2
0
ファイル: HexCaretLayer.cs プロジェクト: manojdjoshi/dnSpy
			public SelectionState(HexSelection selection) {
				state = (byte)(selection.IsEmpty ? 1 : 0);
			}