diff options
Diffstat (limited to 'Software')
13 files changed, 116 insertions, 18 deletions
diff --git a/Software/Graphics/FSE/Installer/procedure_dde.ico b/Software/Graphics/FSE/Installer/procedure_dde.ico Binary files differnew file mode 100644 index 000000000..a14b94f01 --- /dev/null +++ b/Software/Graphics/FSE/Installer/procedure_dde.ico diff --git a/Software/Graphics/FSE/Installer/procedure_dde.png b/Software/Graphics/FSE/Installer/procedure_dde.png Binary files differnew file mode 100644 index 000000000..0f65a3d9d --- /dev/null +++ b/Software/Graphics/FSE/Installer/procedure_dde.png diff --git a/Software/Graphics/FSE/Installer/procedures_dde.ico b/Software/Graphics/FSE/Installer/procedures_dde.ico Binary files differnew file mode 100644 index 000000000..76d4332fe --- /dev/null +++ b/Software/Graphics/FSE/Installer/procedures_dde.ico diff --git a/Software/Graphics/FSE/procedures_dde.png b/Software/Graphics/FSE/procedures_dde.png Binary files differnew file mode 100644 index 000000000..272fbdd89 --- /dev/null +++ b/Software/Graphics/FSE/procedures_dde.png diff --git a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip index aaa691524..4d7250d8e 100644 --- a/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip +++ b/Software/Visual_Studio/Advanced Installer Projects/FSE Installer.aip @@ -267,7 +267,7 @@ <ROW Component="Tango.ColorPicker.dll" ComponentId="{4DC739B9-5960-4CF4-9911-BF25E7CC7308}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.ColorPicker.dll"/> <ROW Component="Tango.Console.dll" ComponentId="{EA15B4D4-5171-4747-8F7D-0D21CF8CAFD3}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Console.dll"/> <ROW Component="Tango.Core.dll" ComponentId="{FEA537DB-7B1F-4B88-940A-9911A4D29057}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Core.dll"/> - <ROW Component="Tango.DAL.Remote.dll" ComponentId="{97065CAF-4EA6-4A2A-B379-98C60649AD7C}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DAL.Remote.dll"/> + <ROW Component="Tango.DAL.Remote.dll" ComponentId="{62700DCA-5334-45BB-9B3F-1E60D8E1CB51}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DAL.Remote.dll"/> <ROW Component="Tango.Documents.dll" ComponentId="{FB9E5160-6481-4879-AFC6-89C3D7E21ED6}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Documents.dll"/> <ROW Component="Tango.DragAndDrop.dll" ComponentId="{E660863F-2225-48FE-B966-E7375A48FBF1}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.DragAndDrop.dll"/> <ROW Component="Tango.Emulations.dll" ComponentId="{87B4BB2B-DA02-47A4-B738-F0D388ED5B03}" Directory_="APPDIR" Attributes="0" KeyPath="Tango.Emulations.dll"/> @@ -314,7 +314,7 @@ <ROW Component="mscoree.dll" ComponentId="{B7304190-8E59-45C3-B972-4611DEB9DE60}" Directory_="APPDIR" Attributes="0" KeyPath="mscoree.dll"/> <ROW Component="msvcp140d.dll" ComponentId="{6B725C2A-71DF-44D3-A761-EB3D28379956}" Directory_="APPDIR" Attributes="0" KeyPath="msvcp140d.dll"/> <ROW Component="netstandard.dll" ComponentId="{27E9F013-8E50-4251-9C63-C53A5AA66DD1}" Directory_="APPDIR" Attributes="0" KeyPath="netstandard.dll"/> - <ROW Component="procdoc.chm" ComponentId="{703F9FB0-FB55-4AA1-8CEE-2EDC59FED36E}" Directory_="APPDIR" Attributes="0" KeyPath="procdoc.chm" Type="1"/> + <ROW Component="procdoc.chm" ComponentId="{A1ADA8CA-C7F6-4C05-BC9A-E2F821E002DC}" Directory_="APPDIR" Attributes="0" KeyPath="procdoc.chm" Type="1"/> <ROW Component="protobufnet.dll" ComponentId="{ED37672F-F343-44FB-8FBD-F9003BD20D52}" Directory_="APPDIR" Attributes="0" KeyPath="protobufnet.dll"/> <ROW Component="turbojpeg.dll" ComponentId="{D884024D-FA37-4526-90AC-37963E621CDB}" Directory_="win7x64_Dir" Attributes="256" KeyPath="turbojpeg.dll"/> <ROW Component="turbojpeg.dll.meta" ComponentId="{F34DC99A-4629-4622-8221-3DDA06EEE754}" Directory_="win7x64_Dir" Attributes="0" KeyPath="turbojpeg.dll.meta" Type="0"/> @@ -652,20 +652,20 @@ <ROW File="Tango.FSE.Procedures.dll.config" Component_="Dragablz.xml" FileName="TANGOF~9.CON|Tango.FSE.Procedures.dll.config" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.Procedures.dll.config" SelfReg="false"/> <ROW File="Tango.FSE.Procedures.pdb" Component_="Tango.FSE.Procedures.dll" FileName="TANGO~11.PDB|Tango.FSE.Procedures.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.Procedures.pdb" SelfReg="false"/> <ROW File="Tango.FSE.Procedures.xml" Component_="Dragablz.xml" FileName="TANGOF~2.XML|Tango.FSE.Procedures.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.Procedures.xml" SelfReg="false"/> - <ROW File="Tango.DAL.Remote.dll" Component_="Tango.DAL.Remote.dll" FileName="TANGOD~1.DLL|Tango.DAL.Remote.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DAL.Remote.dll" SelfReg="false"/> - <ROW File="Tango.DAL.Remote.dll.config" Component_="Dragablz.xml" FileName="TANGOD~1.CON|Tango.DAL.Remote.dll.config" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DAL.Remote.dll.config" SelfReg="false"/> - <ROW File="Tango.DAL.Remote.pdb" Component_="Tango.DAL.Remote.dll" FileName="TANGOD~1.PDB|Tango.DAL.Remote.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DAL.Remote.pdb" SelfReg="false"/> <ROW File="Microsoft.Data.Edm.dll" Component_="Microsoft.Data.Edm.dll" FileName="MICROS~2.DLL|Microsoft.Data.Edm.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Microsoft.Data.Edm.dll" SelfReg="false"/> <ROW File="Microsoft.Data.OData.dll" Component_="Microsoft.Data.OData.dll" FileName="MICRO~21.DLL|Microsoft.Data.OData.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Microsoft.Data.OData.dll" SelfReg="false"/> <ROW File="Microsoft.Data.Services.Client.dll" Component_="Microsoft.Data.Services.Client.dll" FileName="MICRO~24.DLL|Microsoft.Data.Services.Client.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Microsoft.Data.Services.Client.dll" SelfReg="false"/> <ROW File="System.Spatial.dll" Component_="System.Spatial.dll" FileName="SYSTEM~2.DLL|System.Spatial.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\System.Spatial.dll" SelfReg="false"/> - <ROW File="procdoc.chm" Component_="procdoc.chm" FileName="proc-doc.chm" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\proc-doc.chm" SelfReg="false"/> - <ROW File="Tango.FSE.Common.xml" Component_="Dragablz.xml" FileName="TANGOF~1.XML|Tango.FSE.Common.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.Common.xml" SelfReg="false"/> - <ROW File="Tango.PPC.Shared.xml" Component_="Dragablz.xml" FileName="TANGOP~1.XML|Tango.PPC.Shared.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.PPC.Shared.xml" SelfReg="false"/> <ROW File="turbojpeg.dll" Component_="turbojpeg.dll" FileName="TURBOJ~1.DLL|turbojpeg.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x64\turbojpeg.dll" SelfReg="false"/> <ROW File="turbojpeg.dll.meta" Component_="turbojpeg.dll.meta" FileName="TURBOJ~1.MET|turbojpeg.dll.meta" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x64\turbojpeg.dll.meta" SelfReg="false"/> <ROW File="turbojpeg.dll_1" Component_="turbojpeg.dll_1" FileName="TURBOJ~1.DLL|turbojpeg.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x86\turbojpeg.dll" SelfReg="false"/> <ROW File="turbojpeg.dll.meta_1" Component_="turbojpeg.dll.meta_1" FileName="TURBOJ~1.MET|turbojpeg.dll.meta" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\win7-x86\turbojpeg.dll.meta" SelfReg="false"/> + <ROW File="procdoc.chm" Component_="procdoc.chm" FileName="proc-doc.chm" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\proc-doc.chm" SelfReg="false"/> + <ROW File="Tango.DAL.Remote.dll" Component_="Tango.DAL.Remote.dll" FileName="TANGOD~1.DLL|Tango.DAL.Remote.dll" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DAL.Remote.dll" SelfReg="false"/> + <ROW File="Tango.DAL.Remote.dll.config" Component_="Dragablz.xml" FileName="TANGOD~1.CON|Tango.DAL.Remote.dll.config" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DAL.Remote.dll.config" SelfReg="false"/> + <ROW File="Tango.DAL.Remote.pdb" Component_="Tango.DAL.Remote.dll" FileName="TANGOD~1.PDB|Tango.DAL.Remote.pdb" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.DAL.Remote.pdb" SelfReg="false"/> + <ROW File="Tango.FSE.Common.xml" Component_="Dragablz.xml" FileName="TANGOF~1.XML|Tango.FSE.Common.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.FSE.Common.xml" SelfReg="false"/> + <ROW File="Tango.PPC.Shared.xml" Component_="Dragablz.xml" FileName="TANGOP~1.XML|Tango.PPC.Shared.xml" Version="65535.65535.65535.65535" Attributes="0" SourcePath="..\Build\FSE\Release\Tango.PPC.Shared.xml" SelfReg="false"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.AiRemoveFileComponent"> <ROW RemoveFile="_" Options="3"/> @@ -808,6 +808,9 @@ <ROW Action="SET_SHORTCUTDIR" Type="307" Source="SHORTCUTDIR" Target="[ProgramMenuFolder][ProductName]"/> <ROW Action="SET_TARGETDIR_TO_APPDIR" Type="51" Source="TARGETDIR" Target="[APPDIR]"/> </COMPONENT> + <COMPONENT cid="caphyon.advinst.msicomp.MsiExtComponent"> + <ROW Extension="pproj" Component_="Tango.FSE.UI.exe" ProgId_="[|Manufacturer].[|ProductName].ppro" Feature_="TangoFSE" Options="32"/> + </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiFeatCompsComponent"> <ROW Feature_="TangoFSE" Component_="AI_ExePath"/> <ROW Feature_="TangoFSE" Component_="ColorMine.dll"/> @@ -1067,18 +1070,19 @@ <ROW Feature_="TangoFSE" Component_="ffmpeg.exe"/> <ROW Feature_="TangoFSE" Component_="Tango.CSV.dll"/> <ROW Feature_="TangoFSE" Component_="Tango.FSE.Procedures.dll"/> - <ROW Feature_="TangoFSE" Component_="Tango.DAL.Remote.dll"/> <ROW Feature_="TangoFSE" Component_="Microsoft.Data.Edm.dll"/> <ROW Feature_="TangoFSE" Component_="Microsoft.Data.OData.dll"/> <ROW Feature_="TangoFSE" Component_="Microsoft.Data.Services.Client.dll"/> <ROW Feature_="TangoFSE" Component_="System.Spatial.dll"/> - <ROW Feature_="TangoFSE" Component_="procdoc.chm"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll.meta"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll_1"/> <ROW Feature_="TangoFSE" Component_="turbojpeg.dll.meta_1"/> + <ROW Feature_="TangoFSE" Component_="procdoc.chm"/> + <ROW Feature_="TangoFSE" Component_="Tango.DAL.Remote.dll"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent"> + <ROW Name="ext_1.exe" SourcePath="..\..\Graphics\FSE\Installer\procedure_dde.ico" Index="0"/> <ROW Name="machine_full.exe" SourcePath="..\..\Graphics\FSE\Installer\machine_full.ico" Index="0"/> </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiInstExSeqComponent"> @@ -1134,6 +1138,9 @@ <ROW Condition="SETUPEXEDIR OR (REMOVE="ALL")" Description="This package can only be run from a bootstrapper." DescriptionLocId="AI.LaunchCondition.RequireBootstrapper" IsPredefined="true" Builds="DefaultBuild"/> <ROW Condition="VersionNT" Description="[ProductName] cannot be installed on [WindowsType9XDisplay]." DescriptionLocId="AI.LaunchCondition.No9X" IsPredefined="true" Builds="DefaultBuild"/> </COMPONENT> + <COMPONENT cid="caphyon.advinst.msicomp.MsiProgIdComponent"> + <ROW ProgId="[|Manufacturer].[|ProductName].ppro" Description="Tango FSE Procedure" Icon_="ext_1.exe"/> + </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.MsiRegLocatorComponent"> <ROW Signature_="AI_EXE_PATH_CU" Root="1" Key="Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion]" Name="AI_ExePath" Type="2"/> <ROW Signature_="AI_EXE_PATH_LM" Root="2" Key="Software\Caphyon\Advanced Installer\LZMA\[ProductCode]\[ProductVersion]" Name="AI_ExePath" Type="2"/> @@ -1157,6 +1164,9 @@ <ROW UpgradeCode="[|UpgradeCode]" VersionMin="0.0.1" VersionMax="[|ProductVersion]" Attributes="257" ActionProperty="OLDPRODUCTS"/> <ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/> </COMPONENT> + <COMPONENT cid="caphyon.advinst.msicomp.MsiVerbComponent"> + <ROW Extension_="pproj" Component_="Tango.FSE.UI.exe" Verb="open" Sequence="0" Command="&Run Procedure" Argument="-file procedure "%1""/> + </COMPONENT> <COMPONENT cid="caphyon.advinst.msicomp.PreReqComponent"> <ROW PrereqKey="ActiveDirectoryAut" DisplayName="Active Directory Authentication Library for SQL Server" VersionMin="13.0.1300.275" SetupFileUrl="..\Installers\Active Directory Authentication\adalsql.msi" Location="0" ExactSize="0" Operator="1" Options="y" TargetName="adalsql.msi"/> <ROW PrereqKey="BB9062A4604BB61146D7C9AA49D" DisplayName=".NET Framework 4.6.1 (web installer)" SetupFileUrl="http://download.microsoft.com/download/3/5/9/35980F81-60F4-4DE3-88FC-8F962B97253B/NDP461-KB3102438-Web.exe" Location="1" ExactSize="1424328" WinNTVersions="Windows XP SP3 x86, Windows Server 2003 SP2 x86, Windows Vista x86, Windows Server 2008 x86, Windows 7 RTM x86, Windows 10 version 1511 x86, Windows 10 version 1607 x86, Windows 10 version 1703 x86, Windows 10 version 1709 x86, Windows 10 version 1803 x86, Windows 10 version 1809 x86" WinNT64Versions="Windows XP SP2 x64, Windows Server 2003 SP2 x64, Windows Vista x64, Windows Server 2008 x64, Windows 7 RTM x64, Windows Server 2008 R2 RTM x64, Windows 10 version 1511 x64, Windows 10 version 1607 x64, Windows 10 version 1703 x64, Windows 10 version 1709 x64, Windows 10 version 1803 x64, Windows 10 version 1809 x64, Windows Server 2016 x64" Operator="1" NoUiComLine="/q /norestart" Options="xy" MD5="4d1bb86d0eee168e1da91a36350c1c21" TargetName=".NET Framework 4.6.1"/> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm Binary files differindex bbd743180..861555098 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures.Documentation/Help/proc-doc.chm diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ViewModels/ProcedureRunnerViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ViewModels/ProcedureRunnerViewVM.cs index c9c94a9a4..d69ba63f8 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ViewModels/ProcedureRunnerViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Procedures/ViewModels/ProcedureRunnerViewVM.cs @@ -125,6 +125,12 @@ namespace Tango.FSE.Procedures.ViewModels { try { + if (IsRunning) + { + await NotificationProvider.ShowError("Cannot execute a procedure while another procedure is running."); + return; + } + IsRunning = true; FailedError = null; ResultsViewVM.Results = new List<Result>(); @@ -188,14 +194,21 @@ namespace Tango.FSE.Procedures.ViewModels if (_isFromDesigner) { - RunningProcedureProject = _designerProject; - RaisePropertyChanged(nameof(HasProcedureInputs)); - ProjectRunner = new ProjectRunner(RunningProcedureProject); - ProjectRunner.StateChanged += (x, e) => InvalidateRelayCommands(); - Status = "Ready"; - InvalidateRelayCommands(); - SelectedView = RunnerView.ProcedureRunnerExecutionView; - StartProject(); + if (!IsRunning) + { + RunningProcedureProject = _designerProject; + RaisePropertyChanged(nameof(HasProcedureInputs)); + ProjectRunner = new ProjectRunner(RunningProcedureProject); + ProjectRunner.StateChanged += (x, e) => InvalidateRelayCommands(); + Status = "Ready"; + InvalidateRelayCommands(); + SelectedView = RunnerView.ProcedureRunnerExecutionView; + StartProject(); + } + else + { + NotificationProvider.ShowError("Cannot execute a procedure while another procedure is running."); + } } } diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FileAssociation/FileAssociationPackage.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileAssociation/FileAssociationPackage.cs new file mode 100644 index 000000000..106c37f16 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileAssociation/FileAssociationPackage.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.FileAssociation +{ + public class FileAssociationPackage + { + public String File { get; set; } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/FileAssociation/IFileAssociationProvider.cs b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileAssociation/IFileAssociationProvider.cs new file mode 100644 index 000000000..6b4440f41 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/FileAssociation/IFileAssociationProvider.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.FSE.Common.FileAssociation +{ + public interface IFileAssociationProvider + { + void RegisterFileAssociationHandler(String targetName, Action<FileAssociationPackage> handler); + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj index 6c7ffb7ed..0584d2e0b 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Tango.FSE.Common.csproj @@ -179,6 +179,8 @@ <Compile Include="ExtensionMethods\IExternalBridgeClientExtensions.cs" /> <Compile Include="ExtensionMethods\IFSEViewExtensions.cs" /> <Compile Include="ExtensionMethods\ViewModelExtensionMethods.cs" /> + <Compile Include="FileAssociation\FileAssociationPackage.cs" /> + <Compile Include="FileAssociation\IFileAssociationProvider.cs" /> <Compile Include="FileSystem\FileSystemHandler.cs" /> <Compile Include="FileSystem\FileSystemHandlerStatus.cs" /> <Compile Include="FileSystem\FileSystemHandlerType.cs" /> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs index 8f0b97d2b..196978f69 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/App.xaml.cs @@ -33,6 +33,7 @@ namespace Tango.FSE.UI public static bool IsStartedAfterCrash { get; private set; } public static String StartedAfterCrashError { get; private set; } + private static Mutex mutex = new Mutex(true, "{8F6F0AC4-B9A1-45fd-A8CF-72F0TANGOFSE}"); public App() : base() { @@ -50,6 +51,27 @@ namespace Tango.FSE.UI protected override void OnStartup(StartupEventArgs e) { + if (e.Args != null) + { + if (e.Args.Length == 3) + { + if (e.Args[0] == "-file") + { + if (mutex.WaitOne(TimeSpan.Zero, true)) + { + mutex.ReleaseMutex(); + MessageBox.Show($"Run Procedure {e.Args[2]} on this instance."); + } + else + { + MessageBox.Show($"Run Procedure {e.Args[2]} on another instance."); + Environment.Exit(0); + return; + } + } + } + } + //Set culture info. var enUSCulture = new CultureInfo("en-US"); diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationHandler.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationHandler.cs new file mode 100644 index 000000000..88f4fff05 --- /dev/null +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/FileAssociation/DefaultFileAssociationHandler.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.FSE.Common.FileAssociation; + +namespace Tango.FSE.UI.FileAssociation +{ + public class DefaultFileAssociationHandler : IFileAssociationProvider + { + private Dictionary<String, Action<FileAssociationPackage>> _handlers; + + public DefaultFileAssociationHandler() + { + _handlers = new Dictionary<string, Action<FileAssociationPackage>>(); + } + + public void RegisterFileAssociationHandler(string targetName, Action<FileAssociationPackage> handler) + { + _handlers.Add(targetName.ToLower(), handler); + } + } +} diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj index 5c6885c2e..44a163326 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Tango.FSE.UI.csproj @@ -271,6 +271,7 @@ <Compile Include="Dialogs\MachineConnectionSignalRViewVM.cs" /> <Compile Include="Dialogs\MachineConnectionWifiViewVM.cs" /> <Compile Include="Events\DefaultEventsProvider.cs" /> + <Compile Include="FileAssociation\DefaultFileAssociationHandler.cs" /> <Compile Include="FileSystem\DefaultFileSystemProvider.cs" /> <Compile Include="Firmware\DefaultFirmwareStorageProvider.cs" /> <Compile Include="InternalModule.cs" /> |
