diff --git a/FSI.BT.Tools/Admin.cs b/FSI.BT.Tools/Admin.cs index 59ad7e5..bf72525 100644 --- a/FSI.BT.Tools/Admin.cs +++ b/FSI.BT.Tools/Admin.cs @@ -6,21 +6,30 @@ namespace FSI.BT.Tools { internal class Admin { + public static bool CheckSuperAdminRight() + { + if (Global.Settings.SuperAdmin == null) + { + return false; + } + + System.Security.Principal.WindowsIdentity windowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent(); + + if (string.Equals(Global.Settings.SuperAdmin, windowsIdentity.ShortName(), StringComparison.OrdinalIgnoreCase)) + return true; + + return false; + } + public static bool CheckAdminRight() { - string adminsSettings = Lib.Settings.Setting("AdminUsers", Lib.Settings.Mode.ExeSetttings); - string[] adminsCrypt = adminsSettings.Split(";;"); - - List admins = new List(); - foreach (string admin in adminsCrypt) + if (Global.Settings.Admins == null) { - try - { - admins.Add(Lib.DeEncryptString.DeEncrypt.DecryptString(Lib.DeEncryptString.DeEncrypt.DecryptString(admin, Lib.Settings.Setting("DeEnCryptPasswort", Lib.Settings.Mode.ExeSetttings)), Lib.Settings.Setting("DeEnCryptPasswort", Lib.Settings.Mode.ExeSetttings))); - } - catch { } + return false; } - + + List admins = new List(Global.Settings.Admins); + System.Security.Principal.WindowsIdentity windowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent(); foreach (string admin in admins) @@ -31,5 +40,25 @@ namespace FSI.BT.Tools return false; } + + public static bool CheckUserRight() + { + if (Global.Settings.Users == null) + { + return false; + } + + List users = new List(Global.Settings.Users); + + System.Security.Principal.WindowsIdentity windowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent(); + + foreach (string user in users) + { + if (string.Equals(user, windowsIdentity.ShortName(), StringComparison.OrdinalIgnoreCase)) + return true; + } + + return false; + } } } diff --git a/FSI.BT.Tools/App.config b/FSI.BT.Tools/App.config deleted file mode 100644 index 3dea568..0000000 --- a/FSI.BT.Tools/App.config +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FSI.BT.Tools/App.xaml b/FSI.BT.Tools/App.xaml index ca580b7..f841c3b 100644 --- a/FSI.BT.Tools/App.xaml +++ b/FSI.BT.Tools/App.xaml @@ -2,7 +2,8 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:tb="http://www.hardcodet.net/taskbar" - Startup="InitApplication"> + Startup="Application_Startup" + Exit="Application_Exit"> diff --git a/FSI.BT.Tools/App.xaml.cs b/FSI.BT.Tools/App.xaml.cs index 78ee390..26bdd63 100644 --- a/FSI.BT.Tools/App.xaml.cs +++ b/FSI.BT.Tools/App.xaml.cs @@ -3,10 +3,6 @@ using NHotkey; using NHotkey.Wpf; using System.Windows; using System.Windows.Input; -using FSI.Lib.Wpf.ExtensionMethods; -using System.IO; -using System.Diagnostics; -using System; namespace FSI.BT.Tools { @@ -18,11 +14,18 @@ namespace FSI.BT.Tools private static readonly KeyGesture RadialMenu = new(Key.OemBackslash, ModifierKeys.Control); private static readonly KeyGesture TimeStamp = new(Key.C, ModifierKeys.Control | ModifierKeys.Alt); - public void InitApplication(object sender, StartupEventArgs e) + public void Application_Startup(object sender, StartupEventArgs e) { + + Global.Settings = new AppSettings(GetType().Namespace.ToString() + ".xml"); + Global.Settings.Load(); + + Global.TaskbarIcon = (TaskbarIcon)FindResource("FSINotifyIcon"); Global.AdminRights = Admin.CheckAdminRight(); + Global.SuperAdminRights = Admin.CheckSuperAdminRight(); + Global.UserRights = Admin.CheckUserRight(); HotkeyManager.Current.AddOrReplace("RadialMenu", RadialMenu, ShowRadialMenu); @@ -34,7 +37,9 @@ namespace FSI.BT.Tools private void ShowRadialMenu(object sender, HotkeyEventArgs e) { var cmd = new Commands.RadialMenuCommand(); - cmd.Execute(null); + + if (cmd.CanExecute(null)) + cmd.Execute(null); e.Handled = true; } @@ -47,5 +52,9 @@ namespace FSI.BT.Tools e.Handled = true; } + private void Application_Exit(object sender, ExitEventArgs e) + { + Global.Settings.Save(); + } } } \ No newline at end of file diff --git a/FSI.BT.Tools/AppSettings.cs b/FSI.BT.Tools/AppSettings.cs new file mode 100644 index 0000000..e841a56 --- /dev/null +++ b/FSI.BT.Tools/AppSettings.cs @@ -0,0 +1,61 @@ +using FSI.Lib.WinSettings; + +namespace FSI.BT.Tools +{ + public class AppSettings : XmlSettings + { + + public AppSettings(string fileName) : base(fileName) + { + TimeStampFormat = "_yyyyMMdd_HHmmss"; + EplArguments = "/Variant:\"Electric P8\""; + SuperAdmin = "maier_s"; + } + + [EncryptedSetting] + public string[]? Users { get; set; } + [EncryptedSetting] + public string[]? Admins{ get; set; } + public string? SuperAdmin{ get; set; } + public string? TimeStampFormat { get; set; } + public string[]? SieSimaticManagerExe { get; set; } + public string[]? SieTiaV13Exe { get; set; } + public string[]? SieTiaV14Exe { get; set; } + public string[]? SieTiaV15Exe { get; set; } + public string[]? SieTiaV16Exe { get; set; } + public string[]? SieTiaV17Exe { get; set; } + public string[]? SieTiaVStarterExe { get; set; } + public string[]? EplExe { get; set; } + public string? EplArguments { get; set; } + public string[]? NppExe { get; set; } + public string[]? TotalCmdExe { get; set; } + public string[]? TeXstudioExe { get; set; } + public string[]? TeXstudioPath { get; set; } + public string[]? VsExe { get; set; } + public string[]? VsCodeExe { get; set; } + public string[]? RdpExe { get; set; } + public string[]? OutlookExe { get; set; } + public string[]? TeamsExe { get; set; } + public string? TeamsArg { get; set; } + public string[]? ExcelExe { get; set; } + public string[]? WordExe { get; set; } + public string[]? PaintNetExe { get; set; } + public string[]? GimpExe { get; set; } + public string[]? VncExe { get; set; } + public string[]? VncAdrBookExe { get; set; } + public string? ZentralWebUrl { get; set; } + public string? SchichtbuchUrl { get; set; } + public string? SPSUrl { get; set; } + public string? Pl1PlsUrl { get; set; } + public string? Pl2PlsUrl { get; set; } + public string? Pl2PlsAls { get; set; } + public string? Pl3PlsUrl { get; set; } + public string? GiteaUrl { get; set; } + public string? WikiUrl { get; set; } + public string? ErpUrl { get; set; } + public string? EplPdfPath { get; set; } + public string? EplPrjPath { get; set; } + + + } +} diff --git a/FSI.BT.Tools/Commands/LoginCommand.cs b/FSI.BT.Tools/Commands/LoginCommand.cs index ec3ceb8..762eea4 100644 --- a/FSI.BT.Tools/Commands/LoginCommand.cs +++ b/FSI.BT.Tools/Commands/LoginCommand.cs @@ -11,7 +11,7 @@ namespace FSI.BT.Tools.Commands { Lib.Guis.AutoPw.FrmMain frmMain = new() { - CloseAtLostFocus = true, + CloseAtLostFocus = false, WindowStartupLocation = WindowStartupLocation.CenterOwner, }; frmMain.ShowDialog(); @@ -20,7 +20,6 @@ namespace FSI.BT.Tools.Commands Global.AdminRights = frmMain.PwOk; } - public override bool CanExecute(object parameter) { return true; diff --git a/FSI.BT.Tools/Commands/OpenAppCommand.cs b/FSI.BT.Tools/Commands/OpenAppCommand.cs index dcc3556..e532dc0 100644 --- a/FSI.BT.Tools/Commands/OpenAppCommand.cs +++ b/FSI.BT.Tools/Commands/OpenAppCommand.cs @@ -20,36 +20,36 @@ namespace FSI.BT.Tools.Commands switch ((string)parameter) { case "SimaticManager": - files = Global.Settings.Apps.SieSimaticManagerExe.Split(";"); + files = Global.Settings.SieSimaticManagerExe; break; case "TIAv13": - files = Global.Settings.Apps.SieTiaV13Exe.Split(";"); + files = Global.Settings.SieTiaV13Exe; break; case "TIAv14": - files = Global.Settings.Apps.SieTiaV14Exe.Split(";"); + files = Global.Settings.SieTiaV14Exe; break; case "TIAv15": - files = Global.Settings.Apps.SieTiaV15Exe.Split(";"); + files = Global.Settings.SieTiaV13Exe; break; case "TIAv16": - files = Global.Settings.Apps.SieTiaV16Exe.Split(";"); + files = Global.Settings.SieTiaV16Exe; break; case "TIAv17": - files = Global.Settings.Apps.SieTiaV17Exe.Split(";"); + files = Global.Settings.SieTiaV17Exe; break; case "Starter": - files = Global.Settings.Apps.SieTiaVStarterExe.Split(";"); + files = Global.Settings.SieTiaVStarterExe; break; case "Epl": - files = Global.Settings.Apps.Epl.Exe.Split(";"); - arguments = Global.Settings.Apps.Epl.Arguments; + files = Global.Settings.EplExe; + arguments = Global.Settings.EplArguments; break; case "EplPrj": @@ -58,6 +58,8 @@ namespace FSI.BT.Tools.Commands ShowPdf = false, CloseAtLostFocus = true, WindowStartupLocation = WindowStartupLocation.CenterOwner, + Path = Global.Settings.EplPrjPath, + EplExes = Global.Settings.EplExe, }; frmMainEplPrj.Show(); return; @@ -68,6 +70,7 @@ namespace FSI.BT.Tools.Commands ShowPdf = true, CloseAtLostFocus = true, WindowStartupLocation = WindowStartupLocation.CenterOwner, + Path = Global.Settings.EplPdfPath, }; frmMainEplPdf.Show(); return; @@ -81,35 +84,35 @@ namespace FSI.BT.Tools.Commands return; case "Npp": - files = Global.Settings.Apps.NppExe.Split(";"); + files = Global.Settings.NppExe; break; case "TotalCmd": - files = Global.Settings.Apps.TotalCmdExe.Split(";"); + files = Global.Settings.TotalCmdExe; break; case "TeXstudio": - files = Global.Settings.Apps.TeXstudioExe.Split(";"); - pathes = Global.Settings.Apps.TeXstudioPath.Split(";"); + files = Global.Settings.TeXstudioExe; + pathes = Global.Settings.TeXstudioPath; break; case "VS": - files = Global.Settings.Apps.VsExe.Split(";"); + files = Global.Settings.VsExe; break; case "VS.Code": - files = Global.Settings.Apps.VsCodeExe.Split(";"); + files = Global.Settings.VsCodeExe; break; case "Rdp": - files = Global.Settings.Apps.RdpExe.Split(";"); ; + files = Global.Settings.RdpExe; break; case "DeEncrypt": Lib.Guis.DeEncryptMessage.FrmMain frmMainDeEnCrypt = new() { - Password = Global.Settings.General.DeEnCryptPasswort, + Password = GetType().Namespace.ToString(), CloseAtLostFocus = true, WindowStartupLocation = WindowStartupLocation.CenterOwner, }; @@ -121,6 +124,54 @@ namespace FSI.BT.Tools.Commands frmMain.Show(); return; + case "Admin": + Gui.FrmAdmin frmAdmin = new() + { + Admins = Global.Settings.Admins, + Users = Global.Settings.Users, + }; + frmAdmin.ShowDialog(); + + if (frmAdmin.DialogResult.HasValue && frmAdmin.DialogResult.Value) + { + Global.Settings.Admins = frmAdmin.Admins; + Global.Settings.Users = frmAdmin.Users; + } + return; + + case "Outlook": + files = Global.Settings.OutlookExe; + break; + + case "Teams": + files = Global.Settings.TeamsExe; + arguments = Global.Settings.TeamsArg; + break; + + case "Excel": + files = Global.Settings.ExcelExe; + break; + + case "Word": + files = Global.Settings.WordExe; + break; + + case "PaintNet": + files = Global.Settings.PaintNetExe; + break; + + case "Gimp": + files = Global.Settings.GimpExe; + break; + + case "Vnc": + files = Global.Settings.VncExe; + break; + + case "VncAdrBook": + files = Global.Settings.VncAdrBookExe; + break; + } string fileName = string.Empty; @@ -177,35 +228,35 @@ namespace FSI.BT.Tools.Commands switch ((string)parameter) { case "SimaticManager": - files = Global.Settings.Apps.SieSimaticManagerExe.Split(";"); + files = Global.Settings.SieSimaticManagerExe; break; case "TIAv13": - files = Global.Settings.Apps.SieTiaV13Exe.Split(";"); + files = Global.Settings.SieTiaV13Exe; break; case "TIAv14": - files = Global.Settings.Apps.SieTiaV14Exe.Split(";"); + files = Global.Settings.SieTiaV14Exe; break; case "TIAv15": - files = Global.Settings.Apps.SieTiaV15Exe.Split(";"); + files = Global.Settings.SieTiaV13Exe; break; case "TIAv16": - files = Global.Settings.Apps.SieTiaV16Exe.Split(";"); + files = Global.Settings.SieTiaV16Exe; break; case "TIAv17": - files = Global.Settings.Apps.SieTiaV17Exe.Split(";"); + files = Global.Settings.SieTiaV17Exe; break; case "Starter": - files = Global.Settings.Apps.SieTiaVStarterExe.Split(";"); + files = Global.Settings.SieTiaVStarterExe; break; case "Epl": - files = Global.Settings.Apps.Epl.Exe.Split(";"); + files = Global.Settings.EplExe; break; case "EplPrj": @@ -218,27 +269,28 @@ namespace FSI.BT.Tools.Commands return Global.AdminRights; case "Npp": - files = Global.Settings.Apps.NppExe.Split(";"); + files = Global.Settings.NppExe; break; case "TotalCmd": - files = Global.Settings.Apps.TotalCmdExe.Split(";"); + files = Global.Settings.TotalCmdExe; break; case "TeXstudio": - files = Global.Settings.Apps.TeXstudioExe.Split(";"); + files = Global.Settings.TeXstudioExe; break; case "VS": - files = Global.Settings.Apps.VsExe.Split(";"); + files = Global.Settings.VsExe; break; case "VS.Code": - files = Global.Settings.Apps.VsCodeExe.Split(";"); + files = Global.Settings.VsCodeExe; break; + case "Rdp": - files = Global.Settings.Apps.RdpExe.Split(";"); ; + files = Global.Settings.RdpExe; break; case "DeEncrypt": @@ -246,6 +298,42 @@ namespace FSI.BT.Tools.Commands case "StarterCsvExporter": return Global.AdminRights; + + case "Admin": + return Global.SuperAdminRights; + + case "Outlook": + files = Global.Settings.OutlookExe; + break; + + case "Teams": + files = Global.Settings.TeamsExe; + break; + + case "Excel": + files = Global.Settings.ExcelExe; + break; + + case "Word": + files = Global.Settings.WordExe; + break; + + case "PaintNet": + files = Global.Settings.PaintNetExe; + break; + + case "Gimp": + files = Global.Settings.GimpExe; + break; + + case "Vnc": + files = Global.Settings.VncExe; + break; + + case "VncAdrBook": + files = Global.Settings.VncAdrBookExe; + break; + default: return false; } diff --git a/FSI.BT.Tools/Commands/OpenLinkCommand.cs b/FSI.BT.Tools/Commands/OpenLinkCommand.cs index c6de297..ef6cda0 100644 --- a/FSI.BT.Tools/Commands/OpenLinkCommand.cs +++ b/FSI.BT.Tools/Commands/OpenLinkCommand.cs @@ -16,43 +16,43 @@ namespace FSI.BT.Tools.Commands switch ((string)parameter) { case "ZentralWeb": - url = Global.Settings.Urls.ZentralWeb; + url = Global.Settings.ZentralWebUrl; break; case "Schichtbuch": - url = Global.Settings.Urls.Schichtbuch; + url = Global.Settings.SchichtbuchUrl; break; case "SPS": - url = Global.Settings.Urls.SPS; + url = Global.Settings.SPSUrl; break; case "PL1.Pls": - url = Global.Settings.Urls.Pl1Pls; + url = Global.Settings.Pl1PlsUrl; break; case "PL2.Pls": - url = Global.Settings.Urls.Pl2Pls; + url = Global.Settings.Pl2PlsUrl; break; case "PL2.Als": - url = Global.Settings.Urls.Pl2Als; + url = Global.Settings.Pl2PlsAls; break; case "PL3.Pls": - url = Global.Settings.Urls.Pl3Pls; + url = Global.Settings.Pl3PlsUrl; break; case "FSI.Gitea": - url = Global.Settings.Urls.Gitea; + url = Global.Settings.GiteaUrl; break; case "FSI.Wiki": - url = Global.Settings.Urls.Wiki; + url = Global.Settings.WikiUrl; break; case "Erp": - url = Global.Settings.Urls.Erp; + url = Global.Settings.ErpUrl; break; } diff --git a/FSI.BT.Tools/Commands/TimeStampToClipboardCommand.cs b/FSI.BT.Tools/Commands/TimeStampToClipboardCommand.cs index d08b13f..855ce65 100644 --- a/FSI.BT.Tools/Commands/TimeStampToClipboardCommand.cs +++ b/FSI.BT.Tools/Commands/TimeStampToClipboardCommand.cs @@ -1,4 +1,5 @@ -using System.Windows.Controls.Primitives; +using System; +using System.Windows.Controls.Primitives; namespace FSI.BT.Tools.Commands { @@ -9,7 +10,7 @@ namespace FSI.BT.Tools.Commands { public override void Execute(object parameter) { - System.Windows.Forms.Clipboard.SetDataObject(Global.Settings.General.TimeStampFormat); + System.Windows.Forms.Clipboard.SetDataObject(DateTime.Now.ToString(Global.Settings.TimeStampFormat)); var balloon = new ToolTip() { BalloonText = "Zeitstempel", diff --git a/FSI.BT.Tools/FSI.BT.Tools.csproj b/FSI.BT.Tools/FSI.BT.Tools.csproj index d82ed82..c51072c 100644 --- a/FSI.BT.Tools/FSI.BT.Tools.csproj +++ b/FSI.BT.Tools/FSI.BT.Tools.csproj @@ -8,13 +8,46 @@ true true Icons\FondiumU.ico - 0.1 + 2.0 - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -26,22 +59,29 @@ + + + + + + + @@ -49,9 +89,18 @@ + + + + + + + + PreserveNewest + diff --git a/FSI.BT.Tools/FSI.BT.Tools.xml b/FSI.BT.Tools/FSI.BT.Tools.xml new file mode 100644 index 0000000..812c70a --- /dev/null +++ b/FSI.BT.Tools/FSI.BT.Tools.xml @@ -0,0 +1,44 @@ + + + +I945AMzKKYBAAAAB21haWVyX3M= + e+Dt7FRUDDoBAAAAB21haWVyX3M= + maier_s + _yyyyMMdd_HHmmss + C:\Program Files (x86)\Siemens\Step7\S7BIN\S7tgtopx.exe + C:\Program Files (x86)\Siemens\Automation\Portal V13\Bin\Siemens.Automation.Portal.exe + C:\Program Files\Siemens\Automation\Portal V14\Bin\Siemens.Automation.Portal.exe + C:\Program Files\Siemens\Automation\Portal V15\Bin\Siemens.Automation.Portal.exe,c:\Program Files\Siemens\Automation\Portal V15_1\Bin\Siemens.Automation.Portal.exe + C:\Program Files\Siemens\Automation\Portal V16\Bin\Siemens.Automation.Portal.exe + C:\Program Files\Siemens\Automation\Portal V17\Bin\Siemens.Automation.Portal.exe + C:\Program Files (x86)\Siemens\Step7\S7BIN\u7wdrfax.exe + C:\Program Files\EPLAN\Platform\2.9.4\Bin\EPLAN.exe,C:\Program Files\EPLAN\Platform\2022.0.3\Bin\Eplan.exe + /Variant:"Electric P8" + C:\Windows\system32\notepad.exe,c:\Program Files\Notepad++\notepad++.exe + C:\Program Files\totalcmd\TOTALCMD.EXE,C:\Program Files\totalcmd\TOTALCMD64.EXE,C:\totalcmd\TOTALCMD64.EXE,C:\totalcmd\TOTALCMD.EXE + C:\Program Files\texstudio\texstudio.exe + C:\Program Files\texstudio\dictionaries + C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe + %USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe + %windir%\system32\mstsc.exe + C:\Program Files (x86)\Microsoft Office\root\Office16\OUTLOOK.EXE + C:\Users\maier_s\AppData\Local\Microsoft\Teams\Update.exe + --processStart ""Teams.exe"" + C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE + C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE + C:\Program Files\paint.net\paintdotnet.exe + C:\Program Files\GIMP 2\bin\gimp-2.10.exe + C:\Program Files\RealVNC\VNC Viewer\vncviewer.exe,c:\Users\maier_s\OneDrive - Fondium Group GmbH\Documents\Apps\VNC-Viewer-6.20.113-Windows-64bit.exe + C:\Program Files\RealVNC\VNC Viewer\vncaddrbook.exe + http://desiaugetwf/web/?AspxAutoDetectCookieSupport=1 + http://10.10.1.42/SKSchichtbuchWeb/de-DE/Plugin/ShiftBook/ShiftBook/IR + http://10.10.1.42/SKChangeTrackerWeb/de-DE/Plugin/ChangeTracker + http://10.10.200.2/SKPL1Web/index.aspx + http://10.10.213.4/SKPL2Web/index.aspx + http://10.10.213.234:84/emb_1/index.html + http://10.10.202.10/SKPL3Web/index.aspx + http://desiaugetc7-088:3000/ + http://desiaugetc7-088:3001/en/home + https://mingle-portal.eu1.inforcloudsuite.com/FONDIUM_prd + \\10.10.1.40\Betriebstechnik\Eplan + \\fondium.org\DESI$\AUG_Abteilung\Betriebstechnik\EPL\P8\Data\Projekte\FSI\ + \ No newline at end of file diff --git a/FSI.BT.Tools/FrmRadialMenu.xaml b/FSI.BT.Tools/FrmRadialMenu.xaml index 7942c2e..e47cf49 100644 --- a/FSI.BT.Tools/FrmRadialMenu.xaml +++ b/FSI.BT.Tools/FrmRadialMenu.xaml @@ -39,7 +39,7 @@ - + @@ -49,11 +49,10 @@ - + - + @@ -65,11 +64,10 @@ - + - + @@ -81,11 +79,10 @@ - + - + @@ -98,11 +95,10 @@ + CommandParameter="TotalCmd"> - + @@ -115,27 +111,25 @@ + CommandParameter="Npp"> - + - Notepad++ + N++ - + - + @@ -147,6 +141,53 @@ + + + + + + + + + Outlook + + + + + + + + + + + + + Teams + + + + + + + + + + + + + Apps + + + + @@ -163,8 +204,7 @@ + CommandParameter="Epl"> @@ -180,8 +220,7 @@ + CommandParameter="EplPrj"> @@ -197,8 +236,7 @@ + CommandParameter="EplPdf"> @@ -213,8 +251,8 @@ - + @@ -234,8 +272,7 @@ - + @@ -246,8 +283,7 @@ + CommandParameter="DeEncrypt"> @@ -263,8 +299,7 @@ + CommandParameter="Rdp"> @@ -280,8 +315,7 @@ + CommandParameter="VS"> @@ -297,8 +331,7 @@ + CommandParameter="VS.Code"> @@ -315,8 +348,7 @@ + CommandParameter="TeXstudio"> @@ -332,8 +364,7 @@ + CommandParameter="StarterCsvExporter"> @@ -348,6 +379,22 @@ + + + + + + + + + Admin + + + + @@ -364,8 +411,7 @@ + CommandParameter="SimaticManager"> @@ -381,8 +427,7 @@ + CommandParameter="TIAv13"> @@ -398,8 +443,7 @@ + CommandParameter="TIAv14"> @@ -415,8 +459,7 @@ + CommandParameter="TIAv15"> @@ -432,8 +475,7 @@ + CommandParameter="TIAv16"> @@ -449,8 +491,7 @@ + CommandParameter="TIAv17"> @@ -466,8 +507,7 @@ + CommandParameter="Starter"> @@ -487,8 +527,7 @@ - + @@ -498,8 +537,7 @@ - + @@ -515,8 +553,7 @@ + CommandParameter="Erp"> @@ -531,10 +568,9 @@ - + + CommandParameter="ZentralWeb"> @@ -550,8 +586,7 @@ + CommandParameter="Schichtbuch"> @@ -567,8 +602,7 @@ + CommandParameter="SPS"> @@ -584,8 +618,7 @@ + CommandParameter="FSI.Gitea"> @@ -595,14 +628,13 @@ - FSIGitea + Gitea + CommandParameter="FSI.Wiki"> @@ -632,8 +664,7 @@ + CommandParameter="ZentralWeb"> @@ -649,8 +680,7 @@ + CommandParameter="PL1.PLS"> @@ -666,8 +696,7 @@ + CommandParameter="PL2.PLS"> @@ -683,8 +712,7 @@ + CommandParameter="PL2.Als"> @@ -700,8 +728,7 @@ + CommandParameter="PL3.Pls"> @@ -718,6 +745,117 @@ + + + + + + + + + + + + + + + + + + + + + Excel + + + + + + + + + + + + + Word + + + + + + + + + + + + + Paint.Net + + + + + + + + + + + + + Gimp + + + + + + + + + + + + + VNC + + + + + + + + + + + + + VNCAdressbuch + + + + + + diff --git a/FSI.BT.Tools/FrmRadialMenu.xaml.cs b/FSI.BT.Tools/FrmRadialMenu.xaml.cs index 7035495..c613733 100644 --- a/FSI.BT.Tools/FrmRadialMenu.xaml.cs +++ b/FSI.BT.Tools/FrmRadialMenu.xaml.cs @@ -56,6 +56,7 @@ namespace FSI.BT.Tools IsOpenEpl = IsOpenTools = IsOpenSie = + IsOpenApps = IsOpenLinks = false; }); } @@ -213,6 +214,36 @@ namespace FSI.BT.Tools #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; + IsOpenHome = false; + }); + } + } + + #endregion + public event PropertyChangedEventHandler PropertyChanged; void RaisePropertyChanged([CallerMemberName] string? propertyName = null) @@ -229,38 +260,8 @@ namespace FSI.BT.Tools IsOpenTools = IsOpenSie = IsOpenLinks = + IsOpenApps = IsOpenPlantLinks = false; } - - - private void RadialMenuItem_Click(object sender, RoutedEventArgs e) - { - int left = Convert.ToInt32(GetActualLeft() + this.ActualWidth / 2); - int top = Convert.ToInt32(GetActuaTop() + this.ActualHeight / 2); - System.Windows.Forms.Cursor.Position = new System.Drawing.Point(left, top); - } - - - private double GetActualLeft() - { - if (this.WindowState == WindowState.Maximized) - { - var leftField = typeof(Window).GetField("_actualLeft", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - return (double)leftField.GetValue(this); - } - else - return this.Left; - } - - private double GetActuaTop() - { - if (this.WindowState == WindowState.Maximized) - { - var topField = typeof(Window).GetField("_actualTop", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); - return (double)topField.GetValue(this); - } - else - return this.Top; - } } } diff --git a/FSI.BT.Tools/Global.cs b/FSI.BT.Tools/Global.cs index be7c319..1f76397 100644 --- a/FSI.BT.Tools/Global.cs +++ b/FSI.BT.Tools/Global.cs @@ -1,4 +1,5 @@ -using Hardcodet.Wpf.TaskbarNotification; +using FSI.Lib.WinSettings; +using Hardcodet.Wpf.TaskbarNotification; namespace FSI.BT.Tools { @@ -9,171 +10,12 @@ namespace FSI.BT.Tools public static TaskbarIcon? TaskbarIcon { get; set; } - + public static AppSettings? Settings { get; set; } public static bool UserRights { get; set; } public static bool AdminRights { get; set; } - - public static class Settings - { - public static class General - { - public static string DeEnCryptPasswort - { - get - { - return FSI.Lib.Settings.Setting("DeEnCryptPasswort", Lib.Settings.Mode.ExeSetttings); - } - } - public static string TimeStampFormat - { - get - { - return FSI.Lib.Settings.Setting("TimeStamp.Format", Lib.Settings.Mode.ExeSetttings); - } - } - } - - public static class Apps - { - public static string SieSimaticManagerExe - { - get { return FSI.Lib.Settings.Setting("SIE.Simatic.Manager.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SieTiaV13Exe - { - get { return FSI.Lib.Settings.Setting("SIE.TIA.V13.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SieTiaV14Exe - { - get { return FSI.Lib.Settings.Setting("SIE.TIA.V14.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SieTiaV15Exe - { - get { return FSI.Lib.Settings.Setting("SIE.TIA.V15.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SieTiaV16Exe - { - get { return FSI.Lib.Settings.Setting("SIE.TIA.V16.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SieTiaV17Exe - { - get { return FSI.Lib.Settings.Setting("SIE.TIA.V17.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SieTiaVStarterExe - { - get { return FSI.Lib.Settings.Setting("SIE.Starter.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static class Epl - { - public static string Exe - { - get { return FSI.Lib.Settings.Setting("Epl.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Arguments - { - get { return "/Variant:\"Electric P8\""; } - } - } - - public static string NppExe - { - get { return FSI.Lib.Settings.Setting("Npp.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string TotalCmdExe - { - get { return FSI.Lib.Settings.Setting("TotalCmd.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string TeXstudioExe - { - get { return FSI.Lib.Settings.Setting("TeXstudio.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string TeXstudioPath - { - get { return FSI.Lib.Settings.Setting("TeXstudio.Path", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string VsExe - { - get { return FSI.Lib.Settings.Setting("VS.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } + public static bool SuperAdminRights { get; set; } - public static string VsCodeExe - { - get { return FSI.Lib.Settings.Setting("VS.Code.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - - public static string RdpExe - { - get { return FSI.Lib.Settings.Setting("Rdp.Exe", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - } - - public static class Urls - { - public static string ZentralWeb - { - get { return FSI.Lib.Settings.Setting("ZentralWeb.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Schichtbuch - { - get { return FSI.Lib.Settings.Setting("Schichtbuch.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string SPS - { - get { return FSI.Lib.Settings.Setting("SPS.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Pl1Pls - { - get { return FSI.Lib.Settings.Setting("PL1.Pls.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Pl2Pls - { - get { return FSI.Lib.Settings.Setting("PL2.Pls.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Pl2Als - { - get { return FSI.Lib.Settings.Setting("PL2.Als.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Pl3Pls - { - get { return FSI.Lib.Settings.Setting("PL3.Pls.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - public static string Gitea - { - get { return FSI.Lib.Settings.Setting("FSI.Gitea.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Wiki - { - get { return FSI.Lib.Settings.Setting("FSI.Gitea.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - - public static string Erp - { - get { return FSI.Lib.Settings.Setting("Erp.Url", FSI.Lib.Settings.Mode.ExeSetttings); } - } - } - } } } diff --git a/FSI.BT.Tools/Gui/FrmAdmin.xaml b/FSI.BT.Tools/Gui/FrmAdmin.xaml new file mode 100644 index 0000000..ee7dd1a --- /dev/null +++ b/FSI.BT.Tools/Gui/FrmAdmin.xaml @@ -0,0 +1,48 @@ + + + + + + + + + + +