v1.2
This commit is contained in:
48
FSI.BT.Tools/RadialMenu/UserInterface/FrmAdmin.xaml
Normal file
48
FSI.BT.Tools/RadialMenu/UserInterface/FrmAdmin.xaml
Normal file
@@ -0,0 +1,48 @@
|
||||
<Window x:Class="FSI.BT.Tools.RadialMenu.UserInterface.FrmAdmin"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FSI.BT.Tools.RadialMenu.UserInterface"
|
||||
mc:Ignorable="d"
|
||||
Title="Admin-/Benutzerverwaltung"
|
||||
SizeToContent="WidthAndHeight"
|
||||
Height="Auto"
|
||||
MinWidth="800"
|
||||
Loaded="Window_Loaded">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="200" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="200" />
|
||||
<RowDefinition Height="30" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Content="Benutzer:" />
|
||||
<TextBox x:Name="tbUsers"
|
||||
Grid.Row="1"
|
||||
AcceptsReturn="true"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
HorizontalScrollBarVisibility="Visible" />
|
||||
|
||||
<Label Grid.Row="2"
|
||||
Content="Admins:" />
|
||||
<TextBox x:Name="tbAdmins"
|
||||
Grid.Row="3"
|
||||
AcceptsReturn="true"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
HorizontalScrollBarVisibility="Visible" />
|
||||
|
||||
<StackPanel Grid.Row="4" Orientation="Horizontal">
|
||||
<Button x:Name="btnOk"
|
||||
Margin="5 5 5 5"
|
||||
Content="Speichern"
|
||||
Click="btnOk_Click" />
|
||||
<Button x:Name="btnCancel"
|
||||
Margin="5 5 5 5 "
|
||||
Content="Abbruch"
|
||||
Click="btnCancel_Click" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
56
FSI.BT.Tools/RadialMenu/UserInterface/FrmAdmin.xaml.cs
Normal file
56
FSI.BT.Tools/RadialMenu/UserInterface/FrmAdmin.xaml.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace FSI.BT.Tools.RadialMenu.UserInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für FrmAdmin.xaml
|
||||
/// </summary>
|
||||
public partial class FrmAdmin : Window
|
||||
{
|
||||
|
||||
public string[] Admins { get; set; }
|
||||
public string[] Users { get; set; }
|
||||
|
||||
public FrmAdmin()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnOk_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
#if NET472
|
||||
Admins = tbAdmins.Text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
Users = tbUsers.Text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
#elif NET6_0
|
||||
Admins = tbAdmins.Text.Split(Environment.NewLine);
|
||||
Users = tbUsers.Text.Split(Environment.NewLine);
|
||||
#endif
|
||||
DialogResult = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DialogResult = false;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
tbAdmins.Text = String.Join(Environment.NewLine, Admins);
|
||||
tbUsers.Text = String.Join(Environment.NewLine, Users);
|
||||
}
|
||||
}
|
||||
}
|
||||
329
FSI.BT.Tools/RadialMenu/UserInterface/FrmProcesses.xaml
Normal file
329
FSI.BT.Tools/RadialMenu/UserInterface/FrmProcesses.xaml
Normal file
@@ -0,0 +1,329 @@
|
||||
<Window x:Class="FSI.BT.Tools.RadialMenu.UserInterface.FrmProcesses"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FSI.BT.Tools.RadialMenu.UserInterface"
|
||||
mc:Ignorable="d"
|
||||
Title="FSI.BT.Tools Prozesse"
|
||||
SizeToContent="WidthAndHeight"
|
||||
Height="Auto"
|
||||
Width="Auto">
|
||||
<Grid>
|
||||
<TabControl>
|
||||
<TabItem Header="WinCC"
|
||||
DataContext="{Binding WinCC }">
|
||||
|
||||
<StackPanel Grid.IsSharedSizeScope="True">
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*"
|
||||
MinWidth="200" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fenster-Name:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Data.WindowsName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Class-Name:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Data.WindowsClassName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Schältfläche-Name:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Data.ButtonName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Update-Intervall:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Data.UpdateIntervall, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBlock Text="ms"
|
||||
Grid.Column="2"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Autostart:"
|
||||
Margin="5 5 5 5" />
|
||||
<CheckBox Grid.Column="1"
|
||||
IsChecked="{Binding Data.AutoStart, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Content="Start"
|
||||
MinWidth="75"
|
||||
Command="{Binding CmdStart}"
|
||||
Margin="0 0 10 0" />
|
||||
<Button Content="Stop"
|
||||
MinWidth="75"
|
||||
Command="{Binding CmdStop}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="IBA-Sync"
|
||||
DataContext="{Binding Iba }">
|
||||
|
||||
<StackPanel Grid.IsSharedSizeScope="True">
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*"
|
||||
MinWidth="200" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Quell-Verzeichnis:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Data.Source, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Ziel-Verzeichnis:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Data.Destination, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Autostart:"
|
||||
Margin="5 5 5 5" />
|
||||
<CheckBox Grid.Column="1"
|
||||
IsChecked="{Binding Iba.AutoStart, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Content="Start"
|
||||
MinWidth="75"
|
||||
Command="{Binding CmdStart}"
|
||||
Margin="0 0 10 0" />
|
||||
<Button Content="Stop"
|
||||
MinWidth="75"
|
||||
Command="{Binding CmdStop}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
|
||||
</TabItem>
|
||||
|
||||
<TabItem Header="Fenster Mgt"
|
||||
DataContext="{Binding WindowMgt }"
|
||||
HorizontalAlignment="Left"
|
||||
Width="76">
|
||||
|
||||
<StackPanel Grid.IsSharedSizeScope="True">
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fenster:"
|
||||
Margin="5 5 5 5" />
|
||||
<ComboBox ItemsSource="{Binding Windows}"
|
||||
SelectedItem="{Binding SelectedWindow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
DisplayMemberPath="Name"
|
||||
SelectedIndex="0"
|
||||
Grid.Column="1"
|
||||
MinWidth="250"
|
||||
Margin="5 5 5 5" />
|
||||
<Separator Width="10"
|
||||
Grid.Column="2"
|
||||
Background="Transparent" />
|
||||
<Button Content="neu"
|
||||
Name="ABC"
|
||||
Command="{Binding CmdNew}"
|
||||
Grid.Column="3"
|
||||
MinWidth="50"
|
||||
Margin="5 5 5 5"/>
|
||||
<Button Content="löschen"
|
||||
Command="{Binding CmdDelDel}"
|
||||
Grid.Column="4"
|
||||
Margin="5 5 5 5"
|
||||
MinWidth="50" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Bezeichnung:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.Bezeichnung, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fenster Name:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Klassen Name:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.ClassName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fenster Höhe:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.Height, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Fenster Breite:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.Width, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="X-Position:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.X, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Y-Position:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedWindow.Y, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Update-Intervall:"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding UpdateIntervall, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
<TextBlock Text="ms"
|
||||
Grid.Column="2"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
<Grid Margin="0 5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"
|
||||
SharedSizeGroup="a" />
|
||||
<ColumnDefinition Width="*" />
|
||||
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Autostart:"
|
||||
Margin="5 5 5 5" />
|
||||
<CheckBox Grid.Column="1"
|
||||
IsChecked="{Binding AutoStart, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="5 5 5 5" />
|
||||
</Grid>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Right">
|
||||
<Button Content="Start"
|
||||
MinWidth="75"
|
||||
Command="{Binding CmdStart}"
|
||||
Margin="0 0 10 0" />
|
||||
<Button Content="Stop"
|
||||
MinWidth="75"
|
||||
Command="{Binding CmdStop}" />
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
20
FSI.BT.Tools/RadialMenu/UserInterface/FrmProcesses.xaml.cs
Normal file
20
FSI.BT.Tools/RadialMenu/UserInterface/FrmProcesses.xaml.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace FSI.BT.Tools.RadialMenu.UserInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für FrmProcesses.xaml
|
||||
/// </summary>
|
||||
public partial class FrmProcesses : Window
|
||||
{
|
||||
public FSI.Lib.Guis.SieTiaWinCCMsgMgt.ViewModel WinCC { get; set; }
|
||||
public FSI.Lib.Guis.IbaDirSync.ViewModel Iba { get; set; }
|
||||
public FSI.Lib.Guis.SetSizePosExWindow.ViewModel WindowMgt { get; set; }
|
||||
|
||||
public FrmProcesses()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
1196
FSI.BT.Tools/RadialMenu/UserInterface/FrmRadialMenu.xaml
Normal file
1196
FSI.BT.Tools/RadialMenu/UserInterface/FrmRadialMenu.xaml
Normal file
File diff suppressed because it is too large
Load Diff
131
FSI.BT.Tools/RadialMenu/UserInterface/FrmRadialMenu.xaml.cs
Normal file
131
FSI.BT.Tools/RadialMenu/UserInterface/FrmRadialMenu.xaml.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using FSI.BT.Tools.Global.Commands;
|
||||
using FSI.BT.Tools.RadialMenu;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
using FSI.Lib.Wpf.ExtensionMethods;
|
||||
|
||||
namespace FSI.BT.Tools.RadialMenu.UserInterface
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class FrmRadialMenu : Window//, INotifyPropertyChanged
|
||||
{
|
||||
private CmdCommand _cmd;
|
||||
private MainViewModel _radialMenu;
|
||||
|
||||
public FrmRadialMenu()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
List<string> cmds = new List<string>();
|
||||
foreach (var cmd in Global.Vars.GlobalSettings.Cmds)
|
||||
{
|
||||
cmds.Add(cmd.Cmd);
|
||||
}
|
||||
|
||||
cmds = cmds.Distinct().ToList(); // Duplikate entfernen
|
||||
cmds.Sort(); // Liste sortieren
|
||||
|
||||
_radialMenu = new MainViewModel(this, cmds);
|
||||
DataContext = _radialMenu;
|
||||
|
||||
tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor + "b";
|
||||
_cmd = new();
|
||||
}
|
||||
|
||||
private void Window_Activated(object sender, EventArgs e)
|
||||
{
|
||||
ChangeBtnIcon();
|
||||
tbCmd.Focus();
|
||||
}
|
||||
|
||||
private void Window_Deactivated(object sender, EventArgs e)
|
||||
{
|
||||
tbCmd.Text = String.Empty;
|
||||
tbCmd.Focus();
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ChangeBtnIcon();
|
||||
|
||||
tbCmd.Focus();
|
||||
}
|
||||
|
||||
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 btnMute_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Lib.Audio.AudioManager.SetMasterVolumeMute(!Lib.Audio.AudioManager.GetMasterVolumeMute());
|
||||
ChangeBtnIcon();
|
||||
}
|
||||
|
||||
private void btnVolUp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Lib.Audio.AudioManager.StepMasterVolume(2F);
|
||||
}
|
||||
|
||||
private void btnVolDwn_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Lib.Audio.AudioManager.StepMasterVolume(-2F);
|
||||
}
|
||||
|
||||
private void ChangeBtnIcon()
|
||||
{
|
||||
if (FSI.Lib.Audio.AudioManager.GetMasterVolumeMute())
|
||||
{
|
||||
btnMute.Content = new System.Windows.Controls.Image
|
||||
{
|
||||
Source = new BitmapImage(new Uri("/Global/Icons/VolOff.png", UriKind.RelativeOrAbsolute)),
|
||||
Width = 15,
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
btnMute.Content = new System.Windows.Controls.Image
|
||||
{
|
||||
Source = new BitmapImage(new Uri("/Global/Icons/VolOn.png", UriKind.RelativeOrAbsolute)),
|
||||
Width = 15,
|
||||
};
|
||||
}
|
||||
|
||||
btnVolUp.Content = new System.Windows.Controls.Image
|
||||
{
|
||||
Source = new BitmapImage(new Uri("/Global/Icons/VolUp.png", UriKind.RelativeOrAbsolute)),
|
||||
Width = 15,
|
||||
};
|
||||
|
||||
btnVolDwn.Content = new System.Windows.Controls.Image
|
||||
{
|
||||
Source = new BitmapImage(new Uri("/Global/Icons/VolDown.png", UriKind.RelativeOrAbsolute)),
|
||||
Width = 15,
|
||||
};
|
||||
}
|
||||
|
||||
private void tbCmd_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user