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);
}
}