You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.7 KiB
50 lines
1.7 KiB
using MultiTerm.Core.ViewModel;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Windows.Controls;
|
|
|
|
namespace MultiTerm.Wpf.View;
|
|
|
|
public partial class ShellView : UserControl
|
|
{
|
|
public ShellView()
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = App.AppHost!.Services.GetService(typeof(ShellViewModel));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handles key down events for the whole user control.
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
|
{
|
|
// move tab forward
|
|
if( e.Key == System.Windows.Input.Key.Tab &&
|
|
e.KeyboardDevice.Modifiers == System.Windows.Input.ModifierKeys.Control )
|
|
{
|
|
this.terminalTabControl.SelectedIndex++;
|
|
e.Handled = true;
|
|
}
|
|
// move tab backwards
|
|
else if ( e.Key == System.Windows.Input.Key.Tab &&
|
|
e.KeyboardDevice.Modifiers == (System.Windows.Input.ModifierKeys.Control & System.Windows.Input.ModifierKeys.Shift) )
|
|
{
|
|
this.terminalTabControl.SelectedIndex--;
|
|
e.Handled = true;
|
|
}
|
|
}
|
|
|
|
private void MenuItem_Logfiles_Click(object sender, System.Windows.RoutedEventArgs e)
|
|
{
|
|
// exit if logfile directory does not exist
|
|
if (Directory.Exists(Common.LogFilesDirectory) == false) { return; }
|
|
|
|
// open logfiles folder
|
|
Process ExplorerWindowProcess = new Process();
|
|
ExplorerWindowProcess.StartInfo.UseShellExecute = true;
|
|
ExplorerWindowProcess.StartInfo.FileName = @$"{Common.LogFilesDirectory}";
|
|
ExplorerWindowProcess.Start();
|
|
}
|
|
}
|
|
|