Sicherung

This commit is contained in:
Maier Stephan SI
2023-01-20 16:09:00 +01:00
parent e5257d8413
commit b684704bf8
139 changed files with 95678 additions and 499 deletions

View File

@@ -1,15 +1,13 @@
using Hardcodet.Wpf.TaskbarNotification;
using Config.Net;
using Config.Net.Stores;
using Hardcodet.Wpf.TaskbarNotification;
using NHotkey;
using NHotkey.Wpf;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Windows;
using System.Windows.Input;
using FSI.Lib.CompareNetObjects;
using Config.Net.Stores;
using System.IO;
using Config.Net;
using System.Collections.Generic;
using System.Linq;
using System;
namespace FSI.BT.Tools
{
@@ -23,11 +21,14 @@ namespace FSI.BT.Tools
public void Application_Startup(object sender, StartupEventArgs e)
{
{
Global.Log.Info("Anwendung wurde gestartet!");
ExtractEmbeddedZip("FSI.BT.Tools.ExtTools.kalk.zip", Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\ExtTools\\");
// App-Settings
JsonConfigStore _store = new JsonConfigStore(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "config.json"), true);
JsonConfigStore _store = new(System.IO.Path.Combine(Directory.GetCurrentDirectory(), "config.json"), true);
Global.AppSettings = new ConfigurationBuilder<Settings.AppSettings.IAppSettings>()
.UseConfigStore(_store)
.Build();
@@ -40,9 +41,9 @@ namespace FSI.BT.Tools
HotkeyManager.Current.AddOrReplace("RadialMenu", RadialMenu, ShowRadialMenu);
HotkeyManager.Current.AddOrReplace("TimeStampToClipboard", TimeStamp, TimeStampToClipboard);
Global.FrmRadialMenu = new FrmRadialMenu();
Global.WinCC = new Lib.Guis.SieTiaWinCCMsgMgt.ViewModel()
{
Data = Global.AppSettings.WinCC
@@ -54,7 +55,6 @@ namespace FSI.BT.Tools
Data = Global.AppSettings.IbaDirSync
};
Global.Iba.Init();
}
private void ShowRadialMenu(object sender, HotkeyEventArgs e)
@@ -75,13 +75,13 @@ namespace FSI.BT.Tools
e.Handled = true;
}
private void DeCrypt(ref IEnumerable<Settings.StringValue.IStringValueCrypt> values)
private static void ExtractEmbeddedZip(string zipName, string destPath)
{
var valuesToDeCrypt = values.ToList();
foreach (var value in valuesToDeCrypt.ToList())
value.ValueDeCrypt = Lib.DeEncryptString.DeEncrypt.DecryptString(value.Value, AppDomain.CurrentDomain.FriendlyName);
System.IO.Directory.CreateDirectory(destPath); // Erstellt alle fehlenden Verzeichnisse
using Stream _pluginZipResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(zipName);
using ZipArchive zip = new(_pluginZipResourceStream);
zip.ExtractToDirectory(destPath, true);
Global.Log.Info("Externes Tool \"{0}\" wurde in das Verzeichnis \"{1}\" entpackt", zipName, destPath);
}
private void Application_Exit(object sender, ExitEventArgs e)
@@ -94,5 +94,6 @@ namespace FSI.BT.Tools
}
}
}
}

View File

@@ -26,26 +26,24 @@ namespace FSI.BT.Tools.Commands
var cmds = Global.AppSettings.Cmds.ToList();
ICmd selectedCmd = null;
// IEnumerable<Settings.Exe.IExe> files = new List<Settings.Exe.IExe>();
IExe selectedFile;
switch ((string)parameter)
{
case "EplPrj":
//selectedFile = GetApp(Global.AppSettings.Apps.Epl);
//Lib.Guis.Prj.Mgt.FrmMain frmMainEplPrj = new()
//{
// ShowPdf = false,
// CloseAtLostFocus = true,
// WindowStartupLocation = WindowStartupLocation.CenterScreen,
// Path = FSI.BT.Tools.Settings.AppSettings.GetFolderByName(Global.AppSettings.Folders, "EplPrj").path,
// EplExe = selectedFile.ExePath,
//};
//frmMainEplPrj.Show();
case "Epl.Prj":
Lib.Guis.Prj.Mgt.FrmMain frmMainEplPrj = new()
{
ShowPdf = false,
CloseAtLostFocus = true,
WindowStartupLocation = WindowStartupLocation.CenterScreen,
Path = FSI.BT.Tools.Settings.AppSettings.GetFolderByName(Global.AppSettings.Folders, "EplPrj").path,
EplExe = GetExeByCmdName("Epl").ExePath,
};
frmMainEplPrj.Show();
return;
case "EplPdf":
case "Epl.Pdf":
Lib.Guis.Prj.Mgt.FrmMain frmMainEplPdf = new()
{
ShowPdf = true,
@@ -56,7 +54,7 @@ namespace FSI.BT.Tools.Commands
frmMainEplPdf.Show();
return;
case "EplPdfMgt":
case "Epl.PdfMgt":
Lib.Guis.Pdf.Mgt.FrmMain frmMainEplPdfMgt = new()
{
CloseAtLostFocus = true
@@ -96,14 +94,22 @@ namespace FSI.BT.Tools.Commands
};
frmTxtToClipMain.Show();
return;
case "Rdp.Mgt":
Lib.Guis.Rdp.Mgt.FrmMain frmRdpMain = new()
{
CloseAtLostFocus = true,
InputData = Global.AppSettings.Rdps,
Exe = GetExeByCmdName("Rdp").ExePath,
};
frmRdpMain.Show();
break;
default:
foreach (ICmd cmd in cmds)
{
if (String.Equals(parameter.ToString().ToLower(), cmd.Cmd.ToLower()))
{
if (String.Equals(parameter.ToString(), cmd.Cmd))
selectedCmd = cmd;
}
}
break;
}
@@ -121,14 +127,14 @@ namespace FSI.BT.Tools.Commands
ICmd selectedCmd = null;
switch ((string)parameter)
{
case "EplPrj":
{
case "Epl.Prj":
return true;
case "EplPdf":
case "Epl.Pdf":
return true;
case "EplPdfMgt":
case "Epl.PdfMgt":
return Global.AdminRights;
case "DeEncrypt":
@@ -143,16 +149,16 @@ namespace FSI.BT.Tools.Commands
case "TxtToClip":
return Global.AppSettings.TxtToClip != null;
case "Rdp.Mgt":
return Global.AppSettings.Rdps != null;
default:
foreach (ICmd cmd in cmds)
{
if (String.Equals(parameter.ToString().ToLower(), cmd.Cmd.ToLower()))
{
if (String.Equals(parameter.ToString(), cmd.Cmd))
selectedCmd = cmd;
}
}
break;
break;
}
if (selectedCmd == null)
@@ -160,26 +166,24 @@ namespace FSI.BT.Tools.Commands
foreach (var file in selectedCmd.Exe.ToList())
{
if (File.Exists(Environment.ExpandEnvironmentVariables(file.ExePath.Trim())))
{
return true;
}
else if (File.Exists(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), file.ExePath.Trim())))
return true;
}
foreach (var url in selectedCmd.Urls)
{
if (url != String.Empty)
{
return true;
}
}
return false;
}
private static void OpenExe(ICmd selectedCmd)
{
private static void OpenExe(ICmd selectedCmd)
{
IExe selectedFile = GetApp(selectedCmd.Exe);
if (selectedFile == null)
@@ -196,8 +200,8 @@ namespace FSI.BT.Tools.Commands
else
{
Process process = new();
process.StartInfo.FileName = selectedFile.ExePath;
process.StartInfo.WorkingDirectory = selectedFile.Path == null ? selectedFile.Path : Path.GetDirectoryName(selectedFile.ExePath);
process.StartInfo.FileName = Environment.ExpandEnvironmentVariables(selectedFile.ExePath);
process.StartInfo.WorkingDirectory = selectedFile.Path ?? Path.GetDirectoryName(Environment.ExpandEnvironmentVariables(selectedFile.ExePath));
process.StartInfo.Arguments = selectedFile.Arguments;
try
@@ -237,7 +241,20 @@ namespace FSI.BT.Tools.Commands
Thread.Sleep(100);
}
}
private static IExe GetExeByCmdName(string cmdName)
{
foreach (var cmd in Global.AppSettings.Cmds)
{
if (string.Equals(cmd.Cmd, cmdName, StringComparison.InvariantCultureIgnoreCase))
{
return GetApp(cmd.Exe);
}
}
return null;
}
private static bool ProgramIsRunning(string FullPath)
{
string FilePath = Path.GetDirectoryName(FullPath);
@@ -260,7 +277,7 @@ namespace FSI.BT.Tools.Commands
private static IExe GetApp(IEnumerable<IExe> files)
{
if(files.ToList().Count == 0)
if (files.ToList().Count == 0)
return null;
var selectedFile = files.ToList()[0];

Binary file not shown.

View File

@@ -1,22 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<ApplicationIcon>Icons\FondiumU.ico</ApplicationIcon>
<AssemblyVersion>2.0</AssemblyVersion>
<Version>2.0</Version>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<None Remove="Icons\Folders.png" />
<None Remove="Icons\Iba.jpg" />
<None Remove="Icons\txt.png" />
<Compile Remove="ExtTools\kalk\**" />
<EmbeddedResource Remove="ExtTools\kalk\**" />
<None Remove="ExtTools\kalk\**" />
<Page Remove="ExtTools\kalk\**" />
</ItemGroup>
<ItemGroup>
<None Remove="ExtTools\kalk.zip" />
<None Remove="Icons\Folders.png" />
<None Remove="Icons\Iba.jpg" />
<None Remove="Icons\txt.png" />
<None Remove="Icons\VolDown.png" />
<None Remove="Icons\VolOff.png" />
<None Remove="Icons\VolOn.png" />
<None Remove="Icons\VolUp.png" />
</ItemGroup>
<ItemGroup>
@@ -59,10 +72,24 @@
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\txt.png" />
<EmbeddedResource Include="ExtTools\kalk.zip" />
<Resource Include="Icons\VolDown.png" />
<Resource Include="Icons\VolOff.png" />
<Resource Include="Icons\VolOn.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autoupdater.NET.Official" Version="1.7.6" />
<PackageReference Include="TextCopy" Version="6.2.1" />
<PackageReference Include="DotNetZip" Version="1.16.0" />
</ItemGroup>
<ItemGroup>
<Resource Include="Icons\txt.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AutoCompleteTextBox\AutoCompleteTextBox.csproj" />
<ProjectReference Include="..\Config.Net\Config.Net.csproj" />
<ProjectReference Include="..\FSI.Lib\FSI.Lib\FSI.Lib.csproj" />
<ProjectReference Include="..\NHotkey\NHotkey.Wpf\NHotkey.Wpf.csproj" />
@@ -73,7 +100,7 @@
<ItemGroup>
<Resource Include="Icons\1087815.png">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Resource>
<Resource Include="Icons\Admin.jpg" />
<Resource Include="Icons\Apps.png" />
@@ -109,6 +136,7 @@
<Resource Include="Icons\TotalCmd.jfif" />
<Resource Include="Icons\Vnc.png" />
<Resource Include="Icons\VncAdrBook.png" />
<Resource Include="Icons\VolUp.png" />
<Resource Include="Icons\Vs.png" />
<Resource Include="Icons\VsCode.png" />
<Resource Include="Icons\TeXstudio.png" />
@@ -116,14 +144,19 @@
</ItemGroup>
<ItemGroup>
<None Update="config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="nlog.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ProjectExtensions><VisualStudio><UserProperties config_1json__JsonSchema="" /></VisualStudio></ProjectExtensions>
<ProjectExtensions>
<VisualStudio>
<UserProperties config_1json__JsonSchema="" />
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@@ -1,14 +1,18 @@
<Window x:Class="FSI.BT.Tools.FrmRadialMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FSI.BT.Tools"
xmlns:RadialMenu="clr-namespace:RadialMenu.Controls;assembly=RadialMenu"
xmlns:RadialMenuProvider="clr-namespace:FSI.BT.Tools.RadialMenu"
xmlns:commands="clr-namespace:FSI.BT.Tools.Commands"
xmlns:wpfCtrl="http://wpfcontrols.com/"
SizeToContent="WidthAndHeight"
WindowStyle="None"
ShowInTaskbar="False"
AllowsTransparency="True"
Background="Transparent"
Deactivated="Window_Deactivated"
Activated="Window_Activated"
Loaded="Window_Loaded">
<Window.Resources>
@@ -39,6 +43,7 @@
FontSize="10" />
</StackPanel>
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenHome}">
<RadialMenu:RadialMenu.CentralItem>
@@ -207,7 +212,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="EplPrj">
CommandParameter="Epl.Prj">
<WrapPanel Orientation="Vertical">
<Rectangle Width="35"
Height="35">
@@ -223,7 +228,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="EplPdf">
CommandParameter="Epl.Pdf">
<WrapPanel Orientation="Vertical">
<Rectangle Width="35"
Height="35">
@@ -239,7 +244,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="EplPdfMgt">
CommandParameter="Epl.PdfMgt">
<WrapPanel Orientation="Vertical">
<Rectangle Width="35"
Height="35">
@@ -728,7 +733,7 @@
</RadialMenu:RadialMenu.CentralItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL1Pls">
CommandParameter="PL1.Pls">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -744,7 +749,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL1Lst">
CommandParameter="PL1.Lst">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -775,7 +780,7 @@
</RadialMenu:RadialMenu.CentralItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL2Alg">
CommandParameter="PL2.Alg">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -792,7 +797,7 @@
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL2Pls">
CommandParameter="PL2.Pls">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -808,7 +813,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL2Als">
CommandParameter="PL2.Als">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -824,7 +829,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL2Lst">
CommandParameter="PL2.Lst">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -840,7 +845,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL2Nc">
CommandParameter="PL2.Nc">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -856,7 +861,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL2Key">
CommandParameter="PL2.Key">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -887,7 +892,7 @@
</RadialMenu:RadialMenu.CentralItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL3Pls">
CommandParameter="PL3.Pls">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -903,7 +908,7 @@
</RadialMenu:RadialMenuItem>
<RadialMenu:RadialMenuItem Command="{commands:CmdCommand}"
CommandParameter="PL3Lst">
CommandParameter="PL3.Lst">
<WrapPanel Orientation="Vertical">
<Rectangle Width="30"
Height="30">
@@ -1109,19 +1114,75 @@
</RadialMenu:RadialMenu>
<Grid HorizontalAlignment="Center"
VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="15" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="15" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="15" />
<RowDefinition Height="15" />
<RowDefinition Height="15" />
</Grid.RowDefinitions>
<Button x:Name="btnVolUp"
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderBrush="Transparent"
Click="btnVolUp_Click" />
<Button x:Name="btnVolDwn"
Grid.Row="2"
Grid.Column="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderBrush="Transparent"
Click="btnVolDwn_Click" />
<Button x:Name="btnMute"
Grid.Row="1"
Grid.Column="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderBrush="Transparent"
Click="btnMute_Click" />
</Grid>
</Grid>
<Grid Width="300"
<Grid Width="200"
Height="50"
Canvas.Bottom="0">
Canvas.Bottom="0"
Canvas.Left="50">
<StackPanel Width="Auto"
HorizontalAlignment="Stretch"
Margin="5 5 5 5 ">
<TextBox x:Name="tbCmd"
<wpfCtrl:AutoCompleteTextBox x:Name="tbCmd"
FontSize="20"
Background="White"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Provider="{Binding Provider}"
Text="{Binding Path=Cmd, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
KeyDown="tbCmd_KeyDown"
Watermark="Cmd eingeben">
</wpfCtrl:AutoCompleteTextBox>
<!--<TextBox x:Name="tbCmd"
FontSize="20"
KeyDown="tbCmd_KeyDown"
TextChanged="tbCmd_TextChanged" />
TextChanged="tbCmd_TextChanged" />-->
</StackPanel>
</Grid>

View File

@@ -1,429 +1,128 @@
using FSI.BT.Tools.Commands;
using AutoCompleteTextBox.Editors;
using FSI.BT.Tools.Commands;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace FSI.BT.Tools
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class FrmRadialMenu : Window, INotifyPropertyChanged
public partial class FrmRadialMenu : Window//, INotifyPropertyChanged
{
private CmdCommand _cmd;
public FrmRadialMenu()
{
InitializeComponent();
DataContext = this;
_isOpenHome = true;
List<string> cmds = new List<string>();
foreach(var cmd in Global.AppSettings.Cmds)
{
cmds.Add(cmd.Cmd);
}
DataContext = new RadialMenu.MainViewModel(this, cmds);
tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor + "b";
_cmd = new ();
_cmd = new();
}
#region Home
private bool _isOpenHome = true;
public bool IsOpenHome
private void Window_Activated(object sender, EventArgs e)
{
get
{
return _isOpenHome;
}
set
{
_isOpenHome = value;
RaisePropertyChanged();
}
}
public ICommand CloseRadialMenuHome
{
get
{
return new RelayCommand(() => Visibility = Visibility.Hidden);
}
}
public ICommand OpenRadialMenuHome
{
get
{
return new RelayCommand(() =>
{
IsOpenHome = true;
IsOpenEpl =
IsOpenTools =
IsOpenSie =
IsOpenApps =
IsOpenPlantLinksPl1 =
IsOpenPlantLinksPl2 =
IsOpenPlantLinksPl3 =
IsOpenAppsVncRdp =
IsOpenLinks = false;
});
}
}
#endregion
#region Epl
private bool _isOpenEpl = false;
public bool IsOpenEpl
{
get
{
return _isOpenEpl;
}
set
{
_isOpenEpl = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuEpl
{
get
{
return new RelayCommand(() =>
{
IsOpenEpl = true;
IsOpenHome = false;
});
}
}
#endregion
#region Tools
private bool _isOpenTools = false;
public bool IsOpenTools
{
get
{
return _isOpenTools;
}
set
{
_isOpenTools = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuTools
{
get
{
return new RelayCommand(() =>
{
IsOpenTools = true;
IsOpenHome = false;
});
}
}
#endregion
#region Siemens
private bool _isOpenSie = false;
public bool IsOpenSie
{
get
{
return _isOpenSie;
}
set
{
_isOpenSie = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuSie
{
get
{
return new RelayCommand(() =>
{
IsOpenSie = true;
IsOpenHome = false;
});
}
}
#endregion
#region Links
private bool _isOpenLinks = false;
public bool IsOpenLinks
{
get
{
return _isOpenLinks;
}
set
{
_isOpenLinks = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuLinks
{
get
{
return new RelayCommand(() =>
{
IsOpenLinks = true;
IsOpenPlantLinks =
IsOpenHome = false;
});
}
}
#endregion
#region Anlagen Links
private bool _isOpenPlantLinks = false;
public bool IsOpenPlantLinks
{
get
{
return _isOpenPlantLinks;
}
set
{
_isOpenPlantLinks = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinks
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinks = true;
IsOpenPlantLinksPl1 =
IsOpenPlantLinksPl2 =
IsOpenPlantLinksPl3 =
IsOpenLinks = false;
});
}
}
#endregion
#region Anlagen Links Pl1
private bool _isOpenPlantLinksPl1 = false;
public bool IsOpenPlantLinksPl1
{
get
{
return _isOpenPlantLinksPl1;
}
set
{
_isOpenPlantLinksPl1 = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinksPl1
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinksPl1 = true;
IsOpenPlantLinks = false;
});
}
}
#endregion
#region Anlagen Links Pl2
private bool _isOpenPlantLinksPl2 = false;
public bool IsOpenPlantLinksPl2
{
get
{
return _isOpenPlantLinksPl2;
}
set
{
_isOpenPlantLinksPl2 = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinksPl2
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinksPl2 = true;
IsOpenPlantLinks = false;
});
}
}
#endregion
#region Anlagen Links Pl3
private bool _isOpenPlantLinksPl3 = false;
public bool IsOpenPlantLinksPl3
{
get
{
return _isOpenPlantLinksPl3;
}
set
{
_isOpenPlantLinksPl3 = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinksPl3
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinksPl3 = true;
IsOpenPlantLinks = false;
});
}
}
#endregion
#region Apps
private bool _isOpenApps = false;
public bool IsOpenApps
{
get
{
return _isOpenApps;
}
set
{
_isOpenApps = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuApps
{
get
{
return new RelayCommand(() =>
{
IsOpenApps = true;
IsOpenAppsVncRdp =
IsOpenHome = false;
});
}
}
#endregion
#region Apps RDP VNC
private bool _isOpenAppsVncRdp = false;
public bool IsOpenAppsVncRdp
{
get
{
return _isOpenAppsVncRdp;
}
set
{
_isOpenAppsVncRdp = value;
RaisePropertyChanged();
}
}
public ICommand OpenRadialMenuAppsVncRdp
{
get
{
return new RelayCommand(() =>
{
IsOpenAppsVncRdp = true;
IsOpenApps = false;
});
}
}
#endregion
public event PropertyChangedEventHandler PropertyChanged;
void RaisePropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
tbCmd.Focus();
ChangeBtnIcon();
}
private void Window_Deactivated(object sender, EventArgs e)
{
tbCmd.Text = String.Empty;
tbCmd.Focus();
Visibility = Visibility.Hidden;
IsOpenHome = true;
IsOpenEpl =
IsOpenTools =
IsOpenSie =
IsOpenLinks =
IsOpenApps =
IsOpenPlantLinksPl1 =
IsOpenPlantLinksPl2 =
IsOpenPlantLinksPl3 =
IsOpenAppsVncRdp =
IsOpenPlantLinks = false;
tbCmd.Focus();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
tbCmd.Focus();
ChangeBtnIcon();
tbCmd.Focus();
}
private void tbCmd_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter && _cmd.CanExecute(((TextBox)sender).Text))
{
_cmd.Execute(((TextBox)sender).Text);
}
{
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);
((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());
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("../../Icons/VolOff.png", UriKind.RelativeOrAbsolute)),
Width = 15,
};
}
else
{
btnMute.Content = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri("../../Icons/VolOn.png", UriKind.RelativeOrAbsolute)),
Width = 15,
};
}
btnVolUp.Content = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri("../../Icons/VolUp.png", UriKind.RelativeOrAbsolute)),
Width = 15,
};
btnVolDwn.Content = new System.Windows.Controls.Image
{
Source = new BitmapImage(new Uri("../../Icons/VolDown.png", UriKind.RelativeOrAbsolute)),
Width = 15,
};
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,26 @@
using AutoCompleteTextBox.Editors;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FSI.BT.Tools.RadialMenu
{
public class CmdProvider : ISuggestionProvider
{
private readonly ObservableCollection<string> _cmds;
public IEnumerable GetSuggestions(string filter)
{
return _cmds.Where(x => x.StartsWith(filter, StringComparison.InvariantCultureIgnoreCase));
}
public CmdProvider(ref ObservableCollection<string> cmds)
{
this._cmds = cmds;
}
}
}

View File

@@ -0,0 +1,442 @@
using FSI.Lib.MVVM;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;
namespace FSI.BT.Tools.RadialMenu
{
public class MainViewModel : ViewModelBase
{
public MainViewModel(Window win, List<string> cmds)
{
_window = win;
_window.Deactivated += _window_Deactivated;
_isOpenHome = true;
Cmds = new();
if (cmds != null)
{
foreach (string cmd in cmds)
Cmds.Add(cmd);
}
Cmds.Add("Rdp.Mgt");
Provider = new(ref _cmds);
}
private ObservableCollection<string> _cmds;
public ObservableCollection<string> Cmds
{
get { return _cmds; }
set
{
_cmds = value;
OnPropertyChanged();
}
}
private CmdProvider _cmdProvider;
public CmdProvider Provider
{
get { return _cmdProvider; }
set { _cmdProvider = value; }
}
private string _cmd;
public string Cmd
{
get { return _cmd; }
set
{
_cmd = value;
OnPropertyChanged();
}
}
private Window _window;
public Window Window
{
get { return _window; }
set { _window = value; }
}
#region Home
private bool _isOpenHome = true;
public bool IsOpenHome
{
get
{
return _isOpenHome;
}
set
{
_isOpenHome = value;
OnPropertyChanged();
}
}
public ICommand CloseRadialMenuHome
{
get
{
return new RelayCommand(() => _window.Visibility = Visibility.Hidden);
}
}
public ICommand OpenRadialMenuHome
{
get
{
return new RelayCommand(() =>
{
IsOpenHome = true;
IsOpenEpl =
IsOpenTools =
IsOpenSie =
IsOpenApps =
IsOpenPlantLinksPl1 =
IsOpenPlantLinksPl2 =
IsOpenPlantLinksPl3 =
IsOpenAppsVncRdp =
IsOpenLinks = false;
});
}
}
#endregion
#region Epl
private bool _isOpenEpl = false;
public bool IsOpenEpl
{
get
{
return _isOpenEpl;
}
set
{
_isOpenEpl = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuEpl
{
get
{
return new RelayCommand(() =>
{
IsOpenEpl = true;
IsOpenHome = false;
});
}
}
#endregion
#region Tools
private bool _isOpenTools = false;
public bool IsOpenTools
{
get
{
return _isOpenTools;
}
set
{
_isOpenTools = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuTools
{
get
{
return new RelayCommand(() =>
{
IsOpenTools = true;
IsOpenHome = false;
});
}
}
#endregion
#region Siemens
private bool _isOpenSie = false;
public bool IsOpenSie
{
get
{
return _isOpenSie;
}
set
{
_isOpenSie = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuSie
{
get
{
return new RelayCommand(() =>
{
IsOpenSie = true;
IsOpenHome = false;
});
}
}
#endregion
#region Links
private bool _isOpenLinks = false;
public bool IsOpenLinks
{
get
{
return _isOpenLinks;
}
set
{
_isOpenLinks = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuLinks
{
get
{
return new RelayCommand(() =>
{
IsOpenLinks = true;
IsOpenPlantLinks =
IsOpenHome = false;
});
}
}
#endregion
#region Anlagen Links
private bool _isOpenPlantLinks = false;
public bool IsOpenPlantLinks
{
get
{
return _isOpenPlantLinks;
}
set
{
_isOpenPlantLinks = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinks
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinks = true;
IsOpenPlantLinksPl1 =
IsOpenPlantLinksPl2 =
IsOpenPlantLinksPl3 =
IsOpenLinks = false;
});
}
}
#endregion
#region Anlagen Links Pl1
private bool _isOpenPlantLinksPl1 = false;
public bool IsOpenPlantLinksPl1
{
get
{
return _isOpenPlantLinksPl1;
}
set
{
_isOpenPlantLinksPl1 = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinksPl1
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinksPl1 = true;
IsOpenPlantLinks = false;
});
}
}
#endregion
#region Anlagen Links Pl2
private bool _isOpenPlantLinksPl2 = false;
public bool IsOpenPlantLinksPl2
{
get
{
return _isOpenPlantLinksPl2;
}
set
{
_isOpenPlantLinksPl2 = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinksPl2
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinksPl2 = true;
IsOpenPlantLinks = false;
});
}
}
#endregion
#region Anlagen Links Pl3
private bool _isOpenPlantLinksPl3 = false;
public bool IsOpenPlantLinksPl3
{
get
{
return _isOpenPlantLinksPl3;
}
set
{
_isOpenPlantLinksPl3 = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuPlantLinksPl3
{
get
{
return new RelayCommand(() =>
{
IsOpenPlantLinksPl3 = true;
IsOpenPlantLinks = false;
});
}
}
#endregion
#region Apps
private bool _isOpenApps = false;
public bool IsOpenApps
{
get
{
return _isOpenApps;
}
set
{
_isOpenApps = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuApps
{
get
{
return new RelayCommand(() =>
{
IsOpenApps = true;
IsOpenAppsVncRdp =
IsOpenHome = false;
});
}
}
#endregion
#region Apps RDP VNC
private bool _isOpenAppsVncRdp = false;
public bool IsOpenAppsVncRdp
{
get
{
return _isOpenAppsVncRdp;
}
set
{
_isOpenAppsVncRdp = value;
OnPropertyChanged();
}
}
public ICommand OpenRadialMenuAppsVncRdp
{
get
{
return new RelayCommand(() =>
{
IsOpenAppsVncRdp = true;
IsOpenApps = false;
});
}
}
#endregion
private void _window_Deactivated(object sender, EventArgs e)
{
_window.Visibility = Visibility.Hidden;
IsOpenHome = true;
IsOpenEpl =
IsOpenTools =
IsOpenSie =
IsOpenLinks =
IsOpenApps =
IsOpenPlantLinksPl1 =
IsOpenPlantLinksPl2 =
IsOpenPlantLinksPl3 =
IsOpenAppsVncRdp =
IsOpenPlantLinks = false;
}
}
}

View File

@@ -0,0 +1,6 @@
namespace FSI.BT.Tools
{
internal class ResourceManager
{
}
}

View File

@@ -20,6 +20,7 @@ namespace FSI.BT.Tools.Settings
IEnumerable<Folder.IFolder> Folders { get; }
IEnumerable<TxtToClip.ITxtToClip> TxtToClip { get; }
IEnumerable<RdpMgt.IRdp> Rdps { get; }
Lib.Guis.SieTiaWinCCMsgMgt.IInterface WinCC { get; set; }

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FSI.BT.Tools.Settings
{
public class RdpMgt
{
public interface IRdp : Lib.Guis.Rdp.Mgt.IInterface { }
}
}

View File

@@ -277,49 +277,49 @@
]
},
{
"Cmd": "Pl1Pls",
"Cmd": "Pl1.Pls",
"Urls": [
"http://10.10.200.2/SKPL1Web/index.aspx"
]
},
{
"Cmd": "Pl1Lst",
"Cmd": "Pl1.Lst",
"Urls": [
"http://desiaugetwf.fondium.org/web/Seiten/Leistungsdaten_FuG.aspx?Fkt=PL1"
]
},
{
"Cmd": "Pl2Als",
"Cmd": "Pl2.Als",
"Urls": [
"http://10.10.213.234:84/emb_1/index.html"
]
},
{
"Cmd": "Pl2Pls",
"Cmd": "Pl2.Pls",
"Urls": [
"http://10.10.213.4/SKPL2Web/index.aspx"
]
},
{
"Cmd": "Pl2Lst",
"Cmd": "Pl2.Lst",
"Urls": [
"http://desiaugetwf/web/Seiten/Leistungsdaten_PL2.aspx"
]
},
{
"Cmd": "Pl2Nc",
"Cmd": "Pl2.Nc",
"Urls": [
"http://10.10.213.4/SKPL2Web/Seiten/Taktzeiten_PopUp.aspx"
]
},
{
"Cmd": "Pl2Key",
"Cmd": "Pl2.Key",
"Urls": [
"http://10.10.213.4/skkeymanager-pl2"
]
},
{
"Cmd": "Pl2Alg",
"Cmd": "Pl2.Alg",
"Urls": [
"http://10.10.213.4/SKPL2Web/index.aspx",
"http://10.10.213.234:84/emb_1/index.html",
@@ -355,6 +355,34 @@
"Urls": [
"https://mingle-portal.eu1.inforcloudsuite.com/FONDIUM_prd"
]
},
{
"Cmd": "Epl.Pdf"
},
{
"Cmd": "Epl.Prj"
},
{
"Cmd": "Rdp.Mgt"
},
{
"Cmd": "Epl.PdfMgt"
},
{
"Cmd": "Calc",
"Exe": [
{
"ExePath": "ExtTools\\kalk\\net6.0\\kalk.exe"
}
]
},
{
"Cmd": "Iba.Pda",
"Exe": [
{
"ExePath": "C:\\Program Files (x86)\\iba\\ibaPDA\\Client\\ibaPda.exe"
}
]
}
],
"Folders": [
@@ -424,6 +452,20 @@
"Txt": "\\\\fondium.org\\DESI$\\AUG_Abteilung\\Betriebstechnik\\EPL\\P8\\Data\\Projekte\\FSI\\"
}
],
"Rdps": [
{
"Plant": "PL1",
"SubPlant": "Alg",
"Description": "Programmier PC",
"Host": "10.10.200.28"
},
{
"Plant": "Alg",
"SubPlant": "Alg",
"Description": "Programmier Maier St.",
"Host": "10.10.199.92"
}
],
"WinCC": {
"AutoStart": false,
"UpdateIntervall": 10,