Sicherung

This commit is contained in:
Maier Stephan SI
2023-01-29 19:58:40 +01:00
parent b684704bf8
commit 56c25672f9
10 changed files with 123 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
using AutoCompleteTextBox.Editors;
using FSI.BT.Tools.Commands;
using FSI.BT.Tools.RadialMenu;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -23,7 +24,8 @@ namespace FSI.BT.Tools
public partial class FrmRadialMenu : Window//, INotifyPropertyChanged
{
private CmdCommand _cmd;
private MainViewModel _radialMenu;
public FrmRadialMenu()
{
InitializeComponent();
@@ -33,7 +35,11 @@ namespace FSI.BT.Tools
{
cmds.Add(cmd.Cmd);
}
DataContext = new RadialMenu.MainViewModel(this, cmds);
cmds = cmds.Distinct().ToList(); // Duplikate entfernen
cmds.Sort(); // Liste sortieren
_radialMenu = new RadialMenu.MainViewModel(this, cmds);
DataContext = _radialMenu;
tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor + "b";
_cmd = new();
@@ -61,20 +67,17 @@ namespace FSI.BT.Tools
private void tbCmd_KeyDown(object sender, KeyEventArgs e)
{
if (_cmd.CanExecute(tbCmd.Text))
tbCmd.Background = new SolidColorBrush(Colors.Green);
else
tbCmd.Background = new SolidColorBrush(Colors.White);
if (e.Key == Key.Enter && _cmd.CanExecute(tbCmd.Text))
{
_cmd.Execute(tbCmd.Text);
}
}
private void tbCmd_TextChanged(object sender, TextChangedEventArgs e)
{
if (_cmd.CanExecute(((TextBox)sender).Text))
((TextBox)sender).Background = new SolidColorBrush(Colors.Green);
else
((TextBox)sender).Background = new SolidColorBrush(Colors.White);
}
private void btnMute_Click(object sender, RoutedEventArgs e)
{
Lib.Audio.AudioManager.SetMasterVolumeMute(!Lib.Audio.AudioManager.GetMasterVolumeMute());