예제 #1
0
        private async Task IntensiveCommand(Action p)
        {
            CommandInput.IsEnabled = false;
            await Task.Run(p);

            CommandInput.IsEnabled = true;
            CommandInput.Focus(FocusState.Keyboard);
        }
 public void Find()
 {
     if (!Editor.CanFind)
     {
         return;
     }
     CommandInput.Visible = true;
     CommandInput.Focus();
 }
 private void ReadSettings()
 {
     if (!Properties.Settings.Default.AutoStart)
     {
         StopServerBtn.IsEnabled = false;
     }
     CommandInput.Focus();
     AutoRestartChk.IsChecked = restartOnCrash = Properties.Settings.Default.AutoRestart;
     AutoStartChk.IsChecked   = autoStart = Properties.Settings.Default.AutoStart;
     TimeStampChk.IsChecked   = timeStamps = Properties.Settings.Default.TimeStamps;
 }
예제 #4
0
        private void OnListViewKeyUp(object sender, KeyEventArgs e)
        {
            var listview = e.Source as ListView;

            if (e.Key == Key.Enter)
            {
                ViewModel.Send();
            }

            if (e.Key == Key.Escape)
            {
                CommandInput.Focus();
            }

            if (e.KeyboardDevice.Modifiers.HasFlag(ModifierKeys.Control))
            {
                if (e.Key == Key.C)
                {
                    var text = String.Join("\r\n", listview.SelectedItems.Cast <Object>());
                    Clipboard.SetText(text);
                }

                if (e.Key == Key.V)
                {
                    ViewModel.Send(Clipboard.GetText());
                }


                if (e.Key == Key.M)
                {
                    MeasureAverage(listview);
                    return;
                }

                if (e.Key == Key.T)
                {
                    RebaseSelected(listview);
                }
                //if (e.Key == Key.V)
                //{
                //    Clipboard.GetText().Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
                //    ViewModel.Send();
                //}
            }
        }