mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Meta - Code cleanup
This commit is contained in:
1 parent
b2ab142dbd
commit
58a964b872
105 files changed
+3097
-2624
No files matched your search
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
|
||||
@@ -1,20 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for PluginSettingsView.xaml
|
||||
/// Interaction logic for PluginSettingsView.xaml
|
||||
/// </summary>
|
||||
public partial class PluginSettingsView : UserControl
|
||||
{
|
||||
@@ -23,4 +12,4 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.LayerBrush;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.UI.Shared.Services.Interfaces;
|
||||
@@ -33,34 +32,6 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
|
||||
public PackIconKind Icon => GetIconKind();
|
||||
|
||||
private PackIconKind GetIconKind()
|
||||
{
|
||||
if (PluginInfo.Icon != null)
|
||||
{
|
||||
var parsedIcon = Enum.TryParse<PackIconKind>(PluginInfo.Icon, true, out var iconEnum);
|
||||
if (parsedIcon == false)
|
||||
return PackIconKind.QuestionMarkCircle;
|
||||
}
|
||||
|
||||
switch (Plugin)
|
||||
{
|
||||
case DataModelExpansion _:
|
||||
return PackIconKind.TableAdd;
|
||||
case DeviceProvider _:
|
||||
return PackIconKind.Devices;
|
||||
case ProfileModule _:
|
||||
return PackIconKind.VectorRectangle;
|
||||
case Core.Plugins.Abstract.Module _:
|
||||
return PackIconKind.GearBox;
|
||||
case LayerBrushProvider _:
|
||||
return PackIconKind.Brush;
|
||||
case LayerEffectProvider _:
|
||||
return PackIconKind.AutoAwesome;
|
||||
}
|
||||
|
||||
return PackIconKind.Plugin;
|
||||
}
|
||||
|
||||
public bool IsEnabled
|
||||
{
|
||||
get => PluginInfo.Enabled;
|
||||
@@ -84,6 +55,34 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
||||
}
|
||||
}
|
||||
|
||||
private PackIconKind GetIconKind()
|
||||
{
|
||||
if (PluginInfo.Icon != null)
|
||||
{
|
||||
var parsedIcon = Enum.TryParse<PackIconKind>(PluginInfo.Icon, true, out var iconEnum);
|
||||
if (parsedIcon == false)
|
||||
return PackIconKind.QuestionMarkCircle;
|
||||
}
|
||||
|
||||
switch (Plugin)
|
||||
{
|
||||
case DataModelExpansion _:
|
||||
return PackIconKind.TableAdd;
|
||||
case DeviceProvider _:
|
||||
return PackIconKind.Devices;
|
||||
case ProfileModule _:
|
||||
return PackIconKind.VectorRectangle;
|
||||
case Core.Plugins.Abstract.Module _:
|
||||
return PackIconKind.GearBox;
|
||||
case LayerBrushProvider _:
|
||||
return PackIconKind.Brush;
|
||||
case LayerEffectProvider _:
|
||||
return PackIconKind.AutoAwesome;
|
||||
}
|
||||
|
||||
return PackIconKind.Plugin;
|
||||
}
|
||||
|
||||
private async Task UpdateEnabled(bool enable)
|
||||
{
|
||||
if (PluginInfo.Enabled == enable)
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<controls:MaterialWindow x:Class="Artemis.UI.Screens.Settings.Tabs.Plugins.PluginSettingsWindowView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.Settings.Tabs.Plugins"
|
||||
xmlns:controls="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding Title}"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
|
||||
UseLayoutRounding="True"
|
||||
Width="800"
|
||||
Height="800"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance local:PluginSettingsWindowViewModel}"
|
||||
Icon="/Resources/Images/Logo/logo-512.png">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.Settings.Tabs.Plugins"
|
||||
xmlns:controls="clr-namespace:MaterialDesignExtensions.Controls;assembly=MaterialDesignExtensions"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding Title}"
|
||||
Background="{DynamicResource MaterialDesignPaper}"
|
||||
FontFamily="pack://application:,,,/MaterialDesignThemes.Wpf;component/Resources/Roboto/#Roboto"
|
||||
UseLayoutRounding="True"
|
||||
Width="800"
|
||||
Height="800"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance local:PluginSettingsWindowViewModel}"
|
||||
Icon="/Resources/Images/Logo/logo-512.png">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}"/>
|
||||
<ContentControl s:View.Model="{Binding ActiveItem}" />
|
||||
</ScrollViewer>
|
||||
</controls:MaterialWindow>
|
||||
</controls:MaterialWindow>
|
||||
Reference in new issue
Block a user