aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Publisher.UI/Properties/AssemblyInfo.cs
blob: 1b316d9aa5fa0f35f285a4257cabee88f9b9ee7d (plain)
1
2
3
4
5
6
7
8
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Windows.ThemeInfo(System.Windows.ResourceDictionaryLocation.None, System.Windows.ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyTitle("Tango - Machine Studio Publish Utility")]
[assembly: AssemblyVersion("2.0.5.1647")]
[assembly: ComVisible(false)]
#dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Tango.PPC.Browser.Attributes;
using Tango.PPC.Browser.Views;
using Tango.PPC.Common.Helpers;
using Tango.Touch.Keyboard;

namespace Tango.PPC.Browser.BoundsObjects
{
    [BoundObject("keyboard", "keyboard.js")]
    public class KeyboardHandler
    {
        private DateTime _lastTime;

        public KeyboardHandler()
        {
            _lastTime = DateTime.Now;
        }

        public void openKeyboard(String inputType)
        {
            if (DateTime.Now > _lastTime.AddMilliseconds(1000))
            {
                _lastTime = DateTime.Now;

                Application.Current.Dispatcher.BeginInvoke(new Action(async () =>
                {
                    switch (inputType)
                    {
                        case "search":
                            KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go);
                            break;
                        default:
                            KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Next);
                            break;
                    }


                    await Task.Delay(50);
                    BrowserView.Instance.btnGo.Focus();
                    await Task.Delay(50);
                    BrowserView.Instance.Browser.Focus();
                    Debug.WriteLine("Focus");
                }));
            }
        }

        public void closeKeyboard()
        {
            if (DateTime.Now > _lastTime.AddMilliseconds(1000))
            {
                _lastTime = DateTime.Now;

                Application.Current.Dispatcher.BeginInvoke(new Action(() =>
                {
                    KeyboardHelper.CloseKeyboard();
                }));
            }
        }
    }
}