private string textEditorTextSid = null;
private string textEditorPlaceHolderTextSid = null;
private bool systemlangTextFlag = false;
+ private InputMethodContext inputMethodContext = null;
internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
- // In order to speed up IME hide, temporarily add
- GetInputMethodContext()?.DestroyContext();
+ inputMethodContext?.Dispose();
NDalicPINVOKE.delete_TextEditor(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
/// Get the InputMethodContext instance.
/// </summary>
/// <returns>The InputMethodContext instance.</returns>
- public InputMethodContext GetInputMethodContext() {
- InputMethodContext ret = new InputMethodContext(NDalicPINVOKE.TextEditor_GetInputMethodContext(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ public InputMethodContext GetInputMethodContext()
+ {
+ if (inputMethodContext == null)
+ {
+ /*Avoid raising InputMethodContext reference count.*/
+ inputMethodContext = new InputMethodContext(NDalicPINVOKE.TextEditor_GetInputMethodContext(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ return inputMethodContext;
}
internal TextEditorSignal TextChangedSignal()
private string textFieldTextSid = null;
private string textFieldPlaceHolderTextSid = null;
private bool systemlangTextFlag = false;
+ private InputMethodContext inputMethodCotext = null;
internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextField_SWIGUpcast(cPtr), cMemoryOwn)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
- // In order to speed up IME hide, temporarily add
- GetInputMethodContext()?.DestroyContext();
+ inputMethodCotext?.Dispose();
NDalicPINVOKE.delete_TextField(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
/// Get the InputMethodContext instance.
/// </summary>
/// <returns>The InputMethodContext instance.</returns>
- public InputMethodContext GetInputMethodContext() {
- InputMethodContext ret = new InputMethodContext(NDalicPINVOKE.TextField_GetInputMethodContext(swigCPtr), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ public InputMethodContext GetInputMethodContext()
+ {
+ if (inputMethodCotext == null)
+ {
+ /*Avoid raising InputMethodContext reference count.*/
+ inputMethodCotext = new InputMethodContext(NDalicPINVOKE.TextField_GetInputMethodContext(swigCPtr), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ return inputMethodCotext;
}
internal TextFieldSignal TextChangedSignal()