예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            optionsWindow = new OptionsWindow();

            appNotifyIcon = new AppNotifyIcon();
            appNotifyIcon.OptionsClicked +=
                (sender, args) =>
            {
                if (optionsWindow.IsClosed)
                {
                    optionsWindow = new OptionsWindow()
                    {
                        Visibility = Visibility.Visible
                    }
                }
                ;
                else
                {
                    optionsWindow.Show();
                }
            };
            appNotifyIcon.ExitClicked += (sender, args) => Exit();

            hook = new WinAPI.KeyboardHook(translationWindow.KeyboardHookAction);
            hook.SetHook();

            this.Visibility = Visibility.Hidden;
        }
        public MainWindow()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
            optionsWindow = new OptionsWindow();

            appNotifyIcon = new AppNotifyIcon();
            appNotifyIcon.OptionsClicked +=
                (sender, args) =>
                {
                    if (optionsWindow.IsClosed)
                        optionsWindow = new OptionsWindow() {Visibility = Visibility.Visible};
                    else
                        optionsWindow.Show();
                };
            appNotifyIcon.ExitClicked += (sender, args) => Exit();

            hook = new WinAPI.KeyboardHook(translationWindow.KeyboardHookAction);
            hook.SetHook();

            this.Visibility = Visibility.Hidden;
        }