Neuerstellung
35
FSI.BT.Tools/Admin.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FSI.Lib.Helpers;
|
||||
|
||||
namespace FSI.BT.Tools
|
||||
{
|
||||
internal class Admin
|
||||
{
|
||||
public static bool CheckAdminRight()
|
||||
{
|
||||
string adminsSettings = Lib.Settings.Setting<string>("AdminUsers", Lib.Settings.Mode.ExeSetttings);
|
||||
string[] adminsCrypt = adminsSettings.Split(";;");
|
||||
|
||||
List<string> admins = new List<string>();
|
||||
foreach (string admin in adminsCrypt)
|
||||
{
|
||||
try
|
||||
{
|
||||
admins.Add(Lib.DeEncryptString.DeEncrypt.DecryptString(Lib.DeEncryptString.DeEncrypt.DecryptString(admin, Lib.Settings.Setting<string>("DeEnCryptPasswort", Lib.Settings.Mode.ExeSetttings)), Lib.Settings.Setting<string>("DeEnCryptPasswort", Lib.Settings.Mode.ExeSetttings)));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
System.Security.Principal.WindowsIdentity windowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent();
|
||||
|
||||
foreach (string admin in admins)
|
||||
{
|
||||
if (string.Equals(admin, windowsIdentity.ShortName(), StringComparison.OrdinalIgnoreCase))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
80
FSI.BT.Tools/App.config
Normal file
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="DeEnCryptPasswort"
|
||||
value="Fondium Singen GmbH"/>
|
||||
<add key="Users"
|
||||
value="x27xm8kujBnjlCVaIcoTTg=="/>
|
||||
<add key="AdminUsers"
|
||||
value="hU4oePJDurXlIZUL4WLIRTt7LoEhVS//rfdZH3O2QVsUPPJL62dqKOCbXZMDdCRih884NktbdDHgRSzsN7wjkQ=="/>
|
||||
|
||||
<add key="TimeStamp.Format"
|
||||
value="_yyyyMMdd_HHmmss"/>
|
||||
|
||||
<add key="SIE.Simatic.Manager.Exe"
|
||||
value="C:\Program Files (x86)\Siemens\Step7\S7BIN\S7tgtopx.exe"/>
|
||||
<add key="SIE.TIA.V13.Exe"
|
||||
value="C:\Program Files (x86)\Siemens\Automation\Portal V13\Bin\Siemens.Automation.Portal.exe"/>
|
||||
<add key="SIE.TIA.V14.Exe"
|
||||
value="C:\Program Files\Siemens\Automation\Portal V14\Bin\Siemens.Automation.Portal.exe"/>
|
||||
<add key="SIE.TIA.V15.Exe"
|
||||
value="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"/>
|
||||
<add key="SIE.TIA.V16.Exe"
|
||||
value="C:\Program Files\Siemens\Automation\Portal V16\Bin\Siemens.Automation.Portal.exe"/>
|
||||
<add key="SIE.TIA.V17.Exe"
|
||||
value="C:\Program Files\Siemens\Automation\Portal V17\Bin\Siemens.Automation.Portal.exe"/>
|
||||
<add key="SIE.Starter.Exe"
|
||||
value="C:\Program Files (x86)\Siemens\Step7\S7BIN\u7wdrfax.exe"/>
|
||||
|
||||
<add key="Epl.Exe"
|
||||
value="C:\Program Files\EPLAN\Platform\2.9.4\Bin\EPLAN.exe;
|
||||
C:\Program Files\EPLAN\Platform\2022.0.3\Bin\Eplan.exe"/>
|
||||
|
||||
<add key="Npp.Exe"
|
||||
value="C:\Windows\system32\notepad.exe;
|
||||
C:\Program Files\Notepad++\notepad++.exe"/>
|
||||
|
||||
<add key="TeXstudio.Exe"
|
||||
value="C:\Program Files\texstudio\texstudio.exe"/>
|
||||
<add key="TeXstudio.Path"
|
||||
value="C:\Program Files\texstudio\dictionaries"/>
|
||||
|
||||
<add key="TotalCmd.Exe"
|
||||
value="C:\Program Files\totalcmd\TOTALCMD.EXE;
|
||||
C:\Program Files\totalcmd\TOTALCMD64.EXE;
|
||||
C:\totalcmd\TOTALCMD64.EXE;
|
||||
C:\totalcmd\TOTALCMD.EXE"/>
|
||||
|
||||
<add key="VS.Exe"
|
||||
value="C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe"/>
|
||||
|
||||
<add key="VS.Code.Exe"
|
||||
value="%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\Code.exe"/>
|
||||
|
||||
<add key="Rdp.Exe"
|
||||
value="%windir%\system32\mstsc.exe"/>
|
||||
|
||||
<add key="ZentralWeb.Url"
|
||||
value="http://desiaugetwf/web/?AspxAutoDetectCookieSupport=1"/>
|
||||
<add key="Schichtbuch.Url"
|
||||
value="http://10.10.1.42/SKSchichtbuchWeb/de-DE/Plugin/ShiftBook/ShiftBook/IR"/>
|
||||
<add key="SPS.Url"
|
||||
value="http://10.10.1.42/SKChangeTrackerWeb/de-DE/Plugin/ChangeTracker"/>
|
||||
<add key="PL1.PLS.Url"
|
||||
value="http://10.10.200.2/SKPL1Web/index.aspx"/>
|
||||
<add key="PL2.PLS.Url"
|
||||
value="http://10.10.213.4/SKPL2Web/index.aspx"/>
|
||||
<add key="PL2.ALS.Url"
|
||||
value="http://10.10.213.234:84/emb_1/index.html"/>
|
||||
<add key="PL3.PLS.Url"
|
||||
value="http://10.10.202.10/SKPL3Web/index.aspx"/>
|
||||
<add key="FSI.Gitea.Url"
|
||||
value="http://desiaugetc7-088:3000/"/>
|
||||
<add key="FSI.Wiki.Url"
|
||||
value="http://desiaugetc7-088:3001/en/home"/>
|
||||
<add key="Erp.Url"
|
||||
value="https://mingle-portal.eu1.inforcloudsuite.com/FONDIUM_prd"/>
|
||||
|
||||
</appSettings>
|
||||
</configuration>
|
||||
17
FSI.BT.Tools/App.xaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<Application x:Class="FSI.BT.Tools.App"
|
||||
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">
|
||||
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="NotifyIconResources.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
</Application.Resources>
|
||||
|
||||
</Application>
|
||||
51
FSI.BT.Tools/App.xaml.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
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
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : System.Windows.Application
|
||||
{
|
||||
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)
|
||||
{
|
||||
Global.TaskbarIcon = (TaskbarIcon)FindResource("FSINotifyIcon");
|
||||
|
||||
Global.AdminRights = Admin.CheckAdminRight();
|
||||
|
||||
HotkeyManager.Current.AddOrReplace("RadialMenu", RadialMenu, ShowRadialMenu);
|
||||
|
||||
HotkeyManager.Current.AddOrReplace("TimeStampToClipboard", TimeStamp, TimeStampToClipboard);
|
||||
|
||||
Global.FrmRadialMenu = new();
|
||||
}
|
||||
|
||||
private void ShowRadialMenu(object sender, HotkeyEventArgs e)
|
||||
{
|
||||
var cmd = new Commands.RadialMenuCommand();
|
||||
cmd.Execute(null);
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void TimeStampToClipboard(object sender, HotkeyEventArgs e)
|
||||
{
|
||||
var cmd = new Commands.TimeStampToClipboardCommand();
|
||||
cmd.Execute(null);
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
153
FSI.BT.Tools/Commands/CommandBase.cs
Normal file
@@ -0,0 +1,153 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Media;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Basic implementation of the <see cref="ICommand"/>
|
||||
/// interface, which is also accessible as a markup
|
||||
/// extension.
|
||||
/// </summary>
|
||||
public abstract class CommandBase<T> : MarkupExtension, ICommand
|
||||
where T : class, ICommand, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// A singleton instance.
|
||||
/// </summary>
|
||||
private static T? command;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a shared command instance.
|
||||
/// </summary>
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
if (command == null) command = new T();
|
||||
return command;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fires when changes occur that affect whether
|
||||
/// or not the command should execute.
|
||||
/// </summary>
|
||||
public event EventHandler CanExecuteChanged
|
||||
{
|
||||
add { CommandManager.RequerySuggested += value; }
|
||||
remove { CommandManager.RequerySuggested -= value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines the method to be called when the command is invoked.
|
||||
/// </summary>
|
||||
/// <param name="parameter">Data used by the command.
|
||||
/// If the command does not require data to be passed,
|
||||
/// this object can be set to null.
|
||||
/// </param>
|
||||
public abstract void Execute(object parameter);
|
||||
|
||||
/// <summary>
|
||||
/// Defines the method that determines whether the command
|
||||
/// can execute in its current state.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// This default implementation always returns true.
|
||||
/// </returns>
|
||||
/// <param name="parameter">Data used by the command.
|
||||
/// If the command does not require data to be passed,
|
||||
/// this object can be set to null.
|
||||
/// </param>
|
||||
public virtual bool CanExecute(object parameter)
|
||||
{
|
||||
return !IsDesignMode;
|
||||
}
|
||||
|
||||
|
||||
public static bool IsDesignMode
|
||||
{
|
||||
get
|
||||
{
|
||||
return (bool)
|
||||
DependencyPropertyDescriptor.FromProperty(DesignerProperties.IsInDesignModeProperty,
|
||||
typeof(FrameworkElement))
|
||||
.Metadata.DefaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the window that owns the TaskbarIcon class.
|
||||
/// </summary>
|
||||
/// <param name="commandParameter"></param>
|
||||
/// <returns>Window</returns>
|
||||
protected Window? GetTaskbarWindow(object commandParameter)
|
||||
{
|
||||
if (IsDesignMode)
|
||||
return null;
|
||||
|
||||
// get the showcase window off the taskbar icon
|
||||
var tb = commandParameter as TaskbarIcon;
|
||||
return tb == null ? null : TryFindParent<Window>(tb);
|
||||
}
|
||||
|
||||
#region TryFindParent helper
|
||||
|
||||
/// <summary>
|
||||
/// Finds a parent of a given item on the visual tree.
|
||||
/// </summary>
|
||||
/// <typeparam name="TParent">The type of the queried item.</typeparam>
|
||||
/// <param name="child">A direct or indirect child of the
|
||||
/// queried item.</param>
|
||||
/// <returns>The first parent item that matches the submitted
|
||||
/// type parameter. If not matching item can be found, a null
|
||||
/// reference is being returned.</returns>
|
||||
public static TParent? TryFindParent<TParent>(DependencyObject child) where TParent : DependencyObject
|
||||
{
|
||||
//get parent item
|
||||
DependencyObject parentObject = GetParentObject(child);
|
||||
|
||||
//we've reached the end of the tree
|
||||
if (parentObject == null) return null;
|
||||
|
||||
//check if the parent matches the type we're looking for
|
||||
if (parentObject is TParent parent)
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
//use recursion to proceed with next level
|
||||
return TryFindParent<TParent>(parentObject);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This method is an alternative to WPF's
|
||||
/// <see cref="VisualTreeHelper.GetParent"/> method, which also
|
||||
/// supports content elements. Keep in mind that for content element,
|
||||
/// this method falls back to the logical tree of the element!
|
||||
/// </summary>
|
||||
/// <param name="child">The item to be processed.</param>
|
||||
/// <returns>The submitted item's parent, if available. Otherwise
|
||||
/// null.</returns>
|
||||
public static DependencyObject? GetParentObject(DependencyObject child)
|
||||
{
|
||||
if (child == null) return null;
|
||||
|
||||
if (child is ContentElement contentElement)
|
||||
{
|
||||
DependencyObject parent = ContentOperations.GetParent(contentElement);
|
||||
if (parent != null) return parent;
|
||||
|
||||
FrameworkContentElement? fce = contentElement as FrameworkContentElement;
|
||||
return fce?.Parent;
|
||||
}
|
||||
|
||||
//if it's not a ContentElement, rely on VisualTreeHelper
|
||||
return VisualTreeHelper.GetParent(child);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
20
FSI.BT.Tools/Commands/ExitCommand.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class ExitCommand : CommandBase<ExitCommand>
|
||||
{
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
29
FSI.BT.Tools/Commands/LoginCommand.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class LoginCommand : CommandBase<LoginCommand>
|
||||
{
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
Lib.Guis.AutoPw.FrmMain frmMain = new()
|
||||
{
|
||||
CloseAtLostFocus = true,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
frmMain.ShowDialog();
|
||||
|
||||
Global.UserRights =
|
||||
Global.AdminRights = frmMain.PwOk;
|
||||
}
|
||||
|
||||
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
313
FSI.BT.Tools/Commands/OpenAppCommand.cs
Normal file
@@ -0,0 +1,313 @@
|
||||
using FSI.Lib;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class OpenAppCommand : CommandBase<OpenAppCommand>
|
||||
{
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
string[] files = new string[] { };
|
||||
string[] pathes = new string[] { };
|
||||
string arguments = string.Empty;
|
||||
|
||||
switch ((string)parameter)
|
||||
{
|
||||
case "SimaticManager":
|
||||
files = Global.Settings.Apps.SieSimaticManagerExe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv13":
|
||||
files = Global.Settings.Apps.SieTiaV13Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv14":
|
||||
files = Global.Settings.Apps.SieTiaV14Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv15":
|
||||
files = Global.Settings.Apps.SieTiaV15Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv16":
|
||||
files = Global.Settings.Apps.SieTiaV16Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv17":
|
||||
files = Global.Settings.Apps.SieTiaV17Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "Starter":
|
||||
files = Global.Settings.Apps.SieTiaVStarterExe.Split(";");
|
||||
break;
|
||||
|
||||
case "Epl":
|
||||
files = Global.Settings.Apps.Epl.Exe.Split(";");
|
||||
arguments = Global.Settings.Apps.Epl.Arguments;
|
||||
break;
|
||||
|
||||
case "EplPrj":
|
||||
Lib.Guis.Prj.Mgt.FrmMain frmMainEplPrj = new()
|
||||
{
|
||||
ShowPdf = false,
|
||||
CloseAtLostFocus = true,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
frmMainEplPrj.Show();
|
||||
return;
|
||||
|
||||
case "EplPdf":
|
||||
Lib.Guis.Prj.Mgt.FrmMain frmMainEplPdf = new()
|
||||
{
|
||||
ShowPdf = true,
|
||||
CloseAtLostFocus = true,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
frmMainEplPdf.Show();
|
||||
return;
|
||||
|
||||
case "EplPdfMgt":
|
||||
Lib.Guis.Pdf.Mgt.FrmMain frmMainEplPdfMgt = new()
|
||||
{
|
||||
CloseAtLostFocus = true
|
||||
};
|
||||
frmMainEplPdfMgt.Show();
|
||||
return;
|
||||
|
||||
case "Npp":
|
||||
files = Global.Settings.Apps.NppExe.Split(";");
|
||||
break;
|
||||
|
||||
case "TotalCmd":
|
||||
files = Global.Settings.Apps.TotalCmdExe.Split(";");
|
||||
break;
|
||||
|
||||
case "TeXstudio":
|
||||
files = Global.Settings.Apps.TeXstudioExe.Split(";");
|
||||
pathes = Global.Settings.Apps.TeXstudioPath.Split(";");
|
||||
break;
|
||||
|
||||
case "VS":
|
||||
files = Global.Settings.Apps.VsExe.Split(";");
|
||||
break;
|
||||
|
||||
case "VS.Code":
|
||||
files = Global.Settings.Apps.VsCodeExe.Split(";");
|
||||
break;
|
||||
|
||||
|
||||
case "Rdp":
|
||||
files = Global.Settings.Apps.RdpExe.Split(";"); ;
|
||||
break;
|
||||
|
||||
case "DeEncrypt":
|
||||
Lib.Guis.DeEncryptMessage.FrmMain frmMainDeEnCrypt = new()
|
||||
{
|
||||
Password = Global.Settings.General.DeEnCryptPasswort,
|
||||
CloseAtLostFocus = true,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
};
|
||||
frmMainDeEnCrypt.Show();
|
||||
return;
|
||||
|
||||
case "StarterCsvExporter":
|
||||
Lib.Guis.SieStarterCsvExporter.FrmMain frmMain = new();
|
||||
frmMain.Show();
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
string fileName = string.Empty;
|
||||
string path = string.Empty;
|
||||
|
||||
for (int i = 0; i <= files.Length - 1; i++)
|
||||
{
|
||||
if (File.Exists(Environment.ExpandEnvironmentVariables(files[i].Trim())))
|
||||
{
|
||||
fileName = Environment.ExpandEnvironmentVariables(files[i].Trim());
|
||||
}
|
||||
|
||||
if (pathes.Length == 0)
|
||||
{
|
||||
path = Path.GetDirectoryName(fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
path = Environment.ExpandEnvironmentVariables(pathes[i].Trim());
|
||||
}
|
||||
}
|
||||
|
||||
if (ProgramIsRunning(fileName))
|
||||
{
|
||||
ProgramToFront(fileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Process process = new();
|
||||
process.StartInfo.FileName = fileName;
|
||||
process.StartInfo.WorkingDirectory = path;
|
||||
process.StartInfo.Arguments = arguments;
|
||||
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
}
|
||||
catch (System.ComponentModel.Win32Exception ex) when (ex.NativeErrorCode == 740)
|
||||
{
|
||||
try
|
||||
{
|
||||
process.StartInfo.UseShellExecute = true;
|
||||
process.StartInfo.Verb = "runas";
|
||||
process.Start();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
string[] files = new string[] { };
|
||||
switch ((string)parameter)
|
||||
{
|
||||
case "SimaticManager":
|
||||
files = Global.Settings.Apps.SieSimaticManagerExe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv13":
|
||||
files = Global.Settings.Apps.SieTiaV13Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv14":
|
||||
files = Global.Settings.Apps.SieTiaV14Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv15":
|
||||
files = Global.Settings.Apps.SieTiaV15Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv16":
|
||||
files = Global.Settings.Apps.SieTiaV16Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "TIAv17":
|
||||
files = Global.Settings.Apps.SieTiaV17Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "Starter":
|
||||
files = Global.Settings.Apps.SieTiaVStarterExe.Split(";");
|
||||
break;
|
||||
|
||||
case "Epl":
|
||||
files = Global.Settings.Apps.Epl.Exe.Split(";");
|
||||
break;
|
||||
|
||||
case "EplPrj":
|
||||
return true;
|
||||
|
||||
case "EplPdf":
|
||||
return true;
|
||||
|
||||
case "EplPdfMgt":
|
||||
return Global.AdminRights;
|
||||
|
||||
case "Npp":
|
||||
files = Global.Settings.Apps.NppExe.Split(";");
|
||||
break;
|
||||
|
||||
case "TotalCmd":
|
||||
files = Global.Settings.Apps.TotalCmdExe.Split(";");
|
||||
break;
|
||||
|
||||
case "TeXstudio":
|
||||
files = Global.Settings.Apps.TeXstudioExe.Split(";");
|
||||
break;
|
||||
|
||||
case "VS":
|
||||
files = Global.Settings.Apps.VsExe.Split(";");
|
||||
break;
|
||||
|
||||
case "VS.Code":
|
||||
files = Global.Settings.Apps.VsCodeExe.Split(";");
|
||||
break;
|
||||
|
||||
case "Rdp":
|
||||
files = Global.Settings.Apps.RdpExe.Split(";"); ;
|
||||
break;
|
||||
|
||||
case "DeEncrypt":
|
||||
return Global.AdminRights;
|
||||
|
||||
case "StarterCsvExporter":
|
||||
return Global.AdminRights;
|
||||
default: return false;
|
||||
|
||||
}
|
||||
|
||||
foreach (string file in files)
|
||||
{
|
||||
if (File.Exists(Environment.ExpandEnvironmentVariables(file.Trim())))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool ProgramIsRunning(string FullPath)
|
||||
{
|
||||
string FilePath = Path.GetDirectoryName(FullPath);
|
||||
string FileName = Path.GetFileNameWithoutExtension(FullPath).ToLower();
|
||||
bool isRunning = false;
|
||||
|
||||
Process[] pList = Process.GetProcessesByName(FileName);
|
||||
|
||||
foreach (Process p in pList)
|
||||
{
|
||||
if (p.MainModule.FileName.StartsWith(FilePath, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
isRunning = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return isRunning;
|
||||
}
|
||||
|
||||
[System.Runtime.InteropServices.DllImport("User32.dll")]
|
||||
private static extern bool SetForegroundWindow(IntPtr handle);
|
||||
[System.Runtime.InteropServices.DllImport("User32.dll")]
|
||||
private static extern bool ShowWindow(IntPtr handle, int nCmdShow);
|
||||
[System.Runtime.InteropServices.DllImport("User32.dll")]
|
||||
private static extern bool IsIconic(IntPtr handle);
|
||||
|
||||
private void ProgramToFront(string FullPath)
|
||||
{
|
||||
string FilePath = Path.GetDirectoryName(FullPath);
|
||||
string FileName = Path.GetFileNameWithoutExtension(FullPath).ToLower();
|
||||
|
||||
Process[] pList = Process.GetProcessesByName(FileName);
|
||||
|
||||
foreach (Process p in pList)
|
||||
{
|
||||
if (p.MainModule.FileName.StartsWith(FilePath, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
IntPtr handle = p.MainWindowHandle;
|
||||
if (IsIconic(handle))
|
||||
{
|
||||
ShowWindow(handle, 9);
|
||||
}
|
||||
SetForegroundWindow(handle);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
79
FSI.BT.Tools/Commands/OpenLinkCommand.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using FSI.Lib;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class OpenLinkCommand : CommandBase<OpenLinkCommand>
|
||||
{
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
string url = String.Empty;
|
||||
|
||||
switch ((string)parameter)
|
||||
{
|
||||
case "ZentralWeb":
|
||||
url = Global.Settings.Urls.ZentralWeb;
|
||||
break;
|
||||
|
||||
case "Schichtbuch":
|
||||
url = Global.Settings.Urls.Schichtbuch;
|
||||
break;
|
||||
|
||||
case "SPS":
|
||||
url = Global.Settings.Urls.SPS;
|
||||
break;
|
||||
|
||||
case "PL1.Pls":
|
||||
url = Global.Settings.Urls.Pl1Pls;
|
||||
break;
|
||||
|
||||
case "PL2.Pls":
|
||||
url = Global.Settings.Urls.Pl2Pls;
|
||||
break;
|
||||
|
||||
case "PL2.Als":
|
||||
url = Global.Settings.Urls.Pl2Als;
|
||||
break;
|
||||
|
||||
case "PL3.Pls":
|
||||
url = Global.Settings.Urls.Pl3Pls;
|
||||
break;
|
||||
|
||||
case "FSI.Gitea":
|
||||
url = Global.Settings.Urls.Gitea;
|
||||
break;
|
||||
|
||||
case "FSI.Wiki":
|
||||
url = Global.Settings.Urls.Wiki;
|
||||
break;
|
||||
|
||||
case "Erp":
|
||||
url = Global.Settings.Urls.Erp;
|
||||
break;
|
||||
}
|
||||
|
||||
url = url.Replace("&", "^&");
|
||||
Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
|
||||
}
|
||||
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
string url = String.Empty;
|
||||
switch ((string)parameter)
|
||||
{
|
||||
case "FSI.Gitea":
|
||||
return Global.AdminRights;
|
||||
|
||||
case "FSI.Wiki":
|
||||
return Global.AdminRights;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
37
FSI.BT.Tools/Commands/RadialMenuCommand.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using FSI.Lib.Wpf.ExtensionMethods;
|
||||
using System.Windows;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class RadialMenuCommand : CommandBase<RadialMenuCommand>
|
||||
{
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
if (Global.FrmRadialMenu.Visibility == Visibility.Collapsed)
|
||||
{
|
||||
Global.FrmRadialMenu.ShowCenteredToMouse();
|
||||
Global.FrmRadialMenu.ActivateCenteredToMouse();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Global.FrmRadialMenu.Visibility == Visibility.Hidden)
|
||||
{
|
||||
Global.FrmRadialMenu.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.FrmRadialMenu.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
Global.FrmRadialMenu.ActivateCenteredToMouse();
|
||||
}
|
||||
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
return Global.AdminRights || Global.UserRights;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
FSI.BT.Tools/Commands/TimeStampToClipboardCommand.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Windows.Controls.Primitives;
|
||||
|
||||
namespace FSI.BT.Tools.Commands
|
||||
{
|
||||
/// <summary>
|
||||
/// Shows the main window.
|
||||
/// </summary>
|
||||
public class TimeStampToClipboardCommand : CommandBase<TimeStampToClipboardCommand>
|
||||
{
|
||||
public override void Execute(object parameter)
|
||||
{
|
||||
System.Windows.Forms.Clipboard.SetDataObject(Global.Settings.General.TimeStampFormat);
|
||||
var balloon = new ToolTip()
|
||||
{
|
||||
BalloonText = "Zeitstempel",
|
||||
BalloonDesc = "Der aktuelle Zeitstempel wurde in die Zwischenablage kopiert."
|
||||
};
|
||||
Global.TaskbarIcon.ShowCustomBalloon(balloon, PopupAnimation.Slide, 2000);
|
||||
}
|
||||
|
||||
public override bool CanExecute(object parameter)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
57
FSI.BT.Tools/FSI.BT.Tools.csproj
Normal file
@@ -0,0 +1,57 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFrameworks>net6.0-windows</TargetFrameworks>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<ApplicationIcon>Icons\FondiumU.ico</ApplicationIcon>
|
||||
<AssemblyVersion>0.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Icons\Erp.png" />
|
||||
<None Remove="Icons\Plc.jpg" />
|
||||
<None Remove="Icons\Rdp.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FSI.Lib\FSI.Lib\FSI.Lib.csproj" />
|
||||
<ProjectReference Include="..\NHotkey\NHotkey.Wpf\NHotkey.Wpf.csproj" />
|
||||
<ProjectReference Include="..\NotifyIconWpf\NotifyIconWpf\NotifyIconWpf.csproj" />
|
||||
<ProjectReference Include="..\RadialMenu\RadialMenu.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Icons\1087815.png" />
|
||||
<Resource Include="Icons\Circuit.png" />
|
||||
<Resource Include="Icons\Close.png" />
|
||||
<Resource Include="Icons\Crypt.jpg" />
|
||||
<Resource Include="Icons\EplP8.png" />
|
||||
<Resource Include="Icons\Erp.png" />
|
||||
<Resource Include="Icons\FondiumU.ico" />
|
||||
<Resource Include="Icons\FU.png" />
|
||||
<Resource Include="Icons\Gitea.png" />
|
||||
<Resource Include="Icons\Info.png" />
|
||||
<Resource Include="Icons\Links.png" />
|
||||
<Resource Include="Icons\NPP.png" />
|
||||
<Resource Include="Icons\Pdf.png" />
|
||||
<Resource Include="Icons\Plc.jpg" />
|
||||
<Resource Include="Icons\Rdp.png" />
|
||||
<Resource Include="Icons\SIE.png" />
|
||||
<Resource Include="Icons\STEP7.png" />
|
||||
<Resource Include="Icons\TIAv13.jpg" />
|
||||
<Resource Include="Icons\TIAv14.jpg" />
|
||||
<Resource Include="Icons\TIAv15.jpg" />
|
||||
<Resource Include="Icons\TIAv16.jpg" />
|
||||
<Resource Include="Icons\TIAv17.jpg" />
|
||||
<Resource Include="Icons\Tools.png" />
|
||||
<Resource Include="Icons\TotalCmd.jfif" />
|
||||
<Resource Include="Icons\Vs.png" />
|
||||
<Resource Include="Icons\VsCode.png" />
|
||||
<Resource Include="Icons\TeXstudio.png" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
724
FSI.BT.Tools/FrmRadialMenu.xaml
Normal file
@@ -0,0 +1,724 @@
|
||||
<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:RadialMenu="clr-namespace:RadialMenu.Controls;assembly=RadialMenu"
|
||||
xmlns:commands="clr-namespace:FSI.BT.Tools.Commands"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStyle="None"
|
||||
ShowInTaskbar="False"
|
||||
AllowsTransparency="True"
|
||||
Background="Transparent"
|
||||
Deactivated="Window_Deactivated">
|
||||
|
||||
<Window.Resources>
|
||||
<ResourceDictionary Source="Utils/Icons.xaml" />
|
||||
</Window.Resources>
|
||||
|
||||
<Canvas Name="cnvMain"
|
||||
Height="300"
|
||||
Width="300">
|
||||
|
||||
<!-- Draws a circle with a blue interior. -->
|
||||
<Ellipse Width="{Binding ElementName=cnvMain,
|
||||
Path=ActualWidth}"
|
||||
Height="300"
|
||||
Fill="WhiteSmoke"
|
||||
Canvas.Left="0"
|
||||
Canvas.Top="0">
|
||||
</Ellipse>
|
||||
|
||||
<Grid>
|
||||
<StackPanel HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center">
|
||||
|
||||
<TextBlock x:Name="tbversion"
|
||||
Margin="0 38 0 0"
|
||||
FontSize="10" />
|
||||
</StackPanel>
|
||||
|
||||
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenHome}">
|
||||
|
||||
<RadialMenu:RadialMenu.CentralItem>
|
||||
<RadialMenu:RadialMenuCentralItem Command="{Binding CloseRadialMenuHome}" >
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</RadialMenu:RadialMenuCentralItem>
|
||||
</RadialMenu:RadialMenu.CentralItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{Binding OpenRadialMenuEpl}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="40"
|
||||
Height="40">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/EplP8.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Eplan
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{Binding OpenRadialMenuTools}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="40"
|
||||
Height="40">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Tools.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Tools
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{Binding OpenRadialMenuSie}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="40"
|
||||
Height="40">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/SIE.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Siemens
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TotalCmd"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="35"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TotalCmd.jfif" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Total CMD
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="Npp"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="35"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/NPP.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Notepad++
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{Binding OpenRadialMenuLinks}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="35"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Links
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
</RadialMenu:RadialMenu>
|
||||
|
||||
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenEpl}">
|
||||
|
||||
<RadialMenu:RadialMenu.CentralItem>
|
||||
<RadialMenu:RadialMenuCentralItem Command="{Binding OpenRadialMenuHome}">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</RadialMenu:RadialMenuCentralItem>
|
||||
</RadialMenu:RadialMenu.CentralItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="Epl"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/EplP8.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Eplan
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="EplPrj"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="35"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/1087815.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Projekt-Auswahl
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="EplPdf"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="35"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Circuit.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
PDF-Auswahl
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{Binding OpenEplPdfMgt}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="35"
|
||||
Height="35">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Pdf.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
PDF-Mgt.
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
</RadialMenu:RadialMenu>
|
||||
|
||||
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenTools}">
|
||||
|
||||
<RadialMenu:RadialMenu.CentralItem>
|
||||
<RadialMenu:RadialMenuCentralItem Command="{Binding OpenRadialMenuHome}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</RadialMenu:RadialMenuCentralItem>
|
||||
</RadialMenu:RadialMenu.CentralItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="DeEncrypt"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="40"
|
||||
Height="40">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Crypt.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Ver-/<LineBreak />Entschlüsseln
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="Rdp"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Rdp.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Remote<LineBreak />Desktop
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="VS"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Vs.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Visual Studio
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="VS.Code"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/VsCode.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Visual Studio<LineBreak />Code
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TeXstudio"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TeXstudio.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
TeXstudio
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="StarterCsvExporter"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="40"
|
||||
Height="40">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FU.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Starter<LineBreak />CSV-Exporter
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
</RadialMenu:RadialMenu>
|
||||
|
||||
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenSie}">
|
||||
|
||||
<RadialMenu:RadialMenu.CentralItem>
|
||||
<RadialMenu:RadialMenuCentralItem Command="{Binding OpenRadialMenuHome}">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</RadialMenu:RadialMenuCentralItem>
|
||||
</RadialMenu:RadialMenu.CentralItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="SimaticManager"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/STEP7.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Step 7<LineBreak />Classic
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TIAv13"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TIAv13.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
TIA V13
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TIAv14"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TIAv14.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
TIA V14
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TIAv15"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TIAv15.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
TIA V15
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TIAv16"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TIAv16.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
TIA V16
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="TIAv17"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/TIAv17.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
TIA V17
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenAppCommand}"
|
||||
CommandParameter="Starter"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="50"
|
||||
Height="50">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FU.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Starter
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
</RadialMenu:RadialMenu>
|
||||
|
||||
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenLinks}">
|
||||
|
||||
<RadialMenu:RadialMenu.CentralItem>
|
||||
<RadialMenu:RadialMenuCentralItem Command="{Binding OpenRadialMenuHome}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</RadialMenu:RadialMenuCentralItem>
|
||||
</RadialMenu:RadialMenu.CentralItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{Binding OpenRadialMenuPlantLinks}"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Anlagen<LineBreak />Links
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="Erp"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Erp.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Infor
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="ZentralWeb"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Zentraler<LineBreak />Webserver
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="Schichtbuch"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Schichtbuch
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="SPS"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Plc.jpg" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
SPS<LineBreak />Änderungen
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="FSI.Gitea"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Gitea.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
FSI<LineBreak />Gitea
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="FSI.Wiki"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
FSI<LineBreak />Wikipedia
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
</RadialMenu:RadialMenu>
|
||||
|
||||
<RadialMenu:RadialMenu IsOpen="{Binding IsOpenPlantLinks}">
|
||||
|
||||
<RadialMenu:RadialMenu.CentralItem>
|
||||
<RadialMenu:RadialMenuCentralItem Command="{Binding OpenRadialMenuLinks}">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/FondiumU.ico" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
</RadialMenu:RadialMenuCentralItem>
|
||||
</RadialMenu:RadialMenu.CentralItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="ZentralWeb"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
Zentraler<LineBreak />Webserver
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="PL1.PLS"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
PL1 PLS
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="PL2.PLS"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
PL2 PLS
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="PL2.Als"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
PL2 ALS
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
<RadialMenu:RadialMenuItem Command="{commands:OpenLinkCommand}"
|
||||
CommandParameter="PL3.Pls"
|
||||
Click="RadialMenuItem_Click">
|
||||
<WrapPanel Orientation="Vertical">
|
||||
<Rectangle Width="30"
|
||||
Height="30">
|
||||
<Rectangle.Fill>
|
||||
<ImageBrush ImageSource="../../Icons/Links.png" />
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<TextBlock FontSize="14"
|
||||
TextAlignment="Center">
|
||||
PL3 PLS
|
||||
</TextBlock>
|
||||
</WrapPanel>
|
||||
</RadialMenu:RadialMenuItem>
|
||||
|
||||
</RadialMenu:RadialMenu>
|
||||
|
||||
</Grid>
|
||||
</Canvas>
|
||||
|
||||
</Window>
|
||||
266
FSI.BT.Tools/FrmRadialMenu.xaml.cs
Normal file
@@ -0,0 +1,266 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace FSI.BT.Tools
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class FrmRadialMenu : Window, INotifyPropertyChanged
|
||||
{
|
||||
|
||||
public FrmRadialMenu()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = this;
|
||||
_isOpenHome = true;
|
||||
tbversion.Text = "v" + Assembly.GetExecutingAssembly().GetName().Version.Major + "." + Assembly.GetExecutingAssembly().GetName().Version.Minor;
|
||||
}
|
||||
|
||||
#region Home
|
||||
private bool _isOpenHome = true;
|
||||
public bool IsOpenHome
|
||||
{
|
||||
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 =
|
||||
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;
|
||||
IsOpenLinks = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
void RaisePropertyChanged([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
private void Window_Deactivated(object sender, EventArgs e)
|
||||
{
|
||||
Visibility = Visibility.Hidden;
|
||||
|
||||
IsOpenHome = true;
|
||||
IsOpenEpl =
|
||||
IsOpenTools =
|
||||
IsOpenSie =
|
||||
IsOpenLinks =
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
179
FSI.BT.Tools/Global.cs
Normal file
@@ -0,0 +1,179 @@
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace FSI.BT.Tools
|
||||
{
|
||||
internal static class Global
|
||||
{
|
||||
|
||||
public static FrmRadialMenu? FrmRadialMenu { get; set; }
|
||||
|
||||
public static TaskbarIcon? TaskbarIcon { 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<string>("DeEnCryptPasswort", Lib.Settings.Mode.ExeSetttings);
|
||||
}
|
||||
}
|
||||
public static string TimeStampFormat
|
||||
{
|
||||
get
|
||||
{
|
||||
return FSI.Lib.Settings.Setting<string>("TimeStamp.Format", Lib.Settings.Mode.ExeSetttings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class Apps
|
||||
{
|
||||
public static string SieSimaticManagerExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.Simatic.Manager.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SieTiaV13Exe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.TIA.V13.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SieTiaV14Exe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.TIA.V14.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SieTiaV15Exe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.TIA.V15.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SieTiaV16Exe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.TIA.V16.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SieTiaV17Exe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.TIA.V17.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SieTiaVStarterExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SIE.Starter.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static class Epl
|
||||
{
|
||||
public static string Exe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("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<string>("Npp.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string TotalCmdExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("TotalCmd.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string TeXstudioExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("TeXstudio.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string TeXstudioPath
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("TeXstudio.Path", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string VsExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("VS.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
|
||||
public static string VsCodeExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("VS.Code.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
|
||||
public static string RdpExe
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("Rdp.Exe", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Urls
|
||||
{
|
||||
public static string ZentralWeb
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("ZentralWeb.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Schichtbuch
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("Schichtbuch.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string SPS
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("SPS.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Pl1Pls
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("PL1.Pls.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Pl2Pls
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("PL2.Pls.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Pl2Als
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("PL2.Als.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Pl3Pls
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("PL3.Pls.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
public static string Gitea
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("FSI.Gitea.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Wiki
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("FSI.Gitea.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
|
||||
public static string Erp
|
||||
{
|
||||
get { return FSI.Lib.Settings.Setting<string>("Erp.Url", FSI.Lib.Settings.Mode.ExeSetttings); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
FSI.BT.Tools/Icons/1087815.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
FSI.BT.Tools/Icons/Circuit.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
FSI.BT.Tools/Icons/Close.png
Normal file
|
After Width: | Height: | Size: 667 B |
BIN
FSI.BT.Tools/Icons/Crypt.jpg
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
FSI.BT.Tools/Icons/EplP8.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
FSI.BT.Tools/Icons/Erp.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
FSI.BT.Tools/Icons/FU.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
FSI.BT.Tools/Icons/FondiumU.ico
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
FSI.BT.Tools/Icons/Gitea.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
FSI.BT.Tools/Icons/Info.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
FSI.BT.Tools/Icons/Links.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
FSI.BT.Tools/Icons/NPP.png
Normal file
|
After Width: | Height: | Size: 74 KiB |
BIN
FSI.BT.Tools/Icons/Pdf.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
FSI.BT.Tools/Icons/Plc.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
FSI.BT.Tools/Icons/Rdp.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
FSI.BT.Tools/Icons/SIE.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
FSI.BT.Tools/Icons/STEP7.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
FSI.BT.Tools/Icons/TIAv13.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
FSI.BT.Tools/Icons/TIAv14.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
FSI.BT.Tools/Icons/TIAv15.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
FSI.BT.Tools/Icons/TIAv16.jpg
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
FSI.BT.Tools/Icons/TIAv17.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
FSI.BT.Tools/Icons/TeXstudio.png
Normal file
|
After Width: | Height: | Size: 72 KiB |
BIN
FSI.BT.Tools/Icons/Tools.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
FSI.BT.Tools/Icons/TotalCmd.jfif
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
FSI.BT.Tools/Icons/Vs.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
FSI.BT.Tools/Icons/VsCode.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
31
FSI.BT.Tools/NotifyIconResources.xaml
Normal file
@@ -0,0 +1,31 @@
|
||||
<ResourceDictionary 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"
|
||||
xmlns:commands="clr-namespace:FSI.BT.Tools.Commands">
|
||||
<LinearGradientBrush x:Key="MenuBackground"
|
||||
EndPoint="0.5,1"
|
||||
StartPoint="0.5,0">
|
||||
<GradientStop Color="#FFFFD892"
|
||||
Offset="1" />
|
||||
<GradientStop Color="#FFFFF3DD"
|
||||
Offset="0.259" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<tb:TaskbarIcon x:Key="FSINotifyIcon"
|
||||
Visibility="Visible"
|
||||
ToolTipText="FSI Tools"
|
||||
IconSource="/Icons/FondiumU.ico"
|
||||
MenuActivation="RightClick"
|
||||
DoubleClickCommand="{commands:LoginCommand}"
|
||||
LeftClickCommand="{commands:TimeStampToClipboardCommand}">
|
||||
|
||||
<tb:TaskbarIcon.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Beenden"
|
||||
Command="{commands:ExitCommand}"/>
|
||||
</ContextMenu>
|
||||
</tb:TaskbarIcon.ContextMenu>
|
||||
|
||||
</tb:TaskbarIcon>
|
||||
|
||||
</ResourceDictionary>
|
||||
46
FSI.BT.Tools/RelayCommand.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace FSI.BT.Tools
|
||||
{
|
||||
public class RelayCommand : ICommand
|
||||
{
|
||||
private Action action;
|
||||
|
||||
private Func<bool> condition;
|
||||
|
||||
public event EventHandler CanExecuteChanged
|
||||
{
|
||||
add { CommandManager.RequerySuggested += value; }
|
||||
remove { CommandManager.RequerySuggested -= value; }
|
||||
}
|
||||
|
||||
public RelayCommand(Action action)
|
||||
{
|
||||
this.action = action;
|
||||
condition = () => true;
|
||||
}
|
||||
|
||||
public RelayCommand(Action action, bool condition)
|
||||
{
|
||||
this.action = action;
|
||||
this.condition = () => condition;
|
||||
}
|
||||
|
||||
public RelayCommand(Action action, Func<bool> condition)
|
||||
{
|
||||
this.action = action;
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
return condition.Invoke();
|
||||
}
|
||||
|
||||
void ICommand.Execute(object parameter)
|
||||
{
|
||||
action.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
158
FSI.BT.Tools/ToolTip.xaml
Normal file
@@ -0,0 +1,158 @@
|
||||
<UserControl x:Class="FSI.BT.Tools.ToolTip"
|
||||
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"
|
||||
x:Name="me"
|
||||
Height="120"
|
||||
Width="240">
|
||||
<UserControl.Resources>
|
||||
<Storyboard x:Key="FadeIn">
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||
Storyboard.TargetName="grid"
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||
Value="0" />
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:01"
|
||||
Value="0.95" />
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:03"
|
||||
Value="0.95" />
|
||||
<!-- <SplineDoubleKeyFrame KeyTime="00:00:05" Value="0"/>-->
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="HighlightCloseButton">
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||
Storyboard.TargetName="imgClose"
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||
Value="0.4" />
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||
Value="1" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="FadeCloseButton">
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||
Storyboard.TargetName="imgClose"
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||
Value="1" />
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||
Value="0.4" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="FadeBack">
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||
Storyboard.TargetName="grid"
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||
Value="1" />
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||
Value="1" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="FadeOut"
|
||||
Completed="OnFadeOutCompleted">
|
||||
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
||||
Storyboard.TargetName="grid"
|
||||
Storyboard.TargetProperty="(UIElement.Opacity)">
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
||||
Value="1" />
|
||||
<SplineDoubleKeyFrame KeyTime="00:00:00.3000000"
|
||||
Value="0.2" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</UserControl.Resources>
|
||||
<UserControl.Triggers>
|
||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonShowing">
|
||||
<BeginStoryboard Storyboard="{StaticResource FadeIn}"
|
||||
x:Name="FadeIn_BeginStoryboard" />
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="Mouse.MouseEnter"
|
||||
SourceName="imgClose">
|
||||
<BeginStoryboard Storyboard="{StaticResource HighlightCloseButton}"
|
||||
x:Name="HighlightCloseButton_BeginStoryboard" />
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="Mouse.MouseLeave"
|
||||
SourceName="imgClose">
|
||||
<BeginStoryboard Storyboard="{StaticResource FadeCloseButton}"
|
||||
x:Name="FadeCloseButton_BeginStoryboard" />
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="Mouse.MouseEnter">
|
||||
<StopStoryboard BeginStoryboardName="FadeIn_BeginStoryboard" />
|
||||
<BeginStoryboard x:Name="FadeBack_BeginStoryboard1"
|
||||
Storyboard="{StaticResource FadeBack}" />
|
||||
</EventTrigger>
|
||||
<EventTrigger RoutedEvent="tb:TaskbarIcon.BalloonClosing">
|
||||
<BeginStoryboard Storyboard="{StaticResource FadeOut}"
|
||||
x:Name="FadeOut_BeginStoryboard" />
|
||||
</EventTrigger>
|
||||
</UserControl.Triggers>
|
||||
<Grid x:Name="grid"
|
||||
MouseEnter="grid_MouseEnter">
|
||||
<Border HorizontalAlignment="Stretch"
|
||||
Margin="5,5,5,5"
|
||||
BorderThickness="1,1,1,1"
|
||||
BorderBrush="#FF997137">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect Color="#FF747474" />
|
||||
</Border.Effect>
|
||||
<Border.Background>
|
||||
<LinearGradientBrush EndPoint="0.5,1"
|
||||
StartPoint="0.5,0">
|
||||
<GradientStop Color="#FF4B4B4B"
|
||||
Offset="0" />
|
||||
<GradientStop Color="#FF8F8F8F"
|
||||
Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
</Border>
|
||||
<Image HorizontalAlignment="Left"
|
||||
Margin="0,10,0,0"
|
||||
Width="72"
|
||||
Source="/Icons/Info.png"
|
||||
Stretch="Fill"
|
||||
Height="72"
|
||||
VerticalAlignment="Top" />
|
||||
<TextBlock Margin="72,49.2,10,0"
|
||||
VerticalAlignment="Top"
|
||||
Foreground="#FFECAD25"
|
||||
TextWrapping="Wrap">
|
||||
<Run Text="{Binding Path=BalloonDesc, ElementName=me, Mode=Default}" />
|
||||
</TextBlock>
|
||||
<Path Fill="#FFFFFFFF"
|
||||
Stretch="Fill"
|
||||
Margin="72,38.2,34,0"
|
||||
VerticalAlignment="Top"
|
||||
Height="1"
|
||||
Data="M26,107 L220.04123,107"
|
||||
SnapsToDevicePixels="True">
|
||||
<Path.Stroke>
|
||||
<LinearGradientBrush EndPoint="0.973,0.5"
|
||||
StartPoint="0.005,0.5">
|
||||
<GradientStop Color="#00ECAD25"
|
||||
Offset="1" />
|
||||
<GradientStop Color="#87ECAD25"
|
||||
Offset="0" />
|
||||
</LinearGradientBrush>
|
||||
</Path.Stroke>
|
||||
</Path>
|
||||
<TextBlock Margin="72,10,10,0"
|
||||
VerticalAlignment="Top"
|
||||
Height="23.2"
|
||||
Text="{Binding Path=BalloonText, ElementName=me, Mode=Default}"
|
||||
TextWrapping="Wrap"
|
||||
Foreground="#FFECAD25"
|
||||
FontWeight="Bold" />
|
||||
<Image HorizontalAlignment="Right"
|
||||
Margin="0,10,10,0"
|
||||
VerticalAlignment="Top"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Icons/Close.png"
|
||||
Stretch="Fill"
|
||||
Opacity="0.4"
|
||||
ToolTip="Close Balloon"
|
||||
x:Name="imgClose"
|
||||
MouseDown="imgClose_MouseDown" />
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
116
FSI.BT.Tools/ToolTip.xaml.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using Hardcodet.Wpf.TaskbarNotification;
|
||||
|
||||
namespace FSI.BT.Tools
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für ToolTip.xaml
|
||||
/// </summary>
|
||||
public partial class ToolTip : UserControl
|
||||
{
|
||||
private bool isClosing = false;
|
||||
|
||||
#region BalloonText dependency property
|
||||
|
||||
/// <summary>
|
||||
/// Description
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty BalloonTextProperty =
|
||||
DependencyProperty.Register(nameof(BalloonText),
|
||||
typeof(string),
|
||||
typeof(ToolTip),
|
||||
new FrameworkPropertyMetadata(string.Empty));
|
||||
|
||||
/// <summary>
|
||||
/// A property wrapper for the <see cref="BalloonTextProperty"/>
|
||||
/// dependency property:<br/>
|
||||
/// Description
|
||||
/// </summary>
|
||||
public string BalloonText
|
||||
{
|
||||
get { return (string)GetValue(BalloonTextProperty); }
|
||||
set { SetValue(BalloonTextProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Description
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty BalloonDescProperty =
|
||||
DependencyProperty.Register(nameof(BalloonDesc),
|
||||
typeof(string),
|
||||
typeof(ToolTip),
|
||||
new FrameworkPropertyMetadata(string.Empty));
|
||||
|
||||
/// <summary>
|
||||
/// A property wrapper for the <see cref="BalloonDescProperty"/>
|
||||
/// dependency property:<br/>
|
||||
/// Description
|
||||
/// </summary>
|
||||
public string BalloonDesc
|
||||
{
|
||||
get { return (string)GetValue(BalloonDescProperty); }
|
||||
set { SetValue(BalloonDescProperty, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
public ToolTip()
|
||||
{
|
||||
InitializeComponent();
|
||||
TaskbarIcon.AddBalloonClosingHandler(this, OnBalloonClosing);
|
||||
}
|
||||
/// <summary>
|
||||
/// By subscribing to the <see cref="TaskbarIcon.BalloonClosingEvent"/>
|
||||
/// and setting the "Handled" property to true, we suppress the popup
|
||||
/// from being closed in order to display the custom fade-out animation.
|
||||
/// </summary>
|
||||
private void OnBalloonClosing(object sender, RoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true; //suppresses the popup from being closed immediately
|
||||
isClosing = true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Resolves the <see cref="TaskbarIcon"/> that displayed
|
||||
/// the balloon and requests a close action.
|
||||
/// </summary>
|
||||
private void imgClose_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
//the tray icon assigned this attached property to simplify access
|
||||
TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
|
||||
taskbarIcon.CloseBalloon();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the users hovers over the balloon, we don't close it.
|
||||
/// </summary>
|
||||
private void grid_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
//if we're already running the fade-out animation, do not interrupt anymore
|
||||
//(makes things too complicated for the sample)
|
||||
if (isClosing) return;
|
||||
|
||||
//the tray icon assigned this attached property to simplify access
|
||||
TaskbarIcon taskbarIcon = TaskbarIcon.GetParentTaskbarIcon(this);
|
||||
taskbarIcon.ResetBalloonCloseTimer();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the popup once the fade-out animation completed.
|
||||
/// The animation was triggered in XAML through the attached
|
||||
/// BalloonClosing event.
|
||||
/// </summary>
|
||||
private void OnFadeOutCompleted(object sender, EventArgs e)
|
||||
{
|
||||
Popup pp = (Popup)Parent;
|
||||
pp.IsOpen = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||