@@ -1134,21 +1134,16 @@ public void RaiseScrollInvalidated(EventArgs e)
11341134 _logicalScrollable ? . RaiseScrollInvalidated ( e ) ;
11351135 }
11361136
1137- private class TextAreaTextInputMethodClient : ITextInputMethodClient
1137+ private class TextAreaTextInputMethodClient : TextInputMethodClient
11381138 {
1139- private ITextEditable _textEditable ;
11401139 private TextArea _textArea ;
11411140
11421141 public TextAreaTextInputMethodClient ( )
11431142 {
11441143
11451144 }
11461145
1147- public event EventHandler CursorRectangleChanged ;
1148- public event EventHandler TextViewVisualChanged ;
1149- public event EventHandler SurroundingTextChanged ;
1150-
1151- public Rect CursorRectangle
1146+ public override Rect CursorRectangle
11521147 {
11531148 get
11541149 {
@@ -1170,13 +1165,13 @@ public Rect CursorRectangle
11701165 }
11711166 }
11721167
1173- public Visual TextViewVisual => _textArea ;
1168+ public override Visual TextViewVisual => _textArea ;
11741169
1175- public bool SupportsPreedit => false ;
1170+ public override bool SupportsPreedit => false ;
11761171
1177- public bool SupportsSurroundingText => true ;
1172+ public override bool SupportsSurroundingText => true ;
11781173
1179- public TextInputMethodSurroundingText SurroundingText
1174+ public override string SurroundingText
11801175 {
11811176 get
11821177 {
@@ -1187,26 +1182,15 @@ public TextInputMethodSurroundingText SurroundingText
11871182
11881183 var lineIndex = _textArea . Caret . Line ;
11891184
1190- var position = _textArea . Caret . Position ;
1191-
11921185 var documentLine = _textArea . Document . GetLineByNumber ( lineIndex ) ;
11931186
11941187 var text = _textArea . Document . GetText ( documentLine . Offset , documentLine . Length ) ;
11951188
1196- return new TextInputMethodSurroundingText
1197- {
1198- AnchorOffset = 0 ,
1199- CursorOffset = position . Column ,
1200- Text = text
1201- } ;
1189+ return text ;
12021190 }
12031191 }
12041192
1205- public ITextEditable TextEditable
1206- {
1207- get => _textEditable ;
1208- set => _textEditable = value ;
1209- }
1193+ public override TextSelection Selection { get ; set ; }
12101194
12111195 public void SetTextArea ( TextArea textArea )
12121196 {
@@ -1224,19 +1208,19 @@ public void SetTextArea(TextArea textArea)
12241208 _textArea . SelectionChanged += TextArea_SelectionChanged ;
12251209 }
12261210
1227- TextViewVisualChanged ? . Invoke ( this , EventArgs . Empty ) ;
1211+ RaiseTextViewVisualChanged ( ) ;
12281212
1229- CursorRectangleChanged ? . Invoke ( this , EventArgs . Empty ) ;
1213+ RaiseCursorRectangleChanged ( ) ;
12301214 }
12311215
12321216 private void Caret_PositionChanged ( object sender , EventArgs e )
12331217 {
1234- CursorRectangleChanged ? . Invoke ( this , e ) ;
1218+ RaiseCursorRectangleChanged ( ) ;
12351219 }
12361220
12371221 private void TextArea_SelectionChanged ( object sender , EventArgs e )
12381222 {
1239- SurroundingTextChanged ? . Invoke ( this , e ) ;
1223+ RaiseSurroundingTextChanged ( ) ;
12401224 }
12411225
12421226 public void SelectInSurroundingText ( int start , int end )
@@ -1253,15 +1237,10 @@ public void SelectInSurroundingText(int start, int end)
12531237 new TextViewPosition ( selection . StartPosition . Line , end ) ) ;
12541238 }
12551239
1256- public void SetPreeditText ( string text )
1240+ public override void SetPreeditText ( string text )
12571241 {
12581242
12591243 }
1260-
1261- public void SetComposingRegion ( TextRange ? region )
1262- {
1263- //ToDo
1264- }
12651244 }
12661245 }
12671246
0 commit comments