Exemplo n.º 1
0
		void HandleSelection (int lineOffset, int logicalRulerColumn, int selectionStart, int selectionEnd, int startOffset, int endOffset, HandleSelectionDelegate handleNotSelected, HandleSelectionDelegate handleSelected)
		{
			int selectionStartColumn = selectionStart - lineOffset;
			int selectionEndColumn = selectionEnd - lineOffset;
			int rulerOffset = lineOffset + logicalRulerColumn;
			if (textEditor.Options.ShowRuler && selectionStartColumn < logicalRulerColumn && logicalRulerColumn < selectionEndColumn && startOffset < rulerOffset && rulerOffset < endOffset) {
				InternalHandleSelection (selectionStart, selectionEnd, startOffset, rulerOffset, handleNotSelected, handleSelected);
				InternalHandleSelection (selectionStart, selectionEnd, rulerOffset, endOffset, handleNotSelected, handleSelected);
			} else {
				InternalHandleSelection (selectionStart, selectionEnd, startOffset, endOffset, handleNotSelected, handleSelected);
			}
		}
Exemplo n.º 2
0
 protected static void HandleSelection(long selectionStart, long selectionEnd, long startOffset, long endOffset, HandleSelectionDelegate handleNotSelected, HandleSelectionDelegate handleSelected)
 {
     if (startOffset >= selectionStart && endOffset <= selectionEnd)
     {
         if (handleSelected != null)
         {
             handleSelected(startOffset, endOffset);
         }
     }
     else if (startOffset >= selectionStart && startOffset < selectionEnd && endOffset > selectionEnd)
     {
         if (handleSelected != null)
         {
             handleSelected(startOffset, selectionEnd);
         }
         if (handleNotSelected != null)
         {
             handleNotSelected(selectionEnd, endOffset);
         }
     }
     else if (startOffset < selectionStart && endOffset > selectionStart && endOffset <= selectionEnd)
     {
         if (handleNotSelected != null)
         {
             handleNotSelected(startOffset, selectionStart);
         }
         if (handleSelected != null)
         {
             handleSelected(selectionStart, endOffset);
         }
     }
     else if (startOffset < selectionStart && endOffset > selectionEnd)
     {
         if (handleNotSelected != null)
         {
             handleNotSelected(startOffset, selectionStart);
         }
         if (handleSelected != null)
         {
             handleSelected(selectionStart, selectionEnd);
         }
         if (handleNotSelected != null)
         {
             handleNotSelected(selectionEnd, endOffset);
         }
     }
     else
     {
         if (handleNotSelected != null)
         {
             handleNotSelected(startOffset, endOffset);
         }
     }
 }
Exemplo n.º 3
0
		static void InternalHandleSelection (int selectionStart, int selectionEnd, int startOffset, int endOffset, HandleSelectionDelegate handleNotSelected, HandleSelectionDelegate handleSelected)
		{
			if (startOffset >= selectionStart && endOffset <= selectionEnd) {
				if (handleSelected != null)
					handleSelected (startOffset, endOffset);
			} else if (startOffset >= selectionStart && startOffset <= selectionEnd && endOffset >= selectionEnd) {
				if (handleSelected != null)
					handleSelected (startOffset, selectionEnd);
				if (handleNotSelected != null)
					handleNotSelected (selectionEnd, endOffset);
			} else if (startOffset < selectionStart && endOffset > selectionStart && endOffset <= selectionEnd) {
				if (handleNotSelected != null)
					handleNotSelected (startOffset, selectionStart);
				if (handleSelected != null)
					handleSelected (selectionStart, endOffset);
			} else if (startOffset < selectionStart && endOffset > selectionEnd) {
				if (handleNotSelected != null)
					handleNotSelected (startOffset, selectionStart);
				if (handleSelected != null)
					handleSelected (selectionStart, selectionEnd);
				if (handleNotSelected != null)
					handleNotSelected (selectionEnd, endOffset);
			} else {
				if (handleNotSelected != null)
					handleNotSelected (startOffset, endOffset);
			}
		}
Exemplo n.º 4
0
		protected static void HandleSelection (long selectionStart, long selectionEnd, long startOffset, long endOffset, HandleSelectionDelegate handleNotSelected, HandleSelectionDelegate handleSelected)
		{
			if (startOffset >= selectionStart && endOffset <= selectionEnd) {
				if (handleSelected != null)
					handleSelected (startOffset, endOffset);
			} else if (startOffset >= selectionStart && startOffset < selectionEnd && endOffset > selectionEnd) {
				if (handleSelected != null)
					handleSelected (startOffset, selectionEnd);
				if (handleNotSelected != null)
					handleNotSelected (selectionEnd, endOffset);
			} else if (startOffset < selectionStart && endOffset > selectionStart && endOffset <= selectionEnd) {
				if (handleNotSelected != null)
					handleNotSelected (startOffset, selectionStart);
				if (handleSelected != null)
					handleSelected (selectionStart, endOffset);
			} else if (startOffset < selectionStart && endOffset > selectionEnd) {
				if (handleNotSelected != null)
					handleNotSelected (startOffset, selectionStart);
				if (handleSelected != null)
					handleSelected (selectionStart, selectionEnd);
				if (handleNotSelected != null)
					handleNotSelected (selectionEnd, endOffset);
			} else {
				if (handleNotSelected != null)
					handleNotSelected (startOffset, endOffset);
			}
		}