示例#1
0
        private void OnImeStatusChanged(object sender, InputMethodContext.StatusChangedEventArgs e)
        {
            if (e.StatusChanged)
            {
                // When the virtual keyboard (IME) is shown, StatusChanged is true
                var       resizedIME = sender as InputMethodContext;
                Rectangle rectangle  = resizedIME.GetInputMethodArea();

                if (rectangle.Height > viewFullSize.Height)
                {
                    viewFullSize = (Size2D)mainView.Size2D.Clone();
                }

                int width  = viewFullSize.Width;
                int height = viewFullSize.Height - rectangle.Height;
                mainView.Size2D = new Size2D(width, height);
            }
            else
            {
                mainView.Size2D = viewFullSize;
            }

            // Set bounding box for text decoration
            // This prevents the cursor handle from leaving the valid area.
            editor.DecorationBoundingBox  = new Rectangle(mainView.Position2D.X, mainView.Position2D.Y, mainView.Size2D.Width, mainView.Size2D.Height);
            editor2.DecorationBoundingBox = new Rectangle(mainView.Position2D.X, mainView.Position2D.Y, mainView.Size2D.Width, mainView.Size2D.Height);
        }
        public void InputMethodContextStatusChanged()
        {
            tlog.Debug(tag, $"InputMethodContextStatusChanged START");
            InputMethodContext a1 = new InputMethodContext();

            a1.StatusChanged += A1_StatusChanged;
            a1.StatusChanged -= A1_StatusChanged;

            object o1 = new object();

            InputMethodContext.StatusChangedEventArgs e = new InputMethodContext.StatusChangedEventArgs();

            A1_StatusChanged(o1, e);
            a1.Dispose();
            tlog.Debug(tag, $"InputMethodContextStatusChanged END (OK)");
            Assert.Pass("InputMethodContextStatusChanged");
        }
        private void A1_StatusChanged(object sender, InputMethodContext.StatusChangedEventArgs e)
        {
            bool a1 = e.StatusChanged;

            e.StatusChanged = a1;
        }