mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Got rid of false positive yey
This commit is contained in:
parent
bce85a8e7a
commit
758739ebda
@ -104,7 +104,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
@ -141,24 +141,23 @@
|
|||||||
<HintPath>..\packages\Betwixt.1.4.1\lib\net35\Betwixt.dll</HintPath>
|
<HintPath>..\packages\Betwixt.1.4.1\lib\net35\Betwixt.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Caliburn.Micro, Version=3.0.3.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
<Reference Include="Caliburn.Micro, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Caliburn.Micro.Core.3.1.0\lib\net45\Caliburn.Micro.dll</HintPath>
|
<HintPath>..\packages\Caliburn.Micro.Core.3.2.0\lib\net45\Caliburn.Micro.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Caliburn.Micro.Platform, Version=3.0.3.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
<Reference Include="Caliburn.Micro.Platform, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Caliburn.Micro.3.1.0\lib\net45\Caliburn.Micro.Platform.dll</HintPath>
|
<HintPath>..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Caliburn.Micro.Platform.Core, Version=3.0.3.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
<Reference Include="Caliburn.Micro.Platform.Core, Version=3.2.0.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Caliburn.Micro.3.1.0\lib\net45\Caliburn.Micro.Platform.Core.dll</HintPath>
|
<HintPath>..\packages\Caliburn.Micro.3.2.0\lib\net45\Caliburn.Micro.Platform.Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Corale.Colore, Version=5.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Corale.Colore, Version=5.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Colore.5.1.0\lib\net35\Corale.Colore.dll</HintPath>
|
<HintPath>..\packages\Colore.5.2.0\lib\net35\Corale.Colore.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="CSCore, Version=1.2.1.2, Culture=neutral, PublicKeyToken=5a08f2b6f4415dea, processorArchitecture=MSIL">
|
<Reference Include="CSCore, Version=1.2.1.2, Culture=neutral, PublicKeyToken=5a08f2b6f4415dea, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\CSCore.1.2.1.2\lib\net35-client\CSCore.dll</HintPath>
|
<HintPath>..\packages\CSCore.1.2.1.2\lib\net35-client\CSCore.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="CUE.NET, Version=1.1.3.1, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="CUE.NET, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\CUE.NET.1.1.3.1\lib\net45\CUE.NET.dll</HintPath>
|
<HintPath>..\packages\CUE.NET.1.2.0\lib\net45\CUE.NET.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="DynamicExpresso.Core, Version=1.3.4.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DynamicExpresso.Core, Version=1.3.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DynamicExpresso.Core.1.3.4.7\lib\net40\DynamicExpresso.Core.dll</HintPath>
|
<HintPath>..\packages\DynamicExpresso.Core.1.3.4.7\lib\net40\DynamicExpresso.Core.dll</HintPath>
|
||||||
@ -182,9 +181,6 @@
|
|||||||
<Reference Include="MahApps.Metro, Version=1.4.3.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
|
<Reference Include="MahApps.Metro, Version=1.4.3.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MahApps.Metro.1.4.3\lib\net45\MahApps.Metro.dll</HintPath>
|
<HintPath>..\packages\MahApps.Metro.1.4.3\lib\net45\MahApps.Metro.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.7.0.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\TaskScheduler.2.7.0\lib\net452\Microsoft.Win32.TaskScheduler.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="MoonSharp.Interpreter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=921e73ce94aa17f8, processorArchitecture=MSIL">
|
<Reference Include="MoonSharp.Interpreter, Version=2.0.0.0, Culture=neutral, PublicKeyToken=921e73ce94aa17f8, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MoonSharp.2.0.0.0\lib\net40-client\MoonSharp.Interpreter.dll</HintPath>
|
<HintPath>..\packages\MoonSharp.2.0.0.0\lib\net40-client\MoonSharp.Interpreter.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -234,7 +230,7 @@
|
|||||||
<HintPath>..\packages\SharpDX.Direct3D9.4.0.1\lib\net45\SharpDX.Direct3D9.dll</HintPath>
|
<HintPath>..\packages\SharpDX.Direct3D9.4.0.1\lib\net45\SharpDX.Direct3D9.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SpotifyAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SpotifyAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SpotifyAPI-NET.2.16.1\lib\SpotifyAPI.dll</HintPath>
|
<HintPath>..\packages\SpotifyAPI-NET.2.17.0\lib\SpotifyAPI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.ComponentModel.Composition" />
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
@ -247,7 +243,7 @@
|
|||||||
<Reference Include="System.Web" />
|
<Reference Include="System.Web" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\MahApps.Metro.1.4.3\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
<HintPath>..\packages\Caliburn.Micro.3.2.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
@ -1060,7 +1056,9 @@
|
|||||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceConsole-3.0\AceConsole-3.0.xml" />
|
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceConsole-3.0\AceConsole-3.0.xml" />
|
||||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceEvent-3.0\AceEvent-3.0.xml" />
|
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceEvent-3.0\AceEvent-3.0.xml" />
|
||||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceTimer-3.0\AceTimer-3.0.xml" />
|
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceTimer-3.0\AceTimer-3.0.xml" />
|
||||||
<Resource Include="Resources\Artemis autorun.xml" />
|
<Resource Include="Resources\Artemis autorun.xml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Resource>
|
||||||
<Content Include="Resources\CounterStrike\csgoGamestateConfiguration.txt" />
|
<Content Include="Resources\CounterStrike\csgoGamestateConfiguration.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -1086,12 +1084,12 @@
|
|||||||
<Folder Include="Resources\Lua\" />
|
<Folder Include="Resources\Lua\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="..\packages\CUE.NET.1.1.3.1\build\net45\CUE.NET.targets" Condition="Exists('..\packages\CUE.NET.1.1.3.1\build\net45\CUE.NET.targets')" />
|
<Import Project="..\packages\CUE.NET.1.2.0\build\net45\CUE.NET.targets" Condition="Exists('..\packages\CUE.NET.1.2.0\build\net45\CUE.NET.targets')" />
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Error Condition="!Exists('..\packages\CUE.NET.1.1.3.1\build\net45\CUE.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CUE.NET.1.1.3.1\build\net45\CUE.NET.targets'))" />
|
<Error Condition="!Exists('..\packages\CUE.NET.1.2.0\build\net45\CUE.NET.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CUE.NET.1.2.0\build\net45\CUE.NET.targets'))" />
|
||||||
</Target>
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
|||||||
@ -27,7 +27,7 @@ namespace Artemis.DeviceProviders.Corsair
|
|||||||
{
|
{
|
||||||
CanUse = CanInitializeSdk();
|
CanUse = CanInitializeSdk();
|
||||||
if (CanUse && !CueSDK.IsInitialized)
|
if (CanUse && !CueSDK.IsInitialized)
|
||||||
CueSDK.Initialize();
|
CueSDK.Initialize(true);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -45,7 +45,7 @@ namespace Artemis.DeviceProviders.Corsair
|
|||||||
public override void Enable()
|
public override void Enable()
|
||||||
{
|
{
|
||||||
if (!CueSDK.IsInitialized)
|
if (!CueSDK.IsInitialized)
|
||||||
CueSDK.Initialize();
|
CueSDK.Initialize(true);
|
||||||
|
|
||||||
CueSDK.UpdateMode = UpdateMode.Manual;
|
CueSDK.UpdateMode = UpdateMode.Manual;
|
||||||
_keyboard = CueSDK.KeyboardSDK;
|
_keyboard = CueSDK.KeyboardSDK;
|
||||||
@ -97,8 +97,7 @@ namespace Artemis.DeviceProviders.Corsair
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (CueSDK.IsInitialized)
|
CueSDK.Reset();
|
||||||
CueSDK.Reinitialize();
|
|
||||||
}
|
}
|
||||||
catch (WrapperException e)
|
catch (WrapperException e)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@ namespace Artemis.DeviceProviders.Corsair
|
|||||||
{
|
{
|
||||||
CanUse = CanInitializeSdk();
|
CanUse = CanInitializeSdk();
|
||||||
if (CanUse && !CueSDK.IsInitialized)
|
if (CanUse && !CueSDK.IsInitialized)
|
||||||
CueSDK.Initialize();
|
CueSDK.Initialize(true);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,7 +27,7 @@ namespace Artemis.DeviceProviders.Corsair
|
|||||||
{
|
{
|
||||||
CanUse = CanInitializeSdk();
|
CanUse = CanInitializeSdk();
|
||||||
if (CanUse && !CueSDK.IsInitialized)
|
if (CanUse && !CueSDK.IsInitialized)
|
||||||
CueSDK.Initialize();
|
CueSDK.Initialize(true);
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
|
|||||||
Binary file not shown.
@ -10,7 +10,7 @@ using Artemis.Utilities;
|
|||||||
using Artemis.Utilities.ActiveWindowDetection;
|
using Artemis.Utilities.ActiveWindowDetection;
|
||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
using MahApps.Metro;
|
using MahApps.Metro;
|
||||||
using Microsoft.Win32.TaskScheduler;
|
//using Microsoft.Win32.TaskScheduler;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Converters;
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
@ -21,7 +21,6 @@ namespace Artemis.Settings
|
|||||||
public GeneralSettings()
|
public GeneralSettings()
|
||||||
{
|
{
|
||||||
ThemeManager.AddAccent("CorsairYellow", new Uri("pack://application:,,,/Styles/Accents/CorsairYellow.xaml"));
|
ThemeManager.AddAccent("CorsairYellow", new Uri("pack://application:,,,/Styles/Accents/CorsairYellow.xaml"));
|
||||||
ApplyAutorun();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DefaultValue("GeneralProfile")]
|
[DefaultValue("GeneralProfile")]
|
||||||
@ -109,32 +108,24 @@ namespace Artemis.Settings
|
|||||||
|
|
||||||
public void ApplyAutorun()
|
public void ApplyAutorun()
|
||||||
{
|
{
|
||||||
using (var ts = new TaskService())
|
if (Autorun)
|
||||||
{
|
{
|
||||||
var existing = ts.FindTask("Artemis autorun");
|
// Overwrite any existing tasks in case the installation folder changed
|
||||||
if (Autorun)
|
var path = Path.GetTempFileName();
|
||||||
{
|
var artemisPath = AppDomain.CurrentDomain.BaseDirectory.Substring(0, AppDomain.CurrentDomain.BaseDirectory.Length - 1);
|
||||||
// Overwrite any existing tasks in case the installation folder changed
|
var xml = Resources.Artemis_autorun
|
||||||
var path = Path.GetTempFileName();
|
.Replace("{{artemisPath}}", artemisPath)
|
||||||
var artemisPath = AppDomain.CurrentDomain.BaseDirectory.Substring(0, AppDomain.CurrentDomain.BaseDirectory.Length - 1);
|
.Replace("{{userId}}", System.Security.Principal.WindowsIdentity.GetCurrent().User?.Value)
|
||||||
var xml = Resources.Artemis_autorun
|
.Replace("{{author}}", System.Security.Principal.WindowsIdentity.GetCurrent().Name);
|
||||||
.Replace("{{artemisPath}}", AppDomain.CurrentDomain.BaseDirectory)
|
|
||||||
.Replace("{{author}}", System.Security.Principal.WindowsIdentity.GetCurrent().Name);
|
|
||||||
File.WriteAllText(path, xml);
|
|
||||||
|
|
||||||
var task = ts.RootFolder.ImportTask(null, path);
|
File.WriteAllText(path, xml);
|
||||||
task.Definition.Principal.UserId = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
|
RunWithoutWindow(Environment.SystemDirectory + "\\schtasks.exe", $"/Create /XML \"{path}\" /tn \"Artemis\"");
|
||||||
task.Definition.Principal.LogonType = TaskLogonType.InteractiveToken;
|
File.Delete(path);
|
||||||
task.Definition.Principal.RunLevel = TaskRunLevel.Highest;
|
}
|
||||||
task.RegisterChanges();
|
else
|
||||||
|
{
|
||||||
File.Delete(path);
|
// Remove the task if it is present
|
||||||
}
|
RunWithoutWindow(Environment.SystemDirectory + "\\schtasks.exe", "/Delete /TN Artemis /f");
|
||||||
else if (existing != null)
|
|
||||||
{
|
|
||||||
// Remove the task if it is present
|
|
||||||
ts.RootFolder.DeleteTask("Artemis autorun");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,5 +159,25 @@ namespace Artemis.Settings
|
|||||||
{
|
{
|
||||||
ScreenCaptureManager.UpdateRate = 1.0 / ScreenCaptureFPS;
|
ScreenCaptureManager.UpdateRate = 1.0 / ScreenCaptureFPS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RunWithoutWindow(string fileName, string arguments)
|
||||||
|
{
|
||||||
|
var process = new System.Diagnostics.Process
|
||||||
|
{
|
||||||
|
StartInfo =
|
||||||
|
{
|
||||||
|
RedirectStandardOutput = true,
|
||||||
|
UseShellExecute = false,
|
||||||
|
CreateNoWindow = true,
|
||||||
|
Verb = "runas",
|
||||||
|
FileName = fileName,
|
||||||
|
Arguments = arguments
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Go
|
||||||
|
process.Start();
|
||||||
|
process.WaitForExit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
|
||||||
using Artemis.DAL;
|
using Artemis.DAL;
|
||||||
using Artemis.Events;
|
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Services;
|
using Artemis.Services;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
@ -24,8 +22,8 @@ namespace Artemis.ViewModels
|
|||||||
private string _activeIcon;
|
private string _activeIcon;
|
||||||
private bool _checked;
|
private bool _checked;
|
||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
private string _toggleText;
|
|
||||||
private bool _exiting;
|
private bool _exiting;
|
||||||
|
private string _toggleText;
|
||||||
|
|
||||||
public ShellViewModel(IKernel kernel, MainManager mainManager, MetroDialogService metroDialogService,
|
public ShellViewModel(IKernel kernel, MainManager mainManager, MetroDialogService metroDialogService,
|
||||||
FlyoutSettingsViewModel flyoutSettings)
|
FlyoutSettingsViewModel flyoutSettings)
|
||||||
@ -36,6 +34,7 @@ namespace Artemis.ViewModels
|
|||||||
MetroDialogService = metroDialogService;
|
MetroDialogService = metroDialogService;
|
||||||
|
|
||||||
DisplayName = "Artemis";
|
DisplayName = "Artemis";
|
||||||
|
ActiveIcon = "../Resources/logo-disabled.ico";
|
||||||
GeneralSettings = SettingsProvider.Load<GeneralSettings>();
|
GeneralSettings = SettingsProvider.Load<GeneralSettings>();
|
||||||
Flyouts = new BindableCollection<FlyoutBaseViewModel>
|
Flyouts = new BindableCollection<FlyoutBaseViewModel>
|
||||||
{
|
{
|
||||||
@ -47,7 +46,54 @@ namespace Artemis.ViewModels
|
|||||||
// This gets updated automatically but during startup lets quickly preset it
|
// This gets updated automatically but during startup lets quickly preset it
|
||||||
Enabled = GeneralSettings.Suspended;
|
Enabled = GeneralSettings.Suspended;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Mutex Mutex { get; set; }
|
||||||
|
public MainManager MainManager { get; set; }
|
||||||
|
public MetroDialogService MetroDialogService { get; set; }
|
||||||
|
public IObservableCollection<FlyoutBaseViewModel> Flyouts { get; set; }
|
||||||
|
public GeneralSettings GeneralSettings { get; set; }
|
||||||
|
private MetroWindow Window => (MetroWindow) GetView();
|
||||||
|
|
||||||
|
public bool CanShowWindow => Window != null && (Window != null || !Window.IsVisible);
|
||||||
|
public bool CanHideWindow => Window != null && Window.IsVisible;
|
||||||
|
|
||||||
|
public bool Enabled
|
||||||
|
{
|
||||||
|
get => _enabled;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == _enabled)
|
||||||
|
return;
|
||||||
|
_enabled = value;
|
||||||
|
|
||||||
|
ToggleText = _enabled ? "Disable Artemis" : "Enable Artemis";
|
||||||
|
ActiveIcon = _enabled ? "../Resources/logo.ico" : "../Resources/logo-disabled.ico";
|
||||||
|
NotifyOfPropertyChange(() => Enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ActiveIcon
|
||||||
|
{
|
||||||
|
get => _activeIcon;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_activeIcon = value;
|
||||||
|
NotifyOfPropertyChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ToggleText
|
||||||
|
{
|
||||||
|
get => _toggleText;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == _toggleText)
|
||||||
|
return;
|
||||||
|
_toggleText = value;
|
||||||
|
NotifyOfPropertyChange(() => ToggleText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnViewReady(object view)
|
protected override void OnViewReady(object view)
|
||||||
{
|
{
|
||||||
base.OnViewReady(view);
|
base.OnViewReady(view);
|
||||||
@ -69,51 +115,6 @@ namespace Artemis.ViewModels
|
|||||||
MainManager.EnableProgram();
|
MainManager.EnableProgram();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mutex Mutex { get; set; }
|
|
||||||
public MainManager MainManager { get; set; }
|
|
||||||
public MetroDialogService MetroDialogService { get; set; }
|
|
||||||
public IObservableCollection<FlyoutBaseViewModel> Flyouts { get; set; }
|
|
||||||
public GeneralSettings GeneralSettings { get; set; }
|
|
||||||
private MetroWindow Window => (MetroWindow) GetView();
|
|
||||||
|
|
||||||
public bool CanShowWindow => Window != null && (Window != null || !Window.IsVisible);
|
|
||||||
public bool CanHideWindow => Window != null && Window.IsVisible;
|
|
||||||
|
|
||||||
public bool Enabled
|
|
||||||
{
|
|
||||||
get { return _enabled; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == _enabled) return;
|
|
||||||
_enabled = value;
|
|
||||||
|
|
||||||
ToggleText = _enabled ? "Disable Artemis" : "Enable Artemis";
|
|
||||||
ActiveIcon = _enabled ? "../Resources/logo.ico" : "../Resources/logo-disabled.ico";
|
|
||||||
NotifyOfPropertyChange(() => Enabled);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ActiveIcon
|
|
||||||
{
|
|
||||||
get { return _activeIcon; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_activeIcon = value;
|
|
||||||
NotifyOfPropertyChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ToggleText
|
|
||||||
{
|
|
||||||
get { return _toggleText; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (value == _toggleText) return;
|
|
||||||
_toggleText = value;
|
|
||||||
NotifyOfPropertyChange(() => ToggleText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void CanClose(Action<bool> callback)
|
public override void CanClose(Action<bool> callback)
|
||||||
{
|
{
|
||||||
if (CanHideWindow)
|
if (CanHideWindow)
|
||||||
@ -128,11 +129,13 @@ namespace Artemis.ViewModels
|
|||||||
public void ShowWindow()
|
public void ShowWindow()
|
||||||
{
|
{
|
||||||
if (CanShowWindow)
|
if (CanShowWindow)
|
||||||
|
{
|
||||||
Window?.Dispatcher.Invoke(() =>
|
Window?.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
Window.Show();
|
Window.Show();
|
||||||
Window.Activate();
|
Window.Activate();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
GeneralSettings.ApplyTheme();
|
GeneralSettings.ApplyTheme();
|
||||||
|
|
||||||
@ -249,4 +252,4 @@ namespace Artemis.ViewModels
|
|||||||
"If so, please make sure Artemis isn't already running");
|
"If so, please make sure Artemis isn't already running");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Betwixt" version="1.4.1" targetFramework="net461" />
|
<package id="Betwixt" version="1.4.1" targetFramework="net461" />
|
||||||
<package id="Caliburn.Micro" version="3.1.0" targetFramework="net461" />
|
<package id="Caliburn.Micro" version="3.2.0" targetFramework="net461" />
|
||||||
<package id="Caliburn.Micro.Core" version="3.1.0" targetFramework="net461" />
|
<package id="Caliburn.Micro.Core" version="3.2.0" targetFramework="net461" />
|
||||||
<package id="Colore" version="5.1.0" targetFramework="net461" />
|
<package id="Colore" version="5.2.0" targetFramework="net461" />
|
||||||
<package id="CSCore" version="1.2.1.2" targetFramework="net461" />
|
<package id="CSCore" version="1.2.1.2" targetFramework="net461" />
|
||||||
<package id="CUE.NET" version="1.1.3.1" targetFramework="net461" />
|
<package id="CUE.NET" version="1.2.0" targetFramework="net461" />
|
||||||
<package id="DynamicExpresso.Core" version="1.3.4.7" targetFramework="net461" />
|
<package id="DynamicExpresso.Core" version="1.3.4.7" targetFramework="net461" />
|
||||||
<package id="gong-wpf-dragdrop" version="0.1.4.3" targetFramework="net461" />
|
<package id="gong-wpf-dragdrop" version="0.1.4.3" targetFramework="net461" />
|
||||||
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net452" />
|
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net452" />
|
||||||
@ -25,7 +25,6 @@
|
|||||||
<package id="Process.NET" version="1.0.8" targetFramework="net461" />
|
<package id="Process.NET" version="1.0.8" targetFramework="net461" />
|
||||||
<package id="SharpDX" version="4.0.1" targetFramework="net461" />
|
<package id="SharpDX" version="4.0.1" targetFramework="net461" />
|
||||||
<package id="SharpDX.Direct3D9" version="4.0.1" targetFramework="net461" />
|
<package id="SharpDX.Direct3D9" version="4.0.1" targetFramework="net461" />
|
||||||
<package id="SpotifyAPI-NET" version="2.16.1" targetFramework="net461" />
|
<package id="SpotifyAPI-NET" version="2.17.0" targetFramework="net461" />
|
||||||
<package id="TaskScheduler" version="2.7.0" targetFramework="net461" />
|
|
||||||
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
||||||
</packages>
|
</packages>
|
||||||
Loading…
x
Reference in New Issue
Block a user