1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Merge remote-tracking branch 'origin/master'

This commit is contained in:
Robert 2021-04-07 21:59:09 +02:00
commit f0dcd0f0f3
44 changed files with 476 additions and 467 deletions

View File

@ -54,7 +54,7 @@ steps:
command: 'publish'
publishWebProjects: false
projects: '$(artemisSolution)'
arguments: '--runtime win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/build /nowarn:cs1591'
arguments: '--runtime win-x64 --self-contained false --configuration Release --output $(Build.ArtifactStagingDirectory)/build /nowarn:cs1591'
zipAfterPublish: false
modifyOutputPath: false
@ -74,12 +74,13 @@ steps:
fileType: 'json'
targetFiles: '**/buildinfo.json'
# Copy Artemis binaries to where plugin projects expect them
- task: CopyFiles@2
displayName: 'Plugins - Prepare Artemis binaries'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)/build'
Contents: '**'
TargetFolder: 'Artemis/src/Artemis.UI/bin/x64/Debug/net5.0-windows'
TargetFolder: 'Artemis/src/Artemis.UI/bin/net5.0-windows'
- task: PowerShell@2
displayName: 'Plugins - Insert build number into plugin.json'
@ -100,7 +101,7 @@ steps:
inputs:
command: 'publish'
publishWebProjects: false
arguments: '--runtime win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/build/Plugins'
arguments: '--runtime win-x64 --configuration Release --self-contained false --output $(Build.ArtifactStagingDirectory)/build/Plugins'
projects: '$(pluginProjects)'
zipAfterPublish: true

View File

@ -38,19 +38,19 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.1.6" />
<PackageReference Include="Ben.Demystifier" Version="0.3.0" />
<PackageReference Include="EmbedIO" Version="3.4.3" />
<PackageReference Include="HidSharp" Version="2.1.0" />
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
<PackageReference Include="LiteDB" Version="5.0.9" />
<PackageReference Include="LiteDB" Version="5.0.10" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="1.3.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="Ninject.Extensions.ChildKernel" Version="3.3.0" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Enrichers.Demystify" Version="1.0.0-dev-00019" />
<PackageReference Include="Serilog.Sinks.Debug" Version="1.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="SkiaSharp" Version="2.80.2" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
@ -58,7 +58,7 @@
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0">
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -47,7 +47,7 @@ namespace Artemis.Core
/// <para>Information is retrieved from <c>buildinfo.json</c></para>
/// </summary>
public static readonly BuildInfo BuildInfo = File.Exists(Path.Combine(ApplicationFolder, "buildinfo.json"))
? JsonConvert.DeserializeObject<BuildInfo>(File.ReadAllText(Path.Combine(ApplicationFolder, "buildinfo.json")))
? JsonConvert.DeserializeObject<BuildInfo>(File.ReadAllText(Path.Combine(ApplicationFolder, "buildinfo.json")))!
: new BuildInfo
{
IsLocalBuild = true,

View File

@ -39,13 +39,13 @@ namespace Artemis.Core.Services
foreach (Process startedProcess in newProcesses.Except(_lastScannedProcesses, _comparer))
{
ProcessStarted?.Invoke(this, new ProcessEventArgs(startedProcess));
_logger.Debug("Started Process: {startedProcess}", startedProcess.ProcessName);
_logger.Verbose("Started Process: {startedProcess}", startedProcess.ProcessName);
}
foreach (Process stoppedProcess in _lastScannedProcesses.Except(newProcesses, _comparer))
{
ProcessStopped?.Invoke(this, new ProcessEventArgs(stoppedProcess));
_logger.Debug("Stopped Process: {stoppedProcess}", stoppedProcess.ProcessName);
_logger.Verbose("Stopped Process: {stoppedProcess}", stoppedProcess.ProcessName);
}
_lastScannedProcesses = newProcesses;

View File

@ -4,12 +4,11 @@
".NETCoreApp,Version=v5.0": {
"Ben.Demystifier": {
"type": "Direct",
"requested": "[0.1.6, )",
"resolved": "0.1.6",
"contentHash": "sYI8+ANUo78i/vIq9Vjrjjl6A00yVbT6XsuSVvUMVRVEKJHXZu4VE00RZHg/CA7QxmaQ1zfw/Bs6DAU+OJUNAg==",
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "7mTSt0PLeXomarrTXdLcdYAg+zaOunw3KEvWKQ0fQaGySwqOzGxKVq8BDgUXWAyBH2hKhXldkG7uKJGkYBhDiw==",
"dependencies": {
"System.Reflection.Metadata": "1.6.0",
"System.Threading.Tasks.Extensions": "4.5.3"
"System.Reflection.Metadata": "5.0.0"
}
},
"EmbedIO": {
@ -35,9 +34,9 @@
},
"LiteDB": {
"type": "Direct",
"requested": "[5.0.9, )",
"resolved": "5.0.9",
"contentHash": "cWnNWXL+qaP/qrkUCYZHBUJcv+IsfJfofa+Ed4EyT0zs/gkXqfKvjTbS3uSMBfcd9I7Yf+q9YPmCpmVFrVGQtw=="
"requested": "[5.0.10, )",
"resolved": "5.0.10",
"contentHash": "x70WuqMDuP75dajqSLvO+AnI/BbwS6da+ukTO7rueV7VoXoQ5CRA9FV4r7cOS4OUr2NS1Up7LDIutjCxQycRvg=="
},
"McMaster.NETCore.Plugins": {
"type": "Direct",
@ -51,9 +50,9 @@
},
"Newtonsoft.Json": {
"type": "Direct",
"requested": "[12.0.3, )",
"resolved": "12.0.3",
"contentHash": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg=="
"requested": "[13.0.1, )",
"resolved": "13.0.1",
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A=="
},
"Ninject": {
"type": "Direct",
@ -101,12 +100,11 @@
},
"Serilog.Sinks.Debug": {
"type": "Direct",
"requested": "[1.0.1, )",
"resolved": "1.0.1",
"contentHash": "nE5wvw9+J/V4lA+rEkFUETGjBabK8IlLQY5Z9KDzoo5LvILC4vhTOXLs7DGYs8h5juIf2nLZnVxHDXf404FqEQ==",
"requested": "[2.0.0, )",
"resolved": "2.0.0",
"contentHash": "Y6g3OBJ4JzTyyw16fDqtFcQ41qQAydnEvEqmXjhwhgjsnG/FaJ8GUqF5ldsC/bVkK8KYmqrPhDO+tm4dF6xx4A==",
"dependencies": {
"Serilog": "2.5.0",
"System.Diagnostics.Debug": "4.3.0"
"Serilog": "2.10.0"
}
},
"Serilog.Sinks.File": {
@ -166,9 +164,9 @@
},
"Unclassified.NetRevisionTask": {
"type": "Direct",
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "KwOAbbcAoaOIsyszuOv7ZeLEHfata70iM+0h1jMoMXs87EMXr5E8cFYRrCFbJDdd4Do9dK+L3gwNWjfg/ROUWw=="
"requested": "[0.4.0, )",
"resolved": "0.4.0",
"contentHash": "2Tzz6qoQNciyO4uT6wxByMiyvbve+u4eFIiDewDUbeHuxr/rKuba3/EhhXDsEH9WoKzYlpzqxDfQGPE/bIe5Rw=="
},
"Castle.Core": {
"type": "Transitive",
@ -1164,8 +1162,13 @@
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ=="
"resolved": "4.3.0",
"contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==",
"dependencies": {
"System.Collections": "4.3.0",
"System.Runtime": "4.3.0",
"System.Threading.Tasks": "4.3.0"
}
},
"System.Threading.Timer": {
"type": "Transitive",
@ -1243,7 +1246,7 @@
"artemis.storage": {
"type": "Project",
"dependencies": {
"LiteDB": "5.0.9",
"LiteDB": "5.0.10",
"Serilog": "2.10.0"
}
}

View File

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.9" />
<PackageReference Include="LiteDB" Version="5.0.10" />
<PackageReference Include="Serilog" Version="2.10.0" />
</ItemGroup>
</Project>

View File

@ -4,9 +4,9 @@
".NETCoreApp,Version=v5.0": {
"LiteDB": {
"type": "Direct",
"requested": "[5.0.9, )",
"resolved": "5.0.9",
"contentHash": "cWnNWXL+qaP/qrkUCYZHBUJcv+IsfJfofa+Ed4EyT0zs/gkXqfKvjTbS3uSMBfcd9I7Yf+q9YPmCpmVFrVGQtw=="
"requested": "[5.0.10, )",
"resolved": "5.0.10",
"contentHash": "x70WuqMDuP75dajqSLvO+AnI/BbwS6da+ukTO7rueV7VoXoQ5CRA9FV4r7cOS4OUr2NS1Up7LDIutjCxQycRvg=="
},
"Serilog": {
"type": "Direct",

View File

@ -33,20 +33,20 @@
<DocumentationFile>bin\Artemis.UI.Shared.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AvalonEdit" Version="6.0.1" />
<PackageReference Include="Ben.Demystifier" Version="0.3.0" />
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
<PackageReference Include="MaterialDesignExtensions" Version="3.3.0-a01" />
<PackageReference Include="MaterialDesignThemes" Version="3.2.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
<PackageReference Include="MaterialDesignExtensions" Version="3.3.0" />
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="SharpVectors.Reloaded" Version="1.7.1" />
<PackageReference Include="SkiaSharp" Version="2.80.2" />
<PackageReference Include="SkiaSharp.Views.WPF" Version="2.80.2" />
<PackageReference Include="Stylet" Version="1.3.5" />
<PackageReference Include="Stylet" Version="1.3.6" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0">
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -66,17 +66,23 @@
</UserControl.Resources>
<Grid HorizontalAlignment="Stretch">
<TextBox x:Name="ColorCodeTextBox"
materialDesign:TextFieldAssist.TextBoxViewMargin="1 0 1 0"
materialDesign:TextFieldAssist.TextBoxViewMargin="0 2 20 0"
materialDesign:HintAssist.IsFloating="False"
Style="{Binding TextBoxStyle, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
Text="{Binding Color, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Converter={StaticResource ColorToStringConverter}}"
MinWidth="95"
MaxLength="9"
Margin="0"
HorizontalAlignment="Stretch" />
HorizontalAlignment="Stretch">
<materialDesign:TextFieldAssist.CharacterCounterStyle>
<Style TargetType="TextBlock" />
</materialDesign:TextFieldAssist.CharacterCounterStyle>
</TextBox>
<Border Width="15"
Height="15"
CornerRadius="15"
Margin="0,0,0,2"
Margin="0 0 8 0"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Background="{StaticResource Checkerboard}">
@ -116,7 +122,7 @@
PreviewMouseDown="Slider_OnMouseDown"
PreviewMouseUp="Slider_OnMouseUp"
Maximum="255" />
<ItemsControl Grid.Row="2" x:Name="RecentColorsContainer" Margin="10 0" HorizontalAlignment="Left">
<ItemsControl.ItemTemplate>
<DataTemplate>
@ -130,9 +136,9 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"></WrapPanel>
</ItemsPanelTemplate>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>

View File

@ -35,9 +35,16 @@ namespace Artemis.UI.Shared
public static readonly DependencyProperty StaysOpenProperty = DependencyProperty.Register(nameof(StaysOpen), typeof(bool), typeof(ColorPicker),
new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, StaysOpenPropertyChangedCallback));
/// <summary>
/// Gets or sets the style used on the text box
/// </summary>
public static readonly DependencyProperty TextBoxStyleProperty = DependencyProperty.Register(nameof(TextBoxStyle), typeof(Style), typeof(ColorPicker),
new FrameworkPropertyMetadata(Application.Current.Resources["MaterialDesignTextBox"]));
internal static readonly DependencyProperty ColorOpacityProperty = DependencyProperty.Register(nameof(ColorOpacity), typeof(byte), typeof(ColorPicker),
new FrameworkPropertyMetadata((byte) 255, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, ColorOpacityPropertyChangedCallback));
/// <summary>
/// Occurs when the selected color has changed
/// </summary>
@ -97,6 +104,15 @@ namespace Artemis.UI.Shared
set => SetValue(StaysOpenProperty, value);
}
/// <summary>
/// Gets or sets the style used on the text box
/// </summary>
public Style TextBoxStyle
{
get => (Style) GetValue(TextBoxStyleProperty);
set => SetValue(TextBoxStyleProperty, value);
}
/// <summary>
/// Used by the gradient picker to load saved gradients, do not touch or it'll just throw an exception
/// </summary>
@ -116,6 +132,16 @@ namespace Artemis.UI.Shared
set => SetValue(ColorOpacityProperty, value);
}
/// <summary>
/// Occurs when dragging the color picker has started
/// </summary>
public event EventHandler? DragStarted;
/// <summary>
/// Occurs when dragging the color picker has ended
/// </summary>
public event EventHandler? DragEnded;
/// <summary>
/// Invokes the <see cref="PropertyChanged" /> event
/// </summary>
@ -125,6 +151,22 @@ namespace Artemis.UI.Shared
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
/// <summary>
/// Invokes the <see cref="DragStarted" /> event
/// </summary>
protected virtual void OnDragStarted()
{
DragStarted?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// Invokes the <see cref="DragEnded" /> event
/// </summary>
protected virtual void OnDragEnded()
{
DragEnded?.Invoke(this, EventArgs.Empty);
}
private static void ColorPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
ColorPicker colorPicker = (ColorPicker) d;
@ -245,7 +287,7 @@ namespace Artemis.UI.Shared
private void PopupOpened()
{
if (_colorPickerService != null)
if (_colorPickerService != null)
RecentColorsContainer.ItemsSource = new ObservableCollection<Color>(_colorPickerService.RecentColors);
}
@ -257,36 +299,5 @@ namespace Artemis.UI.Shared
/// <inheritdoc />
public event PropertyChangedEventHandler? PropertyChanged;
#region Events
/// <summary>
/// Occurs when dragging the color picker has started
/// </summary>
public event EventHandler? DragStarted;
/// <summary>
/// Occurs when dragging the color picker has ended
/// </summary>
public event EventHandler? DragEnded;
/// <summary>
/// Invokes the <see cref="DragStarted" /> event
/// </summary>
protected virtual void OnDragStarted()
{
DragStarted?.Invoke(this, EventArgs.Empty);
}
/// <summary>
/// Invokes the <see cref="DragEnded" /> event
/// </summary>
protected virtual void OnDragEnded()
{
DragEnded?.Invoke(this, EventArgs.Empty);
}
#endregion
}
}

View File

@ -8,6 +8,7 @@
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:exceptions="clr-namespace:Artemis.UI.Shared.Screens.Exceptions"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:s="https://github.com/canton7/Stylet"
mc:Ignorable="d"
Title="Unhandled exception"
Background="{DynamicResource MaterialDesignPaper}"
@ -19,41 +20,49 @@
d:DesignWidth="800"
d:DataContext="{d:DesignInstance exceptions:ExceptionViewModel}">
<DockPanel>
<controls:AppBar Type="Dense" Title="{Binding Header}" DockPanel.Dock="Top" Margin="-18 0 0 0" ShowShadow="False">
<controls:AppBar Type="Dense" Title="{Binding Header, Mode=OneTime}" DockPanel.Dock="Top" Margin="-18 0 0 0" ShowShadow="False">
<controls:AppBar.AppIcon>
<materialDesign:PackIcon Kind="ErrorOutline" Width="20" Height="28" />
</controls:AppBar.AppIcon>
</controls:AppBar>
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Margin="16">
<StackPanel>
<ItemsControl ItemsSource="{Binding Exceptions}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}"
Text="Stack trace"
TextWrapping="Wrap"
FontWeight="Bold"
MaxWidth="1000" />
<Grid>
<Grid Margin="15">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<avalonedit:TextEditor SyntaxHighlighting="C#"
FontFamily="pack://application:,,,/Resources/Fonts/#Roboto Mono"
FontSize="10pt"
IsReadOnly="True"
Document="{Binding Document}"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
Margin="0 10 10 0"
MaxHeight="500"
Padding="10" />
<materialDesign:Card Grid.Row="0" Grid.ColumnSpan="2" Margin="0 0 0 5">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Margin="16">
<TextBox Text="{Binding Exception, Mode=OneTime}"
AcceptsReturn="True"
IsReadOnly="True"
FontFamily="Consolas"
FontSize="12"
materialDesign:TextFieldAssist.UnderlineBrush="Transparent"
BorderThickness="0" />
</ScrollViewer>
</materialDesign:Card>
<Separator Margin="0 15" />
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
<TextBlock Grid.Row="1" Grid.Column="0" TextWrapping="Wrap" Margin="0 0 5 0" VerticalAlignment="Center">
<materialDesign:PackIcon Kind="Text" Margin="0 0 0 -3" />
When reporting errors please don't take a screenshot of the error, instead copy the text, thanks!
</TextBlock>
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 5 0 0">
<Button Style="{StaticResource MaterialDesignOutlinedButton}" Command="{s:Action CopyException}" Width="150" Margin="0 0 5 0">
COPY EXCEPTION
</Button>
<Button Style="{StaticResource MaterialDesignFlatMidBgButton}" Command="{s:Action Close}" Width="150" Margin="5 0 0 0">
CLOSE
</Button>
</StackPanel>
</Grid>
<materialDesign:Snackbar MessageQueue="{Binding MessageQueue}"></materialDesign:Snackbar>
</Grid>
</DockPanel>
</controls:MaterialWindow>

View File

@ -1,45 +1,33 @@
using System;
using System.Collections.Generic;
using ICSharpCode.AvalonEdit.Document;
using System.Diagnostics;
using System.Windows;
using MaterialDesignThemes.Wpf;
using Stylet;
namespace Artemis.UI.Shared.Screens.Exceptions
{
internal class ExceptionViewModel : Screen
{
private List<DialogException> _exceptions;
public ExceptionViewModel(string message, Exception? exception)
public ExceptionViewModel(string message, Exception exception)
{
Header = message;
_exceptions = new List<DialogException>();
Exception? currentException = exception;
while (currentException != null)
{
Exceptions.Add(new DialogException(currentException));
currentException = currentException.InnerException;
}
Exception = exception.ToStringDemystified();
MessageQueue = new SnackbarMessageQueue(TimeSpan.FromSeconds(2));
}
public string Header { get; }
public string Exception { get; }
public SnackbarMessageQueue MessageQueue { get; }
public List<DialogException> Exceptions
public void CopyException()
{
get => _exceptions;
set => SetAndNotify(ref _exceptions, value);
}
}
internal class DialogException
{
public DialogException(Exception exception)
{
Exception = exception;
Document = new TextDocument(new StringTextSource($"{exception.Message}\r\n\r\n{exception.StackTrace}"));
Clipboard.SetText(Exception);
MessageQueue.Enqueue("Copied exception to clipboard");
}
public Exception Exception { get; }
public IDocument Document { get; set; }
public void Close()
{
RequestClose();
}
}
}

View File

@ -29,15 +29,15 @@ namespace Artemis.UI.Shared.Services
_pluginManagementService = pluginManagementService;
}
private async Task<object> ShowDialog<T>(IParameter[] parameters) where T : DialogViewModelBase
private async Task<object?> ShowDialog<T>(IParameter[] parameters) where T : DialogViewModelBase
{
if (parameters == null) throw new ArgumentNullException(nameof(parameters));
return await ShowDialog("RootDialog", GetBestKernel().Get<T>(parameters));
}
private async Task<object> ShowDialog(string? identifier, DialogViewModelBase viewModel)
private async Task<object?> ShowDialog(string? identifier, DialogViewModelBase viewModel)
{
Task<object>? result = null;
Task<object?>? result = null;
await Execute.OnUIThreadAsync(() =>
{
UIElement view = _viewManager.CreateViewForModel(viewModel);
@ -54,7 +54,7 @@ namespace Artemis.UI.Shared.Services
return await result;
}
private async Task<object> ShowDialogAt<T>(string identifier, IParameter[] parameters) where T : DialogViewModelBase
private async Task<object?> ShowDialogAt<T>(string identifier, IParameter[] parameters) where T : DialogViewModelBase
{
if (parameters == null)
throw new ArgumentNullException(nameof(parameters));
@ -70,8 +70,8 @@ namespace Artemis.UI.Shared.Services
new ConstructorArgument("confirmText", confirmText.ToUpper()),
new ConstructorArgument("cancelText", cancelText.ToUpper())
};
object result = await ShowDialog<ConfirmDialogViewModel>(arguments);
return (bool) result;
object? result = await ShowDialog<ConfirmDialogViewModel>(arguments);
return result is bool booleanResult && booleanResult;
}
public async Task<bool> ShowConfirmDialogAt(string identifier, string header, string text, string confirmText = "Confirm", string cancelText = "Cancel")
@ -84,16 +84,16 @@ namespace Artemis.UI.Shared.Services
new ConstructorArgument("confirmText", confirmText.ToUpper()),
new ConstructorArgument("cancelText", cancelText.ToUpper())
};
object result = await ShowDialogAt<ConfirmDialogViewModel>(identifier, arguments);
return (bool) result;
object? result = await ShowDialogAt<ConfirmDialogViewModel>(identifier, arguments);
return result is bool booleanResult && booleanResult;
}
public async Task<object> ShowDialog<T>() where T : DialogViewModelBase
public async Task<object?> ShowDialog<T>() where T : DialogViewModelBase
{
return await ShowDialog("RootDialog", GetBestKernel().Get<T>());
}
public Task<object> ShowDialog<T>(Dictionary<string, object> parameters) where T : DialogViewModelBase
public Task<object?> ShowDialog<T>(Dictionary<string, object> parameters) where T : DialogViewModelBase
{
if (parameters == null)
throw new ArgumentNullException(nameof(parameters));
@ -102,13 +102,13 @@ namespace Artemis.UI.Shared.Services
return ShowDialog<T>(paramsArray);
}
public async Task<object> ShowDialogAt<T>(string identifier) where T : DialogViewModelBase
public async Task<object?> ShowDialogAt<T>(string identifier) where T : DialogViewModelBase
{
if (identifier == null) throw new ArgumentNullException(nameof(identifier));
return await ShowDialog(identifier, GetBestKernel().Get<T>());
}
public async Task<object> ShowDialogAt<T>(string identifier, Dictionary<string, object> parameters) where T : DialogViewModelBase
public async Task<object?> ShowDialogAt<T>(string identifier, Dictionary<string, object> parameters) where T : DialogViewModelBase
{
if (identifier == null) throw new ArgumentNullException(nameof(identifier));
if (parameters == null) throw new ArgumentNullException(nameof(parameters));
@ -119,6 +119,7 @@ namespace Artemis.UI.Shared.Services
public void ShowExceptionDialog(string message, Exception exception)
{
if (exception == null) throw new ArgumentNullException(nameof(exception));
_windowManager.ShowDialog(new ExceptionViewModel(message, exception));
}

View File

@ -40,7 +40,7 @@ namespace Artemis.UI.Shared.Services
/// </summary>
/// <typeparam name="T">The type of the view model</typeparam>
/// <returns>A task resolving to the result of the dialog's <see cref="DialogSession" /></returns>
Task<object> ShowDialog<T>() where T : DialogViewModelBase;
Task<object?> ShowDialog<T>() where T : DialogViewModelBase;
/// <summary>
/// Shows a dialog by initializing a view model implementing <see cref="DialogViewModelBase" /> with arguments passed
@ -49,7 +49,7 @@ namespace Artemis.UI.Shared.Services
/// <typeparam name="T">The type of the view model</typeparam>
/// <param name="parameters">A dictionary of constructor arguments to pass to the view model</param>
/// <returns>A task resolving to the result of the dialog's <see cref="DialogSession" /></returns>
Task<object> ShowDialog<T>(Dictionary<string, object> parameters) where T : DialogViewModelBase;
Task<object?> ShowDialog<T>(Dictionary<string, object> parameters) where T : DialogViewModelBase;
/// <summary>
/// Shows a dialog by initializing a view model implementing <see cref="DialogViewModelBase" />
@ -60,7 +60,7 @@ namespace Artemis.UI.Shared.Services
/// <code>&lt;materialDesign:DialogHost Identifier="MyDialogHost"&gt;</code>
/// </param>
/// <returns>A task resolving to the result of the dialog's <see cref="DialogSession" /></returns>
Task<object> ShowDialogAt<T>(string identifier) where T : DialogViewModelBase;
Task<object?> ShowDialogAt<T>(string identifier) where T : DialogViewModelBase;
/// <summary>
/// Shows a dialog by initializing a view model implementing <see cref="DialogViewModelBase" /> with arguments passed
@ -73,7 +73,7 @@ namespace Artemis.UI.Shared.Services
/// </param>
/// <param name="parameters">A dictionary of constructor arguments to pass to the view model</param>
/// <returns>A task resolving to the result of the dialog's <see cref="DialogSession" /></returns>
Task<object> ShowDialogAt<T>(string identifier, Dictionary<string, object> parameters) where T : DialogViewModelBase;
Task<object?> ShowDialogAt<T>(string identifier, Dictionary<string, object> parameters) where T : DialogViewModelBase;
/// <summary>
/// Shows a dialog displaying the provided message and exception. Does not handle, log or throw the exception.

View File

@ -42,8 +42,8 @@ namespace Artemis.UI.Shared.Services
/// <param name="actionArgument">Argument to pass to <paramref name="actionHandler" />.</param>
void ShowMessage<TArgument>(
object content,
object actionContent,
Action<TArgument> actionHandler,
object? actionContent,
Action<object?>? actionHandler,
TArgument actionArgument);
/// <summary>
@ -63,7 +63,7 @@ namespace Artemis.UI.Shared.Services
/// <param name="actionContent">Content for the action button.</param>
/// <param name="actionHandler">Call back to be executed if user clicks the action button.</param>
/// <param name="promote">The message will promoted to the front of the queue.</param>
void ShowMessage(object content, object actionContent, Action actionHandler, bool promote);
void ShowMessage(object content, object? actionContent, Action? actionHandler, bool promote);
/// <summary>
/// Queues a notification message for display in a snackbar.
@ -75,8 +75,8 @@ namespace Artemis.UI.Shared.Services
/// <param name="promote">The message will be promoted to the front of the queue and never considered to be a duplicate.</param>
void ShowMessage<TArgument>(
object content,
object actionContent,
Action<TArgument> actionHandler,
object? actionContent,
Action<TArgument?>? actionHandler,
TArgument actionArgument,
bool promote);
@ -92,8 +92,8 @@ namespace Artemis.UI.Shared.Services
/// <param name="durationOverride">Message show duration override.</param>
void ShowMessage<TArgument>(
object content,
object actionContent,
Action<TArgument> actionHandler,
object? actionContent,
Action<TArgument?>? actionHandler,
TArgument actionArgument,
bool promote,
bool neverConsiderToBeDuplicate,
@ -111,8 +111,8 @@ namespace Artemis.UI.Shared.Services
/// <param name="durationOverride">Message show duration override.</param>
void ShowMessage(
object content,
object actionContent,
Action<object> actionHandler,
object? actionContent,
Action<object?>? actionHandler,
object actionArgument,
bool promote,
bool neverConsiderToBeDuplicate,

View File

@ -29,7 +29,7 @@ namespace Artemis.UI.Shared.Services
MainMessageQueue.Enqueue(content, actionContent, actionHandler);
}
public void ShowMessage<TArgument>(object content, object actionContent, Action<TArgument> actionHandler, TArgument actionArgument)
public void ShowMessage<TArgument>(object content, object? actionContent, Action<object?>? actionHandler, TArgument actionArgument)
{
MainMessageQueue.Enqueue(content, actionContent, actionHandler, actionArgument);
}
@ -39,19 +39,19 @@ namespace Artemis.UI.Shared.Services
MainMessageQueue.Enqueue(content, neverConsiderToBeDuplicate);
}
public void ShowMessage(object content, object actionContent, Action actionHandler, bool promote)
public void ShowMessage(object content, object? actionContent, Action? actionHandler, bool promote)
{
MainMessageQueue.Enqueue(content, actionContent, actionHandler, promote);
}
public void ShowMessage<TArgument>(object content, object actionContent, Action<TArgument> actionHandler, TArgument actionArgument, bool promote)
public void ShowMessage<TArgument>(object content, object? actionContent, Action<TArgument?>? actionHandler, TArgument actionArgument, bool promote)
{
MainMessageQueue.Enqueue(content, actionContent, actionHandler, actionArgument, promote);
}
public void ShowMessage<TArgument>(object content,
object actionContent,
Action<TArgument> actionHandler,
object? actionContent,
Action<TArgument?>? actionHandler,
TArgument actionArgument,
bool promote,
bool neverConsiderToBeDuplicate,
@ -61,8 +61,8 @@ namespace Artemis.UI.Shared.Services
}
public void ShowMessage(object content,
object actionContent,
Action<object> actionHandler,
object? actionContent,
Action<object?>? actionHandler,
object actionArgument,
bool promote,
bool neverConsiderToBeDuplicate,

View File

@ -2,11 +2,14 @@
"version": 1,
"dependencies": {
".NETCoreApp,Version=v5.0": {
"AvalonEdit": {
"Ben.Demystifier": {
"type": "Direct",
"requested": "[6.0.1, )",
"resolved": "6.0.1",
"contentHash": "JmRwKMDRUUkUGLQmTtIHiSgFSQH9567b2/55Wa/gQp+ZtxQN+mnl5Qt6B/Kgz56FMnnDyE/fV23r7J2SV+NP7g=="
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "7mTSt0PLeXomarrTXdLcdYAg+zaOunw3KEvWKQ0fQaGySwqOzGxKVq8BDgUXWAyBH2hKhXldkG7uKJGkYBhDiw==",
"dependencies": {
"System.Reflection.Metadata": "5.0.0"
}
},
"Humanizer.Core": {
"type": "Direct",
@ -16,9 +19,9 @@
},
"MaterialDesignExtensions": {
"type": "Direct",
"requested": "[3.3.0-a01, )",
"resolved": "3.3.0-a01",
"contentHash": "dq8lvcj73H6TCmhjlRud8EeUSgC8S2U7T4jOoefmLieZQigbfQNy29hF1041cnu6b3l8mW00zWJituRMSt0iOQ==",
"requested": "[3.3.0, )",
"resolved": "3.3.0",
"contentHash": "dlxWtdrMH8aHNib3dWJhNQ/nNiA2b/CNvr90w/5KB6erTisuTpyYVx2l2+UGCZvwhSX5mHTHQYHfjgAKbDrgjg==",
"dependencies": {
"MaterialDesignColors": "1.2.7",
"MaterialDesignThemes": "3.2.0"
@ -26,18 +29,18 @@
},
"MaterialDesignThemes": {
"type": "Direct",
"requested": "[3.2.0, )",
"resolved": "3.2.0",
"contentHash": "aOZQShQuV7sCWOwO98dYz1S4stmIWDBH+Q6KoR3wDiDyuG7twoGnBDzQBhrxuS16I3GQiG5nfvUjEJFVc/zdKg==",
"requested": "[4.0.0, )",
"resolved": "4.0.0",
"contentHash": "+n5oWHuRiYL/gUw2XfQHCRZqHtU8KbrdurgU0IcO98Zsyhw4BvggodfXY8veRtbjjmM9EJ/sG2yKBrgPOGX4JQ==",
"dependencies": {
"MaterialDesignColors": "[1.2.7, 2.0.0)"
"MaterialDesignColors": "2.0.0"
}
},
"Microsoft.Xaml.Behaviors.Wpf": {
"type": "Direct",
"requested": "[1.1.19, )",
"resolved": "1.1.19",
"contentHash": "5sPWkbqImc2t1aQwIfJcKsUo7tOg1Tr8+6xVzZJB56Nzt4u9NlpcLofgdX/aRYpPKdWDA3U23Akw1KQzU5e82g=="
"requested": "[1.1.31, )",
"resolved": "1.1.31",
"contentHash": "LZpuf82ACZWldmfMuv3CTUMDh3o0xo0uHUaybR5HgqVLDBJJ9RZLykplQ/bTJd0/VDt3EhD4iDgUgbdIUAM+Kg=="
},
"Ninject": {
"type": "Direct",
@ -85,9 +88,9 @@
},
"Stylet": {
"type": "Direct",
"requested": "[1.3.5, )",
"resolved": "1.3.5",
"contentHash": "9vjjaTgf5sZAGHnxQWIslD32MG5gXj7ANgS+w965L5Eh//UC3qwZDrEf226Pf+v1P/ldAJDpUySnOyGlb3TSSw==",
"requested": "[1.3.6, )",
"resolved": "1.3.6",
"contentHash": "SISR+DsPrgBww3AI5FtHx1tD9VkEfJWZYu+ykq5EFM2o7Se9zxNR6FAa2g5QadQa90NKMYxn/VZEQRDo7/pdkw==",
"dependencies": {
"System.Drawing.Common": "4.6.0"
}
@ -106,9 +109,9 @@
},
"Unclassified.NetRevisionTask": {
"type": "Direct",
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "KwOAbbcAoaOIsyszuOv7ZeLEHfata70iM+0h1jMoMXs87EMXr5E8cFYRrCFbJDdd4Do9dK+L3gwNWjfg/ROUWw=="
"requested": "[0.4.0, )",
"resolved": "0.4.0",
"contentHash": "2Tzz6qoQNciyO4uT6wxByMiyvbve+u4eFIiDewDUbeHuxr/rKuba3/EhhXDsEH9WoKzYlpzqxDfQGPE/bIe5Rw=="
},
"WriteableBitmapEx": {
"type": "Direct",
@ -116,15 +119,6 @@
"resolved": "1.6.7",
"contentHash": "GoPhIdYzG/DWJq/MADb8gFzRN5PsxM+1DSJFS8Jzupg4DXqFSnlejYEjJw4ffPEUyELL07O4XIGUZydE4jQK0Q=="
},
"Ben.Demystifier": {
"type": "Transitive",
"resolved": "0.1.6",
"contentHash": "sYI8+ANUo78i/vIq9Vjrjjl6A00yVbT6XsuSVvUMVRVEKJHXZu4VE00RZHg/CA7QxmaQ1zfw/Bs6DAU+OJUNAg==",
"dependencies": {
"System.Reflection.Metadata": "1.6.0",
"System.Threading.Tasks.Extensions": "4.5.3"
}
},
"Castle.Core": {
"type": "Transitive",
"resolved": "4.2.0",
@ -157,13 +151,13 @@
},
"LiteDB": {
"type": "Transitive",
"resolved": "5.0.9",
"contentHash": "cWnNWXL+qaP/qrkUCYZHBUJcv+IsfJfofa+Ed4EyT0zs/gkXqfKvjTbS3uSMBfcd9I7Yf+q9YPmCpmVFrVGQtw=="
"resolved": "5.0.10",
"contentHash": "x70WuqMDuP75dajqSLvO+AnI/BbwS6da+ukTO7rueV7VoXoQ5CRA9FV4r7cOS4OUr2NS1Up7LDIutjCxQycRvg=="
},
"MaterialDesignColors": {
"type": "Transitive",
"resolved": "1.2.7",
"contentHash": "e+shDlaSAJcuTArqtfWjVUgAOlwQlgWq8akkzCGe1MvfV1ozmOqqXyWxg5w0vC/3/KZ84wnPUJeI1wzEpI0uJQ=="
"resolved": "2.0.0",
"contentHash": "+JoghC3QRK0u9Wul1To1ORjcfTbFTVzFPjJ02H7VREOdNzIIn427e8G9gP9hXu9pm1r2OneLnoCG/lTma5cG2w=="
},
"McMaster.NETCore.Plugins": {
"type": "Transitive",
@ -268,8 +262,8 @@
},
"Newtonsoft.Json": {
"type": "Transitive",
"resolved": "12.0.3",
"contentHash": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg=="
"resolved": "13.0.1",
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A=="
},
"Ninject.Extensions.ChildKernel": {
"type": "Transitive",
@ -411,11 +405,10 @@
},
"Serilog.Sinks.Debug": {
"type": "Transitive",
"resolved": "1.0.1",
"contentHash": "nE5wvw9+J/V4lA+rEkFUETGjBabK8IlLQY5Z9KDzoo5LvILC4vhTOXLs7DGYs8h5juIf2nLZnVxHDXf404FqEQ==",
"resolved": "2.0.0",
"contentHash": "Y6g3OBJ4JzTyyw16fDqtFcQ41qQAydnEvEqmXjhwhgjsnG/FaJ8GUqF5ldsC/bVkK8KYmqrPhDO+tm4dF6xx4A==",
"dependencies": {
"Serilog": "2.5.0",
"System.Diagnostics.Debug": "4.3.0"
"Serilog": "2.10.0"
}
},
"Serilog.Sinks.File": {
@ -1237,8 +1230,13 @@
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ=="
"resolved": "4.3.0",
"contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==",
"dependencies": {
"System.Collections": "4.3.0",
"System.Runtime": "4.3.0",
"System.Threading.Tasks": "4.3.0"
}
},
"System.Threading.Timer": {
"type": "Transitive",
@ -1322,19 +1320,19 @@
"type": "Project",
"dependencies": {
"Artemis.Storage": "1.0.0",
"Ben.Demystifier": "0.1.6",
"Ben.Demystifier": "0.3.0",
"EmbedIO": "3.4.3",
"HidSharp": "2.1.0",
"Humanizer.Core": "2.8.26",
"LiteDB": "5.0.9",
"LiteDB": "5.0.10",
"McMaster.NETCore.Plugins": "1.3.1",
"Newtonsoft.Json": "12.0.3",
"Newtonsoft.Json": "13.0.1",
"Ninject": "3.3.4",
"Ninject.Extensions.ChildKernel": "3.3.0",
"Ninject.Extensions.Conventions": "3.3.0",
"Serilog": "2.10.0",
"Serilog.Enrichers.Demystify": "1.0.0-dev-00019",
"Serilog.Sinks.Debug": "1.0.1",
"Serilog.Sinks.Debug": "2.0.0",
"Serilog.Sinks.File": "4.1.0",
"SkiaSharp": "2.80.2",
"System.Buffers": "4.5.1",
@ -1347,7 +1345,7 @@
"artemis.storage": {
"type": "Project",
"dependencies": {
"LiteDB": "5.0.9",
"LiteDB": "5.0.10",
"Serilog": "2.10.0"
}
}

View File

@ -134,15 +134,15 @@
<Resource Include="Resources\Images\Sidebar\sidebar-header.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentValidation" Version="9.3.0" />
<PackageReference Include="FluentValidation" Version="10.0.0" />
<PackageReference Include="Flurl.Http" Version="3.0.1" />
<PackageReference Include="gong-wpf-dragdrop" Version="2.3.2" />
<PackageReference Include="Hardcodet.NotifyIcon.Wpf.NetCore" Version="1.0.18" />
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
<PackageReference Include="MaterialDesignExtensions" Version="3.3.0-a01" />
<PackageReference Include="MaterialDesignThemes" Version="3.2.0" />
<PackageReference Include="MaterialDesignExtensions" Version="3.3.0" />
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.31" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="Ookii.Dialogs.Wpf" Version="3.1.0" />
@ -150,14 +150,14 @@
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="SkiaSharp.Views.WPF" Version="2.80.2" />
<PackageReference Include="SkiaSharp.Vulkan.SharpVk" Version="2.80.2" />
<PackageReference Include="Stylet" Version="1.3.5" />
<PackageReference Include="Stylet" Version="1.3.6" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.0" />
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="System.Management" Version="5.0.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.3.0">
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@ -14,6 +14,7 @@ using Artemis.UI.Services;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services;
using Artemis.UI.Stylet;
using Artemis.UI.Utilities;
using Ninject;
using Serilog;
using Stylet;
@ -47,6 +48,8 @@ namespace Artemis.UI
return;
}
try { DPIAwareness.Initalize(); } catch (Exception ex) { logger.Error($"Failed to set DPI-Awareness: {ex.Message}"); }
IViewManager viewManager = Kernel.Get<IViewManager>();
StartupArguments = Args.ToList();
@ -68,7 +71,7 @@ namespace Artemis.UI
Execute.OnUIThreadSync(() =>
{
UIElement view = viewManager.CreateAndBindViewForModelIfNecessary(RootViewModel);
((TrayViewModel) RootViewModel).SetTaskbarIcon(view);
((TrayViewModel)RootViewModel).SetTaskbarIcon(view);
});
// Initialize the core async so the UI can show the progress

View File

@ -1,11 +1,14 @@
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Media;
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: DisableDpiAwareness]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
@ -15,7 +18,6 @@ using System.Windows;
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,

View File

@ -197,8 +197,8 @@
<materialDesign:PackIcon Kind="Message" />
</Button>
<Button ToolTip="Email" Command="{s:Action OpenUrl}" CommandParameter="https://github.com/SpoinkyNL/Artemis"
Background="{DynamicResource SecondaryAccentBrush}"
Foreground="{DynamicResource SecondaryAccentForegroundBrush}"
Background="{DynamicResource SecondaryHueMidBrush}"
Foreground="{DynamicResource SecondaryHueMidForegroundBrush}"
>
<materialDesign:PackIcon Kind="Email" />
</Button>

View File

@ -15,7 +15,7 @@
<TextBlock Style="{StaticResource MaterialDesignHeadline5TextBlock}" Margin="0 15">Activation requirements</TextBlock>
<TextBlock Margin="0 0 0 15" TextWrapping="Wrap" Style="{StaticResource MaterialDesignTextBlock}">
This module has built-in activation requirements and won't activate until
<Run Text="{Binding ActivationType}" FontWeight="Medium" Foreground="{StaticResource SecondaryAccentBrush}" />. <LineBreak />
<Run Text="{Binding ActivationType}" FontWeight="Medium" Foreground="{StaticResource SecondaryHueMidBrush}" />. <LineBreak />
These requirements allow the module creator to decide when the module is activated and you cannot override them.
</TextBlock>

View File

@ -14,14 +14,15 @@
<TextBox materialDesign:HintAssist.Hint="Profile name"
Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Width="300"
Style="{StaticResource MaterialDesignFilledTextBox}"
Text="{Binding ProfileName, UpdateSourceTrigger=PropertyChanged}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 8 0 0">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 0 8 0" Command="{s:Action Cancel}">
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{s:Action Accept}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 0 0 0" Command="{s:Action Accept}">
ACCEPT
</Button>
</StackPanel>

View File

@ -14,14 +14,15 @@
<TextBox materialDesign:HintAssist.Hint="Profile name"
Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Width="300"
Style="{StaticResource MaterialDesignFilledTextBox}"
Text="{Binding ProfileName, UpdateSourceTrigger=PropertyChanged}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 8 0 0">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 0 8 0" Command="{s:Action Cancel}">
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{s:Action Accept}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 0 0 0" Command="{s:Action Accept}">
ACCEPT
</Button>
</StackPanel>

View File

@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Margin="16" Width="800">
@ -37,14 +38,16 @@
the person who exported it, you'll have to select LEDs for each layer in the profile.
</TextBlock>
<avalonedit:TextEditor Grid.Row="3" SyntaxHighlighting="JavaScript"
FontFamily="pack://application:,,,/Resources/Fonts/#Roboto Mono"
FontSize="10pt"
Document="{Binding Document}"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto"
Height="500"
Padding="10" />
<TextBox Grid.Row="3"
Text="{Binding ProfileJson}"
Style="{StaticResource MaterialDesignOutlinedTextBox}"
FontFamily="Consolas"
VerticalAlignment="Top"
Height="400"
AcceptsReturn="True"
VerticalScrollBarVisibility="Auto"
materialDesign:HintAssist.Hint="Paste profile JSON here"
Margin="16" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="4">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">

View File

@ -2,7 +2,6 @@
using Artemis.Core.Modules;
using Artemis.Core.Services;
using Artemis.UI.Shared.Services;
using ICSharpCode.AvalonEdit.Document;
namespace Artemis.UI.Screens.ProfileEditor.Dialogs
{
@ -15,15 +14,13 @@ namespace Artemis.UI.Screens.ProfileEditor.Dialogs
public ProfileImportViewModel(ProfileModule profileModule, IProfileService profileService, IMessageService messageService)
{
ProfileModule = profileModule;
Document = new TextDocument();
_profileService = profileService;
_messageService = messageService;
}
public ProfileModule ProfileModule { get; }
public TextDocument Document { get; set; }
public string ProfileJson
{
get => _profileJson;
@ -32,7 +29,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Dialogs
public void Accept()
{
ProfileDescriptor descriptor = _profileService.ImportProfile(Document.Text, ProfileModule);
ProfileDescriptor descriptor = _profileService.ImportProfile(ProfileJson, ProfileModule);
_messageService.ShowMessage("Profile imported.");
Session.Close(descriptor);
}

View File

@ -15,25 +15,16 @@
<TextBox materialDesign:HintAssist.Hint="Element name"
Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Width="300"
Style="{StaticResource MaterialDesignFilledTextBox}"
Text="{Binding ElementName, UpdateSourceTrigger=PropertyChanged}"
Loaded="FrameworkElement_OnLoaded" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
False
</system:Boolean>
</Button.CommandParameter>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0 8 0 0">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 0 8 0" Command="{s:Action Cancel}">
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{s:Action Accept}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
True
</system:Boolean>
</Button.CommandParameter>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 0 0 0" Command="{s:Action Accept}">
ACCEPT
</Button>
</StackPanel>

View File

@ -29,15 +29,16 @@
Panel.ZIndex="2">
<Grid Margin="10 5">
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition Height="48" />
<RowDefinition Height="48" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ComboBox Grid.Row="0"
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
Style="{StaticResource MaterialDesignFilledComboBox}"
Margin="0 5"
materialDesign:HintAssist.Hint="Data binding mode"
MinWidth="128"
SelectedValue="{Binding SelectedDataBindingMode}"
@ -45,17 +46,18 @@
SelectedValuePath="Value"
DisplayMemberPath="Description" />
<StackPanel Grid.Row="1">
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Text="{Binding EasingTime}"
materialDesign:TextFieldAssist.HasClearButton="True"
materialDesign:TextFieldAssist.SuffixText="ms"
materialDesign:HintAssist.Hint="Easing time"
IsEnabled="{Binding IsDataBindingEnabled}" />
</StackPanel>
<TextBox Grid.Row="1"
Style="{StaticResource MaterialDesignFilledTextBox}"
Margin="0 5"
Text="{Binding EasingTime}"
materialDesign:TextFieldAssist.HasClearButton="True"
materialDesign:TextFieldAssist.SuffixText="ms"
materialDesign:HintAssist.Hint="Easing time"
IsEnabled="{Binding IsDataBindingEnabled}" />
<ComboBox Grid.Row="2"
Style="{StaticResource MaterialDesignFloatingHintComboBox}"
Style="{StaticResource MaterialDesignFilledComboBox}"
Margin="0 5"
materialDesign:HintAssist.Hint="Easing type"
MinWidth="128"
IsEnabled="{Binding IsEasingTimeEnabled}"

View File

@ -247,7 +247,7 @@
MouseUp="{s:Action TimelineMouseUp}"
MouseMove="{s:Action TimelineMouseMove}"
Points="-8,0 -8,8 0,20, 8,8 8,0"
Fill="{StaticResource SecondaryAccentBrush}" />
Fill="{StaticResource SecondaryHueMidBrush}" />
<Line Canvas.Left="{Binding TimeCaretPosition}"
Cursor="SizeWE"
MouseDown="{s:Action TimelineMouseDown}"
@ -258,7 +258,7 @@
Y1="0"
Y2="{Binding ActualHeight, ElementName=TimelineHeaderScrollViewer}"
StrokeThickness="2"
Stroke="{StaticResource SecondaryAccentBrush}" />
Stroke="{StaticResource SecondaryHueMidBrush}" />
</Canvas>
</ScrollViewer>
@ -281,7 +281,7 @@
Y1="0"
Y2="{Binding ActualHeight, ElementName=RailsGrid}"
StrokeThickness="2"
Stroke="{StaticResource SecondaryAccentBrush}" />
Stroke="{StaticResource SecondaryHueMidBrush}" />
</Canvas>
<ContentControl Grid.Column="0" s:View.Model="{Binding TimelineViewModel}" x:Name="PropertyTimeLine" />

View File

@ -16,9 +16,9 @@
<TextBox materialDesign:HintAssist.Hint="Segment length"
materialDesign:TextFieldAssist.SuffixText="seconds"
Margin="0 8 0 16"
Margin="0 16"
Text="{Binding InputValue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}" />
Style="{StaticResource MaterialDesignFilledTextBox}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0" Command="{s:Action Cancel}">
@ -29,7 +29,7 @@
</Button.CommandParameter>
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0" Command="{s:Action Accept}">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0" Command="{s:Action Accept}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
True

View File

@ -54,12 +54,10 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline.Dialogs
RuleFor(m => m.InputValue)
.Must(ValidateTime)
.WithMessage("Input cannot be converted to a time");
RuleFor(m => m.InputValue)
.Transform(CreateTime)
Transform(m => m.InputValue, CreateTime)
.GreaterThanOrEqualTo(TimeSpan.FromMilliseconds(100))
.WithMessage("Minimum timeline length is 100ms");
RuleFor(m => m.InputValue)
.Transform(CreateTime)
Transform(m => m.InputValue, CreateTime)
.LessThanOrEqualTo(TimeSpan.FromHours(24))
.WithMessage("Maximum timeline length is 24 hours");
}

View File

@ -45,28 +45,28 @@
<!-- Mutation points -->
<Rectangle x:Name="ResizeTopCenter"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
MouseMove="ResizeOnMouseMove" />
<Rectangle x:Name="ResizeRightCenter"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
MouseMove="ResizeOnMouseMove" />
<Rectangle x:Name="ResizeBottomCenter"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
MouseMove="ResizeOnMouseMove" />
<Rectangle x:Name="ResizeLeftCenter"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
@ -74,28 +74,28 @@
<Rectangle x:Name="ResizeTopLeft"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
MouseMove="ResizeOnMouseMove" />
<Rectangle x:Name="ResizeTopRight"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
MouseMove="ResizeOnMouseMove" />
<Rectangle x:Name="ResizeBottomRight"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
MouseMove="ResizeOnMouseMove" />
<Rectangle x:Name="ResizeBottomLeft"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="Hand"
MouseDown="ResizeOnMouseDown"
MouseUp="ResizeOnMouseUp"
@ -104,7 +104,7 @@
<!-- Anchor point -->
<Ellipse x:Name="AnchorPoint"
Fill="White"
Stroke="{DynamicResource SecondaryAccentBrush}"
Stroke="{DynamicResource SecondaryHueMidBrush}"
Cursor="SizeAll"
MouseDown="MoveOnMouseDown"
MouseUp="MoveOnMouseUp"

View File

@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
using System.Globalization;
using System.Reflection;
using System.Threading.Tasks;
using System.Timers;
@ -20,6 +19,7 @@ using MaterialDesignExtensions.Controls;
using MaterialDesignThemes.Wpf;
using Ninject;
using Stylet;
using Constants = Artemis.Core.Constants;
namespace Artemis.UI.Screens
{

View File

@ -15,6 +15,7 @@ using Ookii.Dialogs.Wpf;
using RGB.NET.Layout;
using SkiaSharp;
using Stylet;
using Constants = Artemis.Core.Constants;
namespace Artemis.UI.Screens.Settings.Device
{

View File

@ -24,7 +24,7 @@
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="40"/>
<ColumnDefinition Width="40" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0">
@ -35,22 +35,22 @@
<TextBox materialDesign:HintAssist.Hint="X-coordinate"
materialDesign:TextFieldAssist.SuffixText="mm"
Text="{Binding X, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Style="{StaticResource MaterialDesignFilledTextBox}"
Margin="0 5" />
<TextBox materialDesign:HintAssist.Hint="Y-coordinate"
materialDesign:TextFieldAssist.SuffixText="mm"
Text="{Binding Y, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Style="{StaticResource MaterialDesignFilledTextBox}"
Margin="0 5" />
<TextBox materialDesign:HintAssist.Hint="Scale"
materialDesign:TextFieldAssist.SuffixText="times"
Text="{Binding Scale, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Style="{StaticResource MaterialDesignFilledTextBox}"
Margin="0 5" />
<TextBox materialDesign:HintAssist.Hint="Rotation"
materialDesign:TextFieldAssist.SuffixText="deg"
Text="{Binding Rotation, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Style="{StaticResource MaterialDesignFilledTextBox}"
Margin="0 5 0 12" />
</StackPanel>
@ -68,7 +68,7 @@
Use the sliders below to adjust the colors of your device so that it matches your other devices.
</TextBlock>
<Grid>
<Grid Margin="0 3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
@ -84,12 +84,14 @@
VerticalAlignment="Center" />
<TextBox Grid.Column="2"
VerticalAlignment="Center"
Style="{StaticResource MaterialDesignFilledTextBox}"
Width="70"
Text="{Binding RedScale, StringFormat={}{0:0.0}, UpdateSourceTrigger=PropertyChanged}"
materialDesign:TextFieldAssist.SuffixText="%"
Width="50" />
materialDesign:HintAssist.IsFloating="False" />
</Grid>
<Grid>
<Grid Margin="0 3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
@ -105,12 +107,14 @@
VerticalAlignment="Center" />
<TextBox Grid.Column="2"
VerticalAlignment="Center"
Style="{StaticResource MaterialDesignFilledTextBox}"
Width="70"
Text="{Binding GreenScale, StringFormat={}{0:0.0}, UpdateSourceTrigger=PropertyChanged}"
materialDesign:TextFieldAssist.SuffixText="%"
Width="50" />
materialDesign:HintAssist.IsFloating="False" />
</Grid>
<Grid>
<Grid Margin="0 2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
@ -127,12 +131,14 @@
VerticalAlignment="Center" />
<TextBox Grid.Column="2"
VerticalAlignment="Center"
Style="{StaticResource MaterialDesignFilledTextBox}"
Width="70"
Text="{Binding BlueScale, StringFormat={}{0:0.0}, UpdateSourceTrigger=PropertyChanged}"
materialDesign:TextFieldAssist.SuffixText="%"
Width="50" />
materialDesign:HintAssist.IsFloating="False" />
</Grid>
<Grid Margin="0 28 0 0">
<Grid Margin="0 3 0 0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
@ -142,9 +148,9 @@
Content="Show preview"
VerticalAlignment="Center" />
<shared:ColorPicker Grid.Column="1"
Margin="0,0,5,0"
HorizontalAlignment="Right"
Color="{Binding CurrentColor, Converter={StaticResource SKColorToColorConverter}}"
TextBoxStyle="{StaticResource MaterialDesignFilledTextBox}"
VerticalAlignment="Center" />
</Grid>
</StackPanel>
@ -161,7 +167,7 @@
Select a custom layout below if you want to change the appearance and/or LEDs of this device.
</TextBlock>
<TextBox Style="{StaticResource MaterialDesignFloatingHintTextBox}"
<TextBox Style="{StaticResource MaterialDesignFilledTextBox}"
Text="{Binding Device.CustomLayoutPath}"
VerticalAlignment="Center"
materialDesign:TextFieldAssist.HasClearButton="True"
@ -177,15 +183,15 @@
</StackPanel>
<!-- Buttons -->
<Grid Grid.Row="1" >
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Grid.Column="0"
Style="{StaticResource MaterialDesignOutlinedButton}"
Margin="0 8 8 0"
Command="{s:Action SelectPhysicalLayout}"
<Button Grid.Column="0"
Style="{StaticResource MaterialDesignOutlinedButton}"
Margin="0 8 8 0"
Command="{s:Action SelectPhysicalLayout}"
ToolTip="Restart device setup, allowing you to select a new physical and logical layout">
RESTART SETUP
</Button>
@ -199,6 +205,6 @@
</Button>
</StackPanel>
</Grid>
</Grid>
</UserControl>

View File

@ -77,7 +77,12 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<TextBox Text="{Binding AutoRunDelay}" IsEnabled="{Binding StartWithWindows}" Width="80" materialDesign:TextFieldAssist.SuffixText="sec"/>
<TextBox Style="{StaticResource MaterialDesignFilledTextBox}"
Text="{Binding AutoRunDelay}"
IsEnabled="{Binding StartWithWindows}"
Width="100"
materialDesign:TextFieldAssist.SuffixText="sec"
materialDesign:HintAssist.IsFloating="false"/>
</StackPanel>
</Grid>
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
@ -98,7 +103,13 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<ComboBox Width="80" SelectedValue="{Binding SelectedColorScheme}" ItemsSource="{Binding ColorSchemes}" SelectedValuePath="Value" DisplayMemberPath="Description" />
<ComboBox Style="{StaticResource MaterialDesignFilledComboBox}"
Width="100"
SelectedValue="{Binding SelectedColorScheme}"
ItemsSource="{Binding ColorSchemes}"
SelectedValuePath="Value"
DisplayMemberPath="Description"
materialDesign:HintAssist.IsFloating="false"/>
</StackPanel>
</Grid>
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
@ -119,7 +130,13 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<ComboBox Width="80" SelectedValue="{Binding SelectedLogLevel}" ItemsSource="{Binding LogLevels}" SelectedValuePath="Value" DisplayMemberPath="Description" />
<ComboBox Style="{StaticResource MaterialDesignFilledComboBox}"
Width="100"
SelectedValue="{Binding SelectedLogLevel}"
ItemsSource="{Binding LogLevels}"
SelectedValuePath="Value"
DisplayMemberPath="Description"
materialDesign:HintAssist.IsFloating="false"/>
</StackPanel>
</Grid>
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
@ -169,7 +186,8 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<TextBox Text="{Binding WebServerPortSetting.Value}" Width="80" />
<TextBox Style="{StaticResource MaterialDesignFilledTextBox}" Text="{Binding WebServerPortSetting.Value}" Width="100"
materialDesign:HintAssist.IsFloating="false"/>
</StackPanel>
</Grid>
</StackPanel>
@ -287,12 +305,11 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<ComboBox Width="132"
Margin="0 2"
Padding="0 -1"
Height="15"
<ComboBox Style="{StaticResource MaterialDesignFilledComboBox}"
Width="150"
materialDesign:ComboBoxAssist.ClassicMode="True"
materialDesign:ValidationAssist.UsePopup="True"
materialDesign:HintAssist.IsFloating="false"
HorizontalAlignment="Left"
ItemsSource="{Binding Path=LayerBrushDescriptors}"
SelectedValue="{Binding Path=SelectedLayerBrushDescriptor}"
@ -324,7 +341,10 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<ComboBox Width="80" SelectedItem="{Binding PreferredGraphicsContext}" >
<ComboBox Style="{StaticResource MaterialDesignFilledComboBox}"
Width="100"
SelectedItem="{Binding PreferredGraphicsContext}"
materialDesign:HintAssist.IsFloating="false">
<system:String>Software</system:String>
<system:String>Vulkan</system:String>
</ComboBox>
@ -348,7 +368,12 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<ComboBox Width="80" SelectedItem="{Binding SelectedRenderScale}" ItemsSource="{Binding RenderScales}" DisplayMemberPath="Item1" />
<ComboBox Style="{StaticResource MaterialDesignFilledComboBox}"
Width="100"
SelectedItem="{Binding SelectedRenderScale}"
ItemsSource="{Binding RenderScales}"
DisplayMemberPath="Item1"
materialDesign:HintAssist.IsFloating="false"/>
</StackPanel>
</Grid>
<Separator Style="{StaticResource MaterialDesignSeparator}" Margin="-15 5" />
@ -369,7 +394,12 @@
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="0" Grid.Column="1" VerticalAlignment="Center">
<ComboBox Width="80" SelectedItem="{Binding SelectedTargetFrameRate}" ItemsSource="{Binding TargetFrameRates}" DisplayMemberPath="Item1" />
<ComboBox Style="{StaticResource MaterialDesignFilledComboBox}"
Width="100"
SelectedItem="{Binding SelectedTargetFrameRate}"
ItemsSource="{Binding TargetFrameRates}"
DisplayMemberPath="Item1"
materialDesign:HintAssist.IsFloating="false"/>
</StackPanel>
</Grid>
</StackPanel>

View File

@ -25,10 +25,15 @@
The list below shows all loaded plugins. <LineBreak />
If you're missing something, view your logs folder.
</TextBlock>
<materialDesign:PackIcon Grid.Column="1" Kind="Search" VerticalAlignment="Top" Margin="15 5 0 0" />
<materialDesign:PackIcon Grid.Column="1"
Kind="Search"
VerticalAlignment="Top"
Margin="15 8 0 0" />
<TextBox Grid.Column="2"
Style="{StaticResource MaterialDesignFilledTextBox}"
materialDesign:TextFieldAssist.HasClearButton="True"
materialDesign:HintAssist.Hint="Search plugin"
materialDesign:HintAssist.IsFloating="False"
VerticalAlignment="Top"
Margin="5 0"
Text="{Binding SearchPluginInput, Delay=300, UpdateSourceTrigger=PropertyChanged}" />
@ -51,7 +56,7 @@
Margin="15 0 15 15">
<ListBox.ItemTemplate>
<DataTemplate>
<ContentControl s:View.Model="{Binding IsAsync=True}" Margin="5" HorizontalAlignment="Center" IsTabStop="False" />
<ContentControl s:View.Model="{Binding IsAsync=True}" Margin="5" HorizontalAlignment="Center" IsTabStop="False" />
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>

View File

@ -11,6 +11,7 @@ using Artemis.UI.Shared.Services;
using MaterialDesignThemes.Wpf;
using Ninject;
using Stylet;
using Constants = Artemis.Core.Constants;
namespace Artemis.UI.Screens.Settings.Tabs.Plugins
{

View File

@ -1,41 +0,0 @@
<UserControl x:Class="Artemis.UI.Screens.SurfaceEditor.Dialogs.SurfaceCreateView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
mc:Ignorable="d"
d:DesignHeight="213.053" d:DesignWidth="254.425">
<StackPanel Margin="16">
<TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}">
Add a new surface layout
</TextBlock>
<TextBox materialDesign:HintAssist.Hint="Layout name"
Margin="0 8 0 16"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Text="{Binding SurfaceName, UpdateSourceTrigger=PropertyChanged}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
Command="{s:Action Cancel}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
False
</system:Boolean>
</Button.CommandParameter>
CANCEL
</Button>
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 8 0"
Command="{s:Action Accept}">
<Button.CommandParameter>
<system:Boolean xmlns:system="clr-namespace:System;assembly=mscorlib">
True
</system:Boolean>
</Button.CommandParameter>
ACCEPT
</Button>
</StackPanel>
</StackPanel>
</UserControl>

View File

@ -1,31 +0,0 @@
using System.Threading.Tasks;
using Artemis.UI.Shared.Services;
using Stylet;
namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
{
public class SurfaceCreateViewModel : DialogViewModelBase
{
private string _surfaceName;
public SurfaceCreateViewModel(IModelValidator<SurfaceCreateViewModel> validator) : base(validator)
{
}
public string SurfaceName
{
get => _surfaceName;
set => SetAndNotify(ref _surfaceName, value);
}
public async Task Accept()
{
await ValidateAsync();
if (HasErrors)
return;
Session.Close(SurfaceName);
}
}
}

View File

@ -1,12 +0,0 @@
using FluentValidation;
namespace Artemis.UI.Screens.SurfaceEditor.Dialogs
{
public class SurfaceCreateViewModelValidator : AbstractValidator<SurfaceCreateViewModel>
{
public SurfaceCreateViewModelValidator()
{
RuleFor(m => m.SurfaceName).NotEmpty().WithMessage("Layout name may not be empty");
}
}
}

View File

@ -18,6 +18,7 @@ using Flurl;
using Flurl.Http;
using MaterialDesignThemes.Wpf;
using Serilog;
using Constants = Artemis.Core.Constants;
using File = System.IO.File;
namespace Artemis.UI.Services

View File

@ -0,0 +1,36 @@
using System.Runtime.InteropServices;
namespace Artemis.UI.Utilities
{
public static class DPIAwareness
{
[DllImport("user32.dll", SetLastError = true)]
internal static extern bool SetProcessDpiAwarenessContext(int dpiFlag);
[DllImport("SHCore.dll", SetLastError = true)]
internal static extern bool SetProcessDpiAwareness(PROCESS_DPI_AWARENESS awareness);
[DllImport("user32.dll")]
internal static extern bool SetProcessDPIAware();
internal enum PROCESS_DPI_AWARENESS
{
Process_DPI_Unaware = 0,
Process_System_DPI_Aware = 1,
Process_Per_Monitor_DPI_Aware = 2
}
internal enum DPI_AWARENESS_CONTEXT
{
DPI_AWARENESS_CONTEXT_UNAWARE = 16,
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = 17,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = 18,
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = 34
}
public static void Initalize()
{
SetProcessDpiAwarenessContext((int)DPI_AWARENESS_CONTEXT.DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
}
}
}

View File

@ -4,9 +4,9 @@
".NETCoreApp,Version=v5.0": {
"FluentValidation": {
"type": "Direct",
"requested": "[9.3.0, )",
"resolved": "9.3.0",
"contentHash": "C44l6Ih+YwpED/TsXfl6LIq6Z4wLXahstnr6T70uUg1Hs7/bLBKKAo9Nl0sLhVjDE8TA+fF+O3IM4nDrwabcSQ=="
"requested": "[10.0.0, )",
"resolved": "10.0.0",
"contentHash": "jNFPbLjBy/bfIWx4BV/WVEsS+1OxBVf22mmSdvVa9RCHJDkNhAjbKZkxgA0s1rYNFxVn+a1fQbos95t4j/z3Zg=="
},
"Flurl.Http": {
"type": "Direct",
@ -43,9 +43,9 @@
},
"MaterialDesignExtensions": {
"type": "Direct",
"requested": "[3.3.0-a01, )",
"resolved": "3.3.0-a01",
"contentHash": "dq8lvcj73H6TCmhjlRud8EeUSgC8S2U7T4jOoefmLieZQigbfQNy29hF1041cnu6b3l8mW00zWJituRMSt0iOQ==",
"requested": "[3.3.0, )",
"resolved": "3.3.0",
"contentHash": "dlxWtdrMH8aHNib3dWJhNQ/nNiA2b/CNvr90w/5KB6erTisuTpyYVx2l2+UGCZvwhSX5mHTHQYHfjgAKbDrgjg==",
"dependencies": {
"MaterialDesignColors": "1.2.7",
"MaterialDesignThemes": "3.2.0"
@ -53,11 +53,11 @@
},
"MaterialDesignThemes": {
"type": "Direct",
"requested": "[3.2.0, )",
"resolved": "3.2.0",
"contentHash": "aOZQShQuV7sCWOwO98dYz1S4stmIWDBH+Q6KoR3wDiDyuG7twoGnBDzQBhrxuS16I3GQiG5nfvUjEJFVc/zdKg==",
"requested": "[4.0.0, )",
"resolved": "4.0.0",
"contentHash": "+n5oWHuRiYL/gUw2XfQHCRZqHtU8KbrdurgU0IcO98Zsyhw4BvggodfXY8veRtbjjmM9EJ/sG2yKBrgPOGX4JQ==",
"dependencies": {
"MaterialDesignColors": "[1.2.7, 2.0.0)"
"MaterialDesignColors": "2.0.0"
}
},
"Microsoft.Win32.Registry": {
@ -72,9 +72,9 @@
},
"Microsoft.Xaml.Behaviors.Wpf": {
"type": "Direct",
"requested": "[1.1.19, )",
"resolved": "1.1.19",
"contentHash": "5sPWkbqImc2t1aQwIfJcKsUo7tOg1Tr8+6xVzZJB56Nzt4u9NlpcLofgdX/aRYpPKdWDA3U23Akw1KQzU5e82g=="
"requested": "[1.1.31, )",
"resolved": "1.1.31",
"contentHash": "LZpuf82ACZWldmfMuv3CTUMDh3o0xo0uHUaybR5HgqVLDBJJ9RZLykplQ/bTJd0/VDt3EhD4iDgUgbdIUAM+Kg=="
},
"Ninject": {
"type": "Direct",
@ -138,9 +138,9 @@
},
"Stylet": {
"type": "Direct",
"requested": "[1.3.5, )",
"resolved": "1.3.5",
"contentHash": "9vjjaTgf5sZAGHnxQWIslD32MG5gXj7ANgS+w965L5Eh//UC3qwZDrEf226Pf+v1P/ldAJDpUySnOyGlb3TSSw==",
"requested": "[1.3.6, )",
"resolved": "1.3.6",
"contentHash": "SISR+DsPrgBww3AI5FtHx1tD9VkEfJWZYu+ykq5EFM2o7Se9zxNR6FAa2g5QadQa90NKMYxn/VZEQRDo7/pdkw==",
"dependencies": {
"System.Drawing.Common": "4.6.0"
}
@ -159,9 +159,9 @@
},
"System.Drawing.Common": {
"type": "Direct",
"requested": "[5.0.0, )",
"resolved": "5.0.0",
"contentHash": "SztFwAnpfKC8+sEKXAFxCBWhKQaEd97EiOL7oZJZP56zbqnLpmxACWA8aGseaUExciuEAUuR9dY8f7HkTRAdnw==",
"requested": "[5.0.2, )",
"resolved": "5.0.2",
"contentHash": "rvr/M1WPf24ljpvvrVd74+NdjRUJu1bBkspkZcnzSZnmAUQWSvanlQ0k/hVHk+cHufZbZfu7vOh/vYc0q5Uu/A==",
"dependencies": {
"Microsoft.Win32.SystemEvents": "5.0.0"
}
@ -191,22 +191,16 @@
},
"Unclassified.NetRevisionTask": {
"type": "Direct",
"requested": "[0.3.0, )",
"resolved": "0.3.0",
"contentHash": "KwOAbbcAoaOIsyszuOv7ZeLEHfata70iM+0h1jMoMXs87EMXr5E8cFYRrCFbJDdd4Do9dK+L3gwNWjfg/ROUWw=="
},
"AvalonEdit": {
"type": "Transitive",
"resolved": "6.0.1",
"contentHash": "JmRwKMDRUUkUGLQmTtIHiSgFSQH9567b2/55Wa/gQp+ZtxQN+mnl5Qt6B/Kgz56FMnnDyE/fV23r7J2SV+NP7g=="
"requested": "[0.4.0, )",
"resolved": "0.4.0",
"contentHash": "2Tzz6qoQNciyO4uT6wxByMiyvbve+u4eFIiDewDUbeHuxr/rKuba3/EhhXDsEH9WoKzYlpzqxDfQGPE/bIe5Rw=="
},
"Ben.Demystifier": {
"type": "Transitive",
"resolved": "0.1.6",
"contentHash": "sYI8+ANUo78i/vIq9Vjrjjl6A00yVbT6XsuSVvUMVRVEKJHXZu4VE00RZHg/CA7QxmaQ1zfw/Bs6DAU+OJUNAg==",
"resolved": "0.3.0",
"contentHash": "7mTSt0PLeXomarrTXdLcdYAg+zaOunw3KEvWKQ0fQaGySwqOzGxKVq8BDgUXWAyBH2hKhXldkG7uKJGkYBhDiw==",
"dependencies": {
"System.Reflection.Metadata": "1.6.0",
"System.Threading.Tasks.Extensions": "4.5.3"
"System.Reflection.Metadata": "5.0.0"
}
},
"Castle.Core": {
@ -251,13 +245,13 @@
},
"LiteDB": {
"type": "Transitive",
"resolved": "5.0.9",
"contentHash": "cWnNWXL+qaP/qrkUCYZHBUJcv+IsfJfofa+Ed4EyT0zs/gkXqfKvjTbS3uSMBfcd9I7Yf+q9YPmCpmVFrVGQtw=="
"resolved": "5.0.10",
"contentHash": "x70WuqMDuP75dajqSLvO+AnI/BbwS6da+ukTO7rueV7VoXoQ5CRA9FV4r7cOS4OUr2NS1Up7LDIutjCxQycRvg=="
},
"MaterialDesignColors": {
"type": "Transitive",
"resolved": "1.2.7",
"contentHash": "e+shDlaSAJcuTArqtfWjVUgAOlwQlgWq8akkzCGe1MvfV1ozmOqqXyWxg5w0vC/3/KZ84wnPUJeI1wzEpI0uJQ=="
"resolved": "2.0.0",
"contentHash": "+JoghC3QRK0u9Wul1To1ORjcfTbFTVzFPjJ02H7VREOdNzIIn427e8G9gP9hXu9pm1r2OneLnoCG/lTma5cG2w=="
},
"McMaster.NETCore.Plugins": {
"type": "Transitive",
@ -362,8 +356,8 @@
},
"Newtonsoft.Json": {
"type": "Transitive",
"resolved": "12.0.3",
"contentHash": "6mgjfnRB4jKMlzHSl+VD+oUc1IebOZabkbyWj2RiTgWwYPPuaK1H97G1sHqGwPlS5npiF5Q0OrxN1wni2n5QWg=="
"resolved": "13.0.1",
"contentHash": "ppPFpBcvxdsfUonNcvITKqLl3bqxWbDCZIzDWHzjpdAHRFfZe0Dw9HmA0+za13IdyrgJwpkDTDA9fHaxOrt20A=="
},
"Ninject.Extensions.ChildKernel": {
"type": "Transitive",
@ -500,11 +494,10 @@
},
"Serilog.Sinks.Debug": {
"type": "Transitive",
"resolved": "1.0.1",
"contentHash": "nE5wvw9+J/V4lA+rEkFUETGjBabK8IlLQY5Z9KDzoo5LvILC4vhTOXLs7DGYs8h5juIf2nLZnVxHDXf404FqEQ==",
"resolved": "2.0.0",
"contentHash": "Y6g3OBJ4JzTyyw16fDqtFcQ41qQAydnEvEqmXjhwhgjsnG/FaJ8GUqF5ldsC/bVkK8KYmqrPhDO+tm4dF6xx4A==",
"dependencies": {
"Serilog": "2.5.0",
"System.Diagnostics.Debug": "4.3.0"
"Serilog": "2.10.0"
}
},
"Serilog.Sinks.File": {
@ -1358,8 +1351,13 @@
},
"System.Threading.Tasks.Extensions": {
"type": "Transitive",
"resolved": "4.5.3",
"contentHash": "+MvhNtcvIbqmhANyKu91jQnvIRVSTiaOiFNfKWwXGHG48YAb4I/TyH8spsySiPYla7gKal5ZnF3teJqZAximyQ=="
"resolved": "4.3.0",
"contentHash": "npvJkVKl5rKXrtl1Kkm6OhOUaYGEiF9wFbppFRWSMoApKzt2PiPHT2Bb8a5sAWxprvdOAtvaARS9QYMznEUtug==",
"dependencies": {
"System.Collections": "4.3.0",
"System.Runtime": "4.3.0",
"System.Threading.Tasks": "4.3.0"
}
},
"System.Threading.Timer": {
"type": "Transitive",
@ -1443,19 +1441,19 @@
"type": "Project",
"dependencies": {
"Artemis.Storage": "1.0.0",
"Ben.Demystifier": "0.1.6",
"Ben.Demystifier": "0.3.0",
"EmbedIO": "3.4.3",
"HidSharp": "2.1.0",
"Humanizer.Core": "2.8.26",
"LiteDB": "5.0.9",
"LiteDB": "5.0.10",
"McMaster.NETCore.Plugins": "1.3.1",
"Newtonsoft.Json": "12.0.3",
"Newtonsoft.Json": "13.0.1",
"Ninject": "3.3.4",
"Ninject.Extensions.ChildKernel": "3.3.0",
"Ninject.Extensions.Conventions": "3.3.0",
"Serilog": "2.10.0",
"Serilog.Enrichers.Demystify": "1.0.0-dev-00019",
"Serilog.Sinks.Debug": "1.0.1",
"Serilog.Sinks.Debug": "2.0.0",
"Serilog.Sinks.File": "4.1.0",
"SkiaSharp": "2.80.2",
"System.Buffers": "4.5.1",
@ -1468,7 +1466,7 @@
"artemis.storage": {
"type": "Project",
"dependencies": {
"LiteDB": "5.0.9",
"LiteDB": "5.0.10",
"Serilog": "2.10.0"
}
},
@ -1476,17 +1474,17 @@
"type": "Project",
"dependencies": {
"Artemis.Core": "1.0.0",
"AvalonEdit": "6.0.1",
"Ben.Demystifier": "0.3.0",
"Humanizer.Core": "2.8.26",
"MaterialDesignExtensions": "3.3.0-a01",
"MaterialDesignThemes": "3.2.0",
"Microsoft.Xaml.Behaviors.Wpf": "1.1.19",
"MaterialDesignExtensions": "3.3.0",
"MaterialDesignThemes": "4.0.0",
"Microsoft.Xaml.Behaviors.Wpf": "1.1.31",
"Ninject": "3.3.4",
"Ninject.Extensions.Conventions": "3.3.0",
"SharpVectors.Reloaded": "1.7.1",
"SkiaSharp": "2.80.2",
"SkiaSharp.Views.WPF": "2.80.2",
"Stylet": "1.3.5",
"Stylet": "1.3.6",
"System.Buffers": "4.5.1",
"System.Numerics.Vectors": "4.5.0",
"WriteableBitmapEx": "1.6.7"