diff --git a/src/Artemis.Core/Artemis.Core.csproj b/src/Artemis.Core/Artemis.Core.csproj index cdc21cdbd..4919162c0 100644 --- a/src/Artemis.Core/Artemis.Core.csproj +++ b/src/Artemis.Core/Artemis.Core.csproj @@ -96,8 +96,8 @@ ..\packages\SkiaSharp.1.68.2-preview.29\lib\net45\SkiaSharp.dll - - ..\packages\Stylet.1.3.0\lib\net45\Stylet.dll + + ..\packages\Stylet.1.3.1\lib\net45\Stylet.dll diff --git a/src/Artemis.Core/Models/Profile/Layer.cs b/src/Artemis.Core/Models/Profile/Layer.cs index d35a50833..cd55329db 100644 --- a/src/Artemis.Core/Models/Profile/Layer.cs +++ b/src/Artemis.Core/Models/Profile/Layer.cs @@ -522,11 +522,11 @@ namespace Artemis.Core.Models.Profile // Transform var transform = new LayerProperty(this, "Core.Transform", "Transform", "A collection of transformation properties.") {ExpandByDefault = true}; - AnchorPointProperty = new LayerProperty(this, transform, "Core.AnchorPoint", "Anchor Point", "The point at which the shape is attached to its position."); - PositionProperty = new LayerProperty(this, transform, "Core.Position", "Position", "The position of the shape."); - ScaleProperty = new LayerProperty(this, transform, "Core.Scale", "Scale", "The scale of the shape.") {InputAffix = "%"}; + AnchorPointProperty = new LayerProperty(this, transform, "Core.AnchorPoint", "Anchor Point", "The point at which the shape is attached to its position.") {InputStepSize = 0.001f}; + PositionProperty = new LayerProperty(this, transform, "Core.Position", "Position", "The position of the shape.") {InputStepSize = 0.001f}; + ScaleProperty = new LayerProperty(this, transform, "Core.Scale", "Scale", "The scale of the shape.") {InputAffix = "%", MinInputValue = 0f}; RotationProperty = new LayerProperty(this, transform, "Core.Rotation", "Rotation", "The rotation of the shape in degrees.") {InputAffix = "°"}; - OpacityProperty = new LayerProperty(this, transform, "Core.Opacity", "Opacity", "The opacity of the shape.") {InputAffix = "%"}; + OpacityProperty = new LayerProperty(this, transform, "Core.Opacity", "Opacity", "The opacity of the shape.") {InputAffix = "%", MinInputValue = 0f, MaxInputValue = 100f}; ScaleProperty.Value = new SKSize(100, 100); OpacityProperty.Value = 100; diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs b/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs index a8d577407..bbfc7091d 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs +++ b/src/Artemis.Core/Models/Profile/LayerProperties/BaseLayerProperty.cs @@ -24,6 +24,7 @@ namespace Artemis.Core.Models.Profile.LayerProperties Description = description; Type = type; CanUseKeyframes = true; + InputStepSize = 1; // This can only be null if accessed internally if (PluginInfo == null) @@ -32,6 +33,7 @@ namespace Artemis.Core.Models.Profile.LayerProperties Children = new List(); BaseKeyframes = new List(); + parent?.Children.Add(this); } @@ -86,6 +88,21 @@ namespace Artemis.Core.Models.Profile.LayerProperties /// public string InputAffix { get; set; } + /// + /// Gets or sets an optional maximum input value, only enforced in the UI. + /// + public object MaxInputValue { get; set; } + + /// + /// Gets or sets the input drag step size, used in the UI. + /// + public float InputStepSize { get; set; } + + /// + /// Gets or sets an optional minimum input value, only enforced in the UI. + /// + public object MinInputValue { get; set; } + /// /// Gets or sets whether this property can use keyframes, True by default. /// diff --git a/src/Artemis.Core/RGB.NET/BitmapBrush.cs b/src/Artemis.Core/RGB.NET/BitmapBrush.cs index 9f4974a57..f0f2276fe 100644 --- a/src/Artemis.Core/RGB.NET/BitmapBrush.cs +++ b/src/Artemis.Core/RGB.NET/BitmapBrush.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Artemis.Core.Extensions; using Artemis.Core.Plugins.Models; using RGB.NET.Core; diff --git a/src/Artemis.Core/packages.config b/src/Artemis.Core/packages.config index c4150aa45..b37b39ea7 100644 --- a/src/Artemis.Core/packages.config +++ b/src/Artemis.Core/packages.config @@ -1,4 +1,5 @@  + @@ -15,7 +16,7 @@ - + diff --git a/src/Artemis.Plugins.Devices.Wooting/app.config b/src/Artemis.Plugins.Devices.Wooting/app.config index e79265588..be637eaeb 100644 --- a/src/Artemis.Plugins.Devices.Wooting/app.config +++ b/src/Artemis.Plugins.Devices.Wooting/app.config @@ -1,4 +1,5 @@  + diff --git a/src/Artemis.Plugins.LayerBrushes.Color/Artemis.Plugins.LayerBrushes.Color.csproj b/src/Artemis.Plugins.LayerBrushes.Color/Artemis.Plugins.LayerBrushes.Color.csproj index 897d25e53..62d5b8bc8 100644 --- a/src/Artemis.Plugins.LayerBrushes.Color/Artemis.Plugins.LayerBrushes.Color.csproj +++ b/src/Artemis.Plugins.LayerBrushes.Color/Artemis.Plugins.LayerBrushes.Color.csproj @@ -56,8 +56,8 @@ ..\packages\SkiaSharp.1.68.2-preview.29\lib\net45\SkiaSharp.dll - - ..\packages\Stylet.1.3.0\lib\net45\Stylet.dll + + ..\packages\Stylet.1.3.1\lib\net45\Stylet.dll diff --git a/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs b/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs index 7206f1c79..48db6b15a 100644 --- a/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs +++ b/src/Artemis.Plugins.LayerBrushes.Color/ColorBrush.cs @@ -53,7 +53,7 @@ namespace Artemis.Plugins.LayerBrushes.Color public override void Render(SKCanvas canvas, SKImageInfo canvasInfo, SKPath path, SKPaint paint) { - if (path.Bounds != _shaderBounds) + if (path.Bounds != _shaderBounds) CreateShader(path.Bounds); paint.Shader = _shader; diff --git a/src/Artemis.Plugins.LayerBrushes.Color/packages.config b/src/Artemis.Plugins.LayerBrushes.Color/packages.config index b4c597d80..578bcdc05 100644 --- a/src/Artemis.Plugins.LayerBrushes.Color/packages.config +++ b/src/Artemis.Plugins.LayerBrushes.Color/packages.config @@ -1,8 +1,9 @@  + - + diff --git a/src/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj b/src/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj index a0d80ec0b..0d1fbc9dd 100644 --- a/src/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj +++ b/src/Artemis.Plugins.LayerBrushes.Noise/Artemis.Plugins.LayerBrushes.Noise.csproj @@ -56,8 +56,8 @@ ..\packages\SkiaSharp.1.68.2-preview.29\lib\net45\SkiaSharp.dll - - ..\packages\Stylet.1.3.0\lib\net45\Stylet.dll + + ..\packages\Stylet.1.3.1\lib\net45\Stylet.dll diff --git a/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs b/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs index 8e2fc44be..cf68999cb 100644 --- a/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs +++ b/src/Artemis.Plugins.LayerBrushes.Noise/NoiseBrush.cs @@ -31,9 +31,16 @@ namespace Artemis.Plugins.LayerBrushes.Noise MainColorProperty = RegisterLayerProperty("Brush.MainColor", "Main color", "The main color of the noise."); SecondaryColorProperty = RegisterLayerProperty("Brush.SecondaryColor", "Secondary color", "The secondary color of the noise."); ScaleProperty = RegisterLayerProperty("Brush.Scale", "Scale", "The scale of the noise."); + ScaleProperty.MinInputValue = 0f; HardnessProperty = RegisterLayerProperty("Brush.Hardness", "Hardness", "The hardness of the noise, lower means there are gradients in the noise, higher means hard lines.."); + HardnessProperty.MinInputValue = 0f; + HardnessProperty.MaxInputValue = 2048f; ScrollSpeedProperty = RegisterLayerProperty("Brush.ScrollSpeed", "Movement speed", "The speed at which the noise moves vertically and horizontally."); + ScrollSpeedProperty.MinInputValue = -64f; + ScrollSpeedProperty.MaxInputValue = 64f; AnimationSpeedProperty = RegisterLayerProperty("Brush.AnimationSpeed", "Animation speed", "The speed at which the noise moves."); + AnimationSpeedProperty.MinInputValue = 0f; + AnimationSpeedProperty.MaxInputValue = 64f; ScaleProperty.InputAffix = "%"; DetermineRenderScale(); diff --git a/src/Artemis.Plugins.LayerBrushes.Noise/packages.config b/src/Artemis.Plugins.LayerBrushes.Noise/packages.config index 396ce6a6f..9f80be75e 100644 --- a/src/Artemis.Plugins.LayerBrushes.Noise/packages.config +++ b/src/Artemis.Plugins.LayerBrushes.Noise/packages.config @@ -1,7 +1,8 @@  + - + diff --git a/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj b/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj index 9e8c79b26..f35331001 100644 --- a/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj +++ b/src/Artemis.Plugins.Modules.General/Artemis.Plugins.Modules.General.csproj @@ -1,4 +1,5 @@  + @@ -50,8 +51,8 @@ ..\packages\SkiaSharp.1.68.2-preview.29\lib\net45\SkiaSharp.dll - - ..\packages\Stylet.1.3.0\lib\net45\Stylet.dll + + ..\packages\Stylet.1.3.1\lib\net45\Stylet.dll @@ -109,14 +110,17 @@ - echo Copying plugin to Artemis.UI output directory -XCOPY "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)\Artemis.UI\$(OutDir)Plugins\$(ProjectName)" /s /q /i /y + + echo Copying plugin to Artemis.UI output directory + XCOPY "$(TargetDir.TrimEnd('\'))" "$(SolutionDir)\Artemis.UI\$(OutDir)Plugins\$(ProjectName)" /s /q /i /y + 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}. - + \ No newline at end of file diff --git a/src/Artemis.Plugins.Modules.General/packages.config b/src/Artemis.Plugins.Modules.General/packages.config index 5c812bd07..83271280c 100644 --- a/src/Artemis.Plugins.Modules.General/packages.config +++ b/src/Artemis.Plugins.Modules.General/packages.config @@ -1,8 +1,9 @@  + - + diff --git a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj index f321492c3..17e92ea5a 100644 --- a/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj +++ b/src/Artemis.UI.Shared/Artemis.UI.Shared.csproj @@ -79,11 +79,18 @@ + + DraggableFloat.xaml + Designer MSBuild:Compile + + Designer + MSBuild:Compile + MSBuild:Compile Designer diff --git a/src/Artemis.UI.Shared/ColorPicker.xaml.cs b/src/Artemis.UI.Shared/ColorPicker.xaml.cs index 755ac3bbb..0def96395 100644 --- a/src/Artemis.UI.Shared/ColorPicker.xaml.cs +++ b/src/Artemis.UI.Shared/ColorPicker.xaml.cs @@ -18,7 +18,6 @@ namespace Artemis.UI.Shared public static readonly DependencyProperty PopupOpenProperty = DependencyProperty.Register(nameof(PopupOpen), typeof(bool), typeof(ColorPicker), new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, PopupOpenPropertyChangedCallback)); - internal static readonly DependencyProperty ColorOpacityProperty = DependencyProperty.Register(nameof(ColorOpacity), typeof(byte), typeof(ColorPicker), new FrameworkPropertyMetadata((byte) 255, FrameworkPropertyMetadataOptions.AffectsArrange | FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, ColorOpacityPropertyChangedCallback)); diff --git a/src/Artemis.UI.Shared/DraggableFloat.xaml b/src/Artemis.UI.Shared/DraggableFloat.xaml new file mode 100644 index 000000000..c1be4cdc5 --- /dev/null +++ b/src/Artemis.UI.Shared/DraggableFloat.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI.Shared/DraggableFloat.xaml.cs b/src/Artemis.UI.Shared/DraggableFloat.xaml.cs new file mode 100644 index 000000000..2a7b92050 --- /dev/null +++ b/src/Artemis.UI.Shared/DraggableFloat.xaml.cs @@ -0,0 +1,131 @@ +using System; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Input; + +namespace Artemis.UI.Shared +{ + /// + /// Interaction logic for DraggableFloat.xaml + /// + public partial class DraggableFloat : UserControl, INotifyPropertyChanged + { + public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(nameof(Value), typeof(float), typeof(DraggableFloat), + new FrameworkPropertyMetadata(default(float), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, FloatPropertyChangedCallback)); + + public static readonly DependencyProperty StepSizeProperty = DependencyProperty.Register(nameof(StepSize), typeof(float), typeof(DraggableFloat)); + + public static readonly RoutedEvent ValueChangedEvent = + EventManager.RegisterRoutedEvent( + nameof(Value), + RoutingStrategy.Bubble, + typeof(RoutedPropertyChangedEventHandler), + typeof(DraggableFloat)); + + private bool _inCallback; + private Point _mouseDragStartPoint; + private float _startValue; + + public DraggableFloat() + { + InitializeComponent(); + } + + public float Value + { + get => (float) GetValue(ValueProperty); + set => SetValue(ValueProperty, value); + } + + public float StepSize + { + get => (float) GetValue(StepSizeProperty); + set => SetValue(StepSizeProperty, value); + } + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + private static void FloatPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var draggableFloat = (DraggableFloat) d; + if (draggableFloat._inCallback) + return; + + draggableFloat._inCallback = true; + draggableFloat.OnPropertyChanged(nameof(Value)); + draggableFloat._inCallback = false; + } + + private void InputMouseDown(object sender, MouseButtonEventArgs e) + { + _startValue = Value; + ((IInputElement) sender).CaptureMouse(); + _mouseDragStartPoint = e.GetPosition((IInputElement) sender); + } + + private void InputMouseUp(object sender, MouseButtonEventArgs e) + { + var position = e.GetPosition((IInputElement) sender); + if (position == _mouseDragStartPoint) + DisplayInput(); + + ((IInputElement) sender).ReleaseMouseCapture(); + } + + private void InputMouseMove(object sender, MouseEventArgs e) + { + if (e.LeftButton == MouseButtonState.Pressed) + { + // Use decimals for everything to avoid floating point errors + var startValue = new decimal(_startValue); + var startX = new decimal(_mouseDragStartPoint.X); + var x = new decimal(e.GetPosition((IInputElement) sender).X); + var stepSize = new decimal(StepSize); + + Value = (float) (Math.Round(startValue + stepSize * (x - startX) / stepSize) * stepSize); + } + } + + private void InputLostFocus(object sender, RoutedEventArgs e) + { + DisplayDragHandle(); + } + + private void InputKeyDown(object sender, KeyEventArgs e) + { + if (e.Key == Key.Enter) + DisplayDragHandle(); + else if (e.Key == Key.Escape) + { + Input.Text = _startValue.ToString(); + DisplayDragHandle(); + } + } + + private void DisplayInput() + { + DragHandle.Visibility = Visibility.Collapsed; + Input.Visibility = Visibility.Visible; + Input.Focus(); + Input.SelectAll(); + } + + private void DisplayDragHandle() + { + Input.Visibility = Visibility.Collapsed; + DragHandle.Visibility = Visibility.Visible; + } + + private void Input_OnRequestBringIntoView(object sender, RequestBringIntoViewEventArgs e) + { + e.Handled = true; + } + } +} \ No newline at end of file diff --git a/src/Artemis.UI.Shared/packages.config b/src/Artemis.UI.Shared/packages.config index 71f5e1b73..1d06c555d 100644 --- a/src/Artemis.UI.Shared/packages.config +++ b/src/Artemis.UI.Shared/packages.config @@ -1,4 +1,5 @@  + diff --git a/src/Artemis.UI/Artemis.UI.csproj b/src/Artemis.UI/Artemis.UI.csproj index d91192cac..9faed755c 100644 --- a/src/Artemis.UI/Artemis.UI.csproj +++ b/src/Artemis.UI/Artemis.UI.csproj @@ -100,8 +100,8 @@ ..\packages\SkiaSharp.Views.WPF.1.68.2-preview.29\lib\net45\SkiaSharp.Views.WPF.dll - - ..\packages\Stylet.1.3.0\lib\net45\Stylet.dll + + ..\packages\Stylet.1.3.1\lib\net45\Stylet.dll diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/BrushPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/BrushPropertyInputViewModel.cs index ebdb311d4..9f4a36c8c 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/BrushPropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/BrushPropertyInputViewModel.cs @@ -59,11 +59,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P NotifyOfPropertyChange(() => BrushInputValue); } - public override void ApplyInputDrag(object startValue, double dragDistance) - { - throw new NotImplementedException(); - } - protected override void OnInitialized() { UpdateEnumValues(); diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/EnumPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/EnumPropertyInputViewModel.cs index 738ef2ce3..f1e1d7932 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/EnumPropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/EnumPropertyInputViewModel.cs @@ -27,11 +27,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P NotifyOfPropertyChange(() => EnumInputValue); } - public override void ApplyInputDrag(object startValue, double dragDistance) - { - throw new NotImplementedException(); - } - protected override void OnInitialized() { EnumValues = EnumUtilities.GetAllValuesAndDescriptions(LayerPropertyViewModel.LayerProperty.Type); diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml index aa28bdda5..815681cf1 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputView.xaml @@ -4,47 +4,14 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput" - xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:FloatPropertyInputViewModel}"> - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs index f892993a3..7fabc6bb2 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/FloatPropertyInputViewModel.cs @@ -16,7 +16,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P public float FloatInputValue { get => (float?) InputValue ?? 0f; - set => InputValue = value; + set => InputValue = ApplyInputValue(value); } public override void Update() @@ -24,10 +24,16 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P NotifyOfPropertyChange(() => FloatInputValue); } - public override void ApplyInputDrag(object startValue, double dragDistance) + private float ApplyInputValue(float value) { - var floatStartValue = (float) startValue; - FloatInputValue = (float) (floatStartValue + dragDistance); + if (LayerPropertyViewModel.LayerProperty.MaxInputValue != null && + LayerPropertyViewModel.LayerProperty.MaxInputValue is float maxFloat) + value = Math.Min(value, maxFloat); + if (LayerPropertyViewModel.LayerProperty.MinInputValue != null && + LayerPropertyViewModel.LayerProperty.MinInputValue is float minFloat) + value = Math.Max(value, minFloat); + + return value; } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml index 80bc7ecb7..22df27bef 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputView.xaml @@ -6,17 +6,13 @@ xmlns:local="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:IntPropertyInputViewModel}"> - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs index 9708a01ed..ff2c45302 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/IntPropertyInputViewModel.cs @@ -15,7 +15,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P public int IntInputValue { get => (int?) InputValue ?? 0; - set => InputValue = value; + set => InputValue = ApplyInputValue(value); } public override void Update() @@ -23,9 +23,16 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P NotifyOfPropertyChange(() => IntInputValue); } - public override void ApplyInputDrag(object startValue, double dragDistance) + private int ApplyInputValue(int value) { - throw new NotImplementedException(); + if (LayerPropertyViewModel.LayerProperty.MaxInputValue != null && + LayerPropertyViewModel.LayerProperty.MaxInputValue is int maxInt) + value = Math.Min(value, maxInt); + if (LayerPropertyViewModel.LayerProperty.MinInputValue != null && + LayerPropertyViewModel.LayerProperty.MinInputValue is int minInt) + value = Math.Max(value, minInt); + + return value; } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs index ac7f00e2e..eb9ab657a 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/PropertyInputViewModel.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Input; using Artemis.UI.Exceptions; using Artemis.UI.Services.Interfaces; using Stylet; @@ -21,7 +18,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P public bool Initialized { get; private set; } public LayerPropertyViewModel LayerPropertyViewModel { get; private set; } - public bool InputFieldEnabled { get; set; } protected object InputValue { @@ -50,8 +46,6 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P public abstract void Update(); - public abstract void ApplyInputDrag(object startValue, double dragDistance); - protected virtual void OnInitialized() { } @@ -64,70 +58,5 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P ProfileEditorService.UpdateSelectedProfileElement(); } - - #region Mouse-based mutations - - private Point _mouseDragStartPoint; - private object _startValue; - - // ReSharper disable once UnusedMember.Global - Called from view - public void InputMouseDown(object sender, MouseButtonEventArgs e) - { - _startValue = InputValue; - ((IInputElement) sender).CaptureMouse(); - _mouseDragStartPoint = e.GetPosition((IInputElement) sender); - } - - // ReSharper disable once UnusedMember.Global - Called from view - public void InputMouseUp(object sender, MouseEventArgs e) - { - var position = e.GetPosition((IInputElement) sender); - if (position == _mouseDragStartPoint) - InputFieldEnabled = true; - - ((IInputElement) sender).ReleaseMouseCapture(); - } - - // ReSharper disable once UnusedMember.Global - Called from view - public void InputMouseMove(object sender, MouseEventArgs e) - { - if (e.LeftButton == MouseButtonState.Pressed) - { - var position = e.GetPosition((IInputElement) sender); - ApplyInputDrag(_startValue, position.X - _mouseDragStartPoint.X); - } - } - - // ReSharper disable once UnusedMember.Global - Called from view - public void InputIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) - { - if (InputFieldEnabled) - { - ((UIElement) sender).Focus(); - if (sender is TextBox textBox) - textBox.SelectAll(); - } - } - - // ReSharper disable once UnusedMember.Global - Called from view - public void InputLostFocus(object sender, RoutedEventArgs e) - { - InputFieldEnabled = false; - } - - // ReSharper disable once UnusedMember.Global - Called from view - public void InputKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - InputFieldEnabled = false; - else if (e.Key == Key.Escape) - { - if (sender is TextBox textBox) - textBox.Text = _startValue.ToString(); - InputFieldEnabled = false; - } - } - - #endregion } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKColorPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKColorPropertyInputViewModel.cs index b4223241a..ed5ca0332 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKColorPropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKColorPropertyInputViewModel.cs @@ -23,10 +23,5 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P { NotifyOfPropertyChange(() => SKColorInputValue); } - - public override void ApplyInputDrag(object startValue, double dragDistance) - { - throw new NotImplementedException(); - } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml index 2a10df499..882bf4719 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputView.xaml @@ -6,26 +6,19 @@ xmlns:local="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignHeight="25" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:SKPointPropertyInputViewModel}"> - + , - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs index 0c48e1872..15be6cecc 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKPointPropertyInputViewModel.cs @@ -19,14 +19,14 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P public float X { get => ((SKPoint?) InputValue)?.X ?? 0; - set => InputValue = new SKPoint(value, Y); + set => InputValue = new SKPoint(ApplyInputValue(value), Y); } [DependsOn(nameof(InputValue))] public float Y { get => ((SKPoint?) InputValue)?.Y ?? 0; - set => InputValue = new SKPoint(X, value); + set => InputValue = new SKPoint(X, ApplyInputValue(value)); } public override void Update() @@ -35,9 +35,16 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P NotifyOfPropertyChange(() => Y); } - public override void ApplyInputDrag(object startValue, double dragDistance) + private float ApplyInputValue(float value) { - throw new NotImplementedException(); + if (LayerPropertyViewModel.LayerProperty.MaxInputValue != null && + LayerPropertyViewModel.LayerProperty.MaxInputValue is float maxFloat) + value = Math.Min(value, maxFloat); + if (LayerPropertyViewModel.LayerProperty.MinInputValue != null && + LayerPropertyViewModel.LayerProperty.MinInputValue is float minFloat) + value = Math.Max(value, minFloat); + + return value; } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml index 127b6219e..210cf7da8 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputView.xaml @@ -6,26 +6,15 @@ xmlns:local="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:s="https://github.com/canton7/Stylet" + xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800" d:DataContext="{d:DesignInstance local:SKSizePropertyInputViewModel}"> - + , - + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs index 1722da57a..7b9e3e204 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/PropertyTree/PropertyInput/SKSizePropertyInputViewModel.cs @@ -19,14 +19,14 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P public float Width { get => ((SKSize?) InputValue)?.Width ?? 0; - set => InputValue = new SKSize(value, Height); + set => InputValue = new SKSize(ApplyInputValue(value), Height); } [DependsOn(nameof(InputValue))] public float Height { get => ((SKSize?) InputValue)?.Height ?? 0; - set => InputValue = new SKSize(Width, value); + set => InputValue = new SKSize(Width, ApplyInputValue(value)); } public override void Update() @@ -35,9 +35,16 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P NotifyOfPropertyChange(() => Height); } - public override void ApplyInputDrag(object startValue, double dragDistance) + private float ApplyInputValue(float value) { - throw new NotImplementedException(); + if (LayerPropertyViewModel.LayerProperty.MaxInputValue != null && + LayerPropertyViewModel.LayerProperty.MaxInputValue is float maxFloat) + value = Math.Min(value, maxFloat); + if (LayerPropertyViewModel.LayerProperty.MinInputValue != null && + LayerPropertyViewModel.LayerProperty.MinInputValue is float minFloat) + value = Math.Max(value, minFloat); + + return value; } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTimelineViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTimelineViewModel.cs index 1cd074eeb..5cca8a591 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTimelineViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTimelineViewModel.cs @@ -2,14 +2,10 @@ using System.Collections.Generic; using System.Linq; using System.Windows; -using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using System.Windows.Shapes; -using Artemis.Core.Models.Surface; using Artemis.UI.Ninject.Factories; -using Artemis.UI.Screens.SurfaceEditor; -using Artemis.UI.Screens.SurfaceEditor.Visualization; using Artemis.UI.Services.Interfaces; using Stylet; @@ -99,9 +95,37 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline UpdateEndTime(); } + #region Keyframe movement + + public void MoveSelectedKeyframes(TimeSpan offset) + { + var keyframeViewModels = PropertyTrackViewModels.SelectMany(t => t.KeyframeViewModels.OrderBy(k => k.Keyframe.Position)).ToList(); + foreach (var keyframeViewModel in keyframeViewModels.Where(k => k.IsSelected)) + { + // TODO: Not ideal as this stacks them all if they get to 0, oh well + if (keyframeViewModel.Keyframe.Position + offset > TimeSpan.Zero) + { + keyframeViewModel.Keyframe.Position += offset; + keyframeViewModel.Update(LayerPropertiesViewModel.PixelsPerSecond); + } + } + + _profileEditorService.UpdateProfilePreview(); + } + + #endregion + + private void CreateViewModels(LayerPropertyViewModel property) + { + PropertyTrackViewModels.Add(_propertyTrackVmFactory.Create(this, property)); + foreach (var child in property.Children) + CreateViewModels(child); + } + #region Keyframe selection private Point _mouseDragStartPoint; + private bool _mouseDragging; // ReSharper disable once UnusedMember.Global - Called from view public void TimelineCanvasMouseDown(object sender, MouseButtonEventArgs e) @@ -110,12 +134,17 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline SelectionRectangle.Rect = new Rect(); _mouseDragStartPoint = e.GetPosition((IInputElement) sender); + _mouseDragging = true; + e.Handled = true; } // ReSharper disable once UnusedMember.Global - Called from view public void TimelineCanvasMouseUp(object sender, MouseEventArgs e) { - var position = e.GetPosition((IInputElement)sender); + if (!_mouseDragging) + return; + + var position = e.GetPosition((IInputElement) sender); var selectedRect = new Rect(_mouseDragStartPoint, position); SelectionRectangle.Rect = selectedRect; @@ -130,21 +159,24 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline return HitTestFilterBehavior.Continue; }); VisualTreeHelper.HitTest((Visual) sender, filterCallback, resultCallback, hitTestParams); - + var keyframeViewModels = PropertyTrackViewModels.SelectMany(t => t.KeyframeViewModels.OrderBy(k => k.Keyframe.Position)).ToList(); foreach (var keyframeViewModel in keyframeViewModels) keyframeViewModel.IsSelected = selectedKeyframes.Contains(keyframeViewModel); + _mouseDragging = false; + e.Handled = true; ((IInputElement) sender).ReleaseMouseCapture(); } public void TimelineCanvasMouseMove(object sender, MouseEventArgs e) { - if (e.LeftButton == MouseButtonState.Pressed) + if (_mouseDragging && e.LeftButton == MouseButtonState.Pressed) { var position = e.GetPosition((IInputElement) sender); var selectedRect = new Rect(_mouseDragStartPoint, position); SelectionRectangle.Rect = selectedRect; + e.Handled = true; } } @@ -191,32 +223,5 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline } #endregion - - #region Keyframe movement - - public void MoveSelectedKeyframes(TimeSpan offset) - { - var keyframeViewModels = PropertyTrackViewModels.SelectMany(t => t.KeyframeViewModels.OrderBy(k => k.Keyframe.Position)).ToList(); - foreach (var keyframeViewModel in keyframeViewModels.Where(k => k.IsSelected)) - { - // TODO: Not ideal as this stacks them all if they get to 0, oh well - if (keyframeViewModel.Keyframe.Position + offset > TimeSpan.Zero) - { - keyframeViewModel.Keyframe.Position += offset; - keyframeViewModel.Update(LayerPropertiesViewModel.PixelsPerSecond); - } - } - - _profileEditorService.UpdateProfilePreview(); - } - - #endregion - - private void CreateViewModels(LayerPropertyViewModel property) - { - PropertyTrackViewModels.Add(_propertyTrackVmFactory.Create(this, property)); - foreach (var child in property.Children) - CreateViewModels(child); - } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackKeyframeViewModel.cs b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackKeyframeViewModel.cs index 5b2f037c5..4844a7978 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackKeyframeViewModel.cs +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackKeyframeViewModel.cs @@ -48,6 +48,8 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline { if (e.LeftButton == MouseButtonState.Released) return; + + ((IInputElement)sender).CaptureMouse(); if (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift) && !IsSelected) PropertyTrackViewModel.PropertyTimelineViewModel.SelectKeyframe(this, true, false); else if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) @@ -55,16 +57,14 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline else if (!IsSelected) PropertyTrackViewModel.PropertyTimelineViewModel.SelectKeyframe(this, false, false); - ((IInputElement) sender).CaptureMouse(); e.Handled = true; } public void KeyframeMouseUp(object sender, MouseButtonEventArgs e) { - if (e.LeftButton == MouseButtonState.Released) - return; - ((IInputElement) sender).ReleaseMouseCapture(); _profileEditorService.UpdateSelectedProfileElement(); + + ((IInputElement)sender).ReleaseMouseCapture(); e.Handled = true; } @@ -95,6 +95,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline PropertyTrackViewModel.PropertyTimelineViewModel.MoveSelectedKeyframes(newTime - Keyframe.Position); } + e.Handled = true; } diff --git a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackView.xaml b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackView.xaml index f50ebdd43..49825e4dc 100644 --- a/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackView.xaml +++ b/src/Artemis.UI/Screens/Module/ProfileEditor/LayerProperties/Timeline/PropertyTrackView.xaml @@ -46,14 +46,14 @@ - + - + diff --git a/src/Artemis.UI/packages.config b/src/Artemis.UI/packages.config index 3650dda36..3dd7a73e8 100644 --- a/src/Artemis.UI/packages.config +++ b/src/Artemis.UI/packages.config @@ -1,4 +1,5 @@  + @@ -16,7 +17,7 @@ - + diff --git a/src/Artemis.sln.DotSettings b/src/Artemis.sln.DotSettings index 9ad040f9a..9b1efd82e 100644 --- a/src/Artemis.sln.DotSettings +++ b/src/Artemis.sln.DotSettings @@ -9,6 +9,186 @@ NEVER NEVER 200 + <?xml version="1.0" encoding="utf-16"?> +<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> + <TypePattern DisplayName="Non-reorderable types"> + <TypePattern.Match> + <Or> + <And> + <Kind Is="Interface" /> + <Or> + <HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" /> + <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> + </Or> + </And> + <Kind Is="Struct" /> + <HasAttribute Name="JetBrains.Annotations.NoReorderAttribute" /> + <HasAttribute Name="JetBrains.Annotations.NoReorder" /> + </Or> + </TypePattern.Match> + </TypePattern> + <TypePattern DisplayName="xUnit.net Test Classes" RemoveRegions="All"> + <TypePattern.Match> + <And> + <Kind Is="Class" /> + <HasMember> + <And> + <Kind Is="Method" /> + <HasAttribute Name="Xunit.FactAttribute" Inherited="True" /> + </And> + </HasMember> + </And> + </TypePattern.Match> + <Entry DisplayName="Setup/Teardown Methods"> + <Entry.Match> + <Or> + <Kind Is="Constructor" /> + <And> + <Kind Is="Method" /> + <ImplementsInterface Name="System.IDisposable" /> + </And> + </Or> + </Entry.Match> + <Entry.SortBy> + <Kind Order="Constructor" /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="All other members" /> + <Entry DisplayName="Test Methods" Priority="100"> + <Entry.Match> + <And> + <Kind Is="Method" /> + <HasAttribute Name="Xunit.FactAttribute" /> + </And> + </Entry.Match> + <Entry.SortBy> + <Name /> + </Entry.SortBy> + </Entry> + </TypePattern> + <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> + <TypePattern.Match> + <And> + <Kind Is="Class" /> + <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /> + </And> + </TypePattern.Match> + <Entry DisplayName="Setup/Teardown Methods"> + <Entry.Match> + <And> + <Kind Is="Method" /> + <Or> + <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /> + </Or> + </And> + </Entry.Match> + </Entry> + <Entry DisplayName="All other members" /> + <Entry DisplayName="Test Methods" Priority="100"> + <Entry.Match> + <And> + <Kind Is="Method" /> + <HasAttribute Name="NUnit.Framework.TestAttribute" /> + </And> + </Entry.Match> + <Entry.SortBy> + <Name /> + </Entry.SortBy> + </Entry> + </TypePattern> + <TypePattern DisplayName="Default Pattern"> + <Entry DisplayName="Public Delegates" Priority="100"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Kind Is="Delegate" /> + </And> + </Entry.Match> + <Entry.SortBy> + <Name /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="Public Enums" Priority="100"> + <Entry.Match> + <And> + <Access Is="Public" /> + <Kind Is="Enum" /> + </And> + </Entry.Match> + <Entry.SortBy> + <Name /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="Static Fields and Constants"> + <Entry.Match> + <Or> + <Kind Is="Constant" /> + <And> + <Kind Is="Field" /> + <Static /> + </And> + </Or> + </Entry.Match> + <Entry.SortBy> + <Kind Order="Constant Field" /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="Fields"> + <Entry.Match> + <And> + <Kind Is="Field" /> + <Not> + <Static /> + </Not> + </And> + </Entry.Match> + <Entry.SortBy> + <Readonly /> + <Name /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="Constructors"> + <Entry.Match> + <Kind Is="Constructor" /> + </Entry.Match> + <Entry.SortBy> + <Static /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="Properties, Indexers"> + <Entry.Match> + <Or> + <Kind Is="Property" /> + <Kind Is="Indexer" /> + </Or> + </Entry.Match> + </Entry> + <Entry DisplayName="Interface Implementations" Priority="100"> + <Entry.Match> + <And> + <Kind Is="Member" /> + <ImplementsInterface /> + </And> + </Entry.Match> + <Entry.SortBy> + <ImplementsInterface Immediate="True" /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="All other members"> + <Entry.SortBy> + <Access /> + </Entry.SortBy> + </Entry> + <Entry DisplayName="Nested Types"> + <Entry.Match> + <Kind Is="Type" /> + </Entry.Match> + </Entry> + </TypePattern> +</Patterns> True True True