From 5b5b0fb9fe5ff19bd1785597523e9d648fef982c Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sun, 17 Dec 2017 16:44:13 +0100 Subject: [PATCH] Removed UI-project --- NuGet/RGB.NET.WPF.nuspec | 28 ------ RGB.NET.WPF/Controls/LedVisualizer.cs | 34 ------- RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs | 77 --------------- RGB.NET.WPF/Controls/RGBSurfaceVisualizer.cs | 99 ------------------- .../ColorToSolidColorBrushConverter.cs | 31 ------ RGB.NET.WPF/Properties/AssemblyInfo.cs | 35 ------- RGB.NET.WPF/RGB.NET.WPF.csproj | 89 ----------------- RGB.NET.WPF/Styles/LedVisualizer.xaml | 99 ------------------- RGB.NET.WPF/Styles/RGBDeviceVisualizer.xaml | 45 --------- RGB.NET.WPF/Styles/RGBSurfaceVisualizer.xaml | 36 ------- RGB.NET.WPF/packages.config | 4 - RGB.NET.sln | 12 +-- 12 files changed, 1 insertion(+), 588 deletions(-) delete mode 100644 NuGet/RGB.NET.WPF.nuspec delete mode 100644 RGB.NET.WPF/Controls/LedVisualizer.cs delete mode 100644 RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs delete mode 100644 RGB.NET.WPF/Controls/RGBSurfaceVisualizer.cs delete mode 100644 RGB.NET.WPF/Converter/ColorToSolidColorBrushConverter.cs delete mode 100644 RGB.NET.WPF/Properties/AssemblyInfo.cs delete mode 100644 RGB.NET.WPF/RGB.NET.WPF.csproj delete mode 100644 RGB.NET.WPF/Styles/LedVisualizer.xaml delete mode 100644 RGB.NET.WPF/Styles/RGBDeviceVisualizer.xaml delete mode 100644 RGB.NET.WPF/Styles/RGBSurfaceVisualizer.xaml delete mode 100644 RGB.NET.WPF/packages.config diff --git a/NuGet/RGB.NET.WPF.nuspec b/NuGet/RGB.NET.WPF.nuspec deleted file mode 100644 index cc58702..0000000 --- a/NuGet/RGB.NET.WPF.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - RGB.NET.WPF - RGB.NET.WPF - 0.0.1 - Darth Affe - Darth Affe - https://github.com/DarthAffe/RGB.NET - https://raw.githubusercontent.com/DarthAffe/RGB.NET/master/LICENSE - true - WPF-Controls of RGB.NET - - WPF-Controls of RGB.NET, a C# (.NET) library for accessing various RGB-peripherals - Copyright © Wyrez 2017 - en-US - - - - - - - - - - - - \ No newline at end of file diff --git a/RGB.NET.WPF/Controls/LedVisualizer.cs b/RGB.NET.WPF/Controls/LedVisualizer.cs deleted file mode 100644 index e681025..0000000 --- a/RGB.NET.WPF/Controls/LedVisualizer.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using RGB.NET.Core; - -namespace RGB.NET.WPF.Controls -{ - /// - /// - /// Visualizes a in an wpf-application. - /// - public class LedVisualizer : Control - { - #region DependencyProperties - // ReSharper disable InconsistentNaming - - /// - /// Backing-property for the -property. - /// - public static readonly DependencyProperty LedProperty = DependencyProperty.Register( - "Led", typeof(Led), typeof(LedVisualizer), new PropertyMetadata(default(Led))); - - /// - /// Gets or sets the to visualize. - /// - public Led Led - { - get => (Led)GetValue(LedProperty); - set => SetValue(LedProperty, value); - } - - // ReSharper restore InconsistentNaming - #endregion - } -} diff --git a/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs b/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs deleted file mode 100644 index 6c0c1cc..0000000 --- a/RGB.NET.WPF/Controls/RGBDeviceVisualizer.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System.Windows; -using System.Windows.Controls; -using RGB.NET.Core; - -namespace RGB.NET.WPF.Controls -{ - /// - /// - /// Visualizes a in an wpf-application. - /// - [TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))] - public class RGBDeviceVisualizer : Control - { - #region Constants - - private const string PART_CANVAS = "PART_Canvas"; - - #endregion - - #region Properties & Fields - - private Canvas _canvas; - - #endregion - - #region DependencyProperties - // ReSharper disable InconsistentNaming - - /// - /// Backing-property for the -property. - /// - public static readonly DependencyProperty DeviceProperty = DependencyProperty.Register( - "Device", typeof(IRGBDevice), typeof(RGBDeviceVisualizer), new PropertyMetadata(default(IRGBDevice), DeviceChanged)); - - /// - /// Gets or sets the to visualize. - /// - public IRGBDevice Device - { - get => (IRGBDevice)GetValue(DeviceProperty); - set => SetValue(DeviceProperty, value); - } - - // ReSharper restore InconsistentNaming - #endregion - - #region Methods - - /// - public override void OnApplyTemplate() - { - _canvas = (Canvas)GetTemplateChild(PART_CANVAS); - - LayoutLeds(); - } - - private static void DeviceChanged(DependencyObject dependencyObject, - DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs) - { - ((RGBDeviceVisualizer)dependencyObject).LayoutLeds(); - } - - private void LayoutLeds() - { - if (_canvas == null) return; - - _canvas.Children.Clear(); - - if (Device == null) return; - - foreach (Led led in Device) - _canvas.Children.Add(new LedVisualizer { Led = led }); - } - - #endregion - } -} diff --git a/RGB.NET.WPF/Controls/RGBSurfaceVisualizer.cs b/RGB.NET.WPF/Controls/RGBSurfaceVisualizer.cs deleted file mode 100644 index fc4d8b1..0000000 --- a/RGB.NET.WPF/Controls/RGBSurfaceVisualizer.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System.Collections.Generic; -using System.Windows; -using System.Windows.Controls; -using RGB.NET.Core; - -namespace RGB.NET.WPF.Controls -{ - /// - /// - /// Visualizes the in an wpf-application. - /// - [TemplatePart(Name = PART_CANVAS, Type = typeof(Canvas))] - public class RGBSurfaceVisualizer : Control - { - #region Constants - - private const string PART_CANVAS = "PART_Canvas"; - - #endregion - - #region Properties & Fields - - private RGBSurface _surface; - private Canvas _canvas; - - //TODO DarthAffe 17.06.2017: This is ugly - redesign how device connect/disconnect is generally handled! - private readonly List _newDevices = new List(); - - #endregion - - #region Constructors - - /// - /// - /// Initializes a new instance of the class. - /// - public RGBSurfaceVisualizer() - { - this.Loaded += OnLoaded; - this.Unloaded += OnUnloaded; - } - - private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) - { - _surface = RGBSurface.Instance; - - _surface.SurfaceLayoutChanged += RGBSurfaceOnSurfaceLayoutChanged; - foreach (IRGBDevice device in _surface.Devices) - _newDevices.Add(device); - - UpdateSurface(); - } - - private void OnUnloaded(object sender, RoutedEventArgs routedEventArgs) - { - _surface.SurfaceLayoutChanged -= RGBSurfaceOnSurfaceLayoutChanged; - _canvas?.Children.Clear(); - _newDevices.Clear(); - } - - private void RGBSurfaceOnSurfaceLayoutChanged(SurfaceLayoutChangedEventArgs args) - { - if (args.DeviceAdded) - foreach (IRGBDevice device in args.Devices) - _newDevices.Add(device); - - UpdateSurface(); - } - - #endregion - - #region Methods - - /// - public override void OnApplyTemplate() - { - _canvas?.Children.Clear(); - _canvas = (Canvas)GetTemplateChild(PART_CANVAS); - UpdateSurface(); - } - - private void UpdateSurface() - { - if ((_canvas == null) || (_surface == null)) return; - - if (_newDevices.Count > 0) - { - foreach (IRGBDevice device in _newDevices) - _canvas.Children.Add(new RGBDeviceVisualizer { Device = device }); - _newDevices.Clear(); - } - - _canvas.Width = _surface.SurfaceRectangle.Size.Width; - _canvas.Height = _surface.SurfaceRectangle.Size.Height; - } - - #endregion - } -} diff --git a/RGB.NET.WPF/Converter/ColorToSolidColorBrushConverter.cs b/RGB.NET.WPF/Converter/ColorToSolidColorBrushConverter.cs deleted file mode 100644 index 4dea27d..0000000 --- a/RGB.NET.WPF/Converter/ColorToSolidColorBrushConverter.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Globalization; -using System.Windows.Data; -using System.Windows.Media; - -namespace RGB.NET.WPF.Converter -{ - /// - /// - /// Converts into . - /// - [ValueConversion(typeof(Core.Color), typeof(SolidColorBrush))] - public class ColorToSolidColorBrushConverter : IValueConverter - { - /// - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - return new SolidColorBrush(!(value is Core.Color color) - ? Color.FromArgb(0, 0, 0, 0) - : Color.FromArgb(color.A, color.R, color.G, color.B)); - } - - /// - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - return !(value is SolidColorBrush brush) - ? Core.Color.Transparent - : new Core.Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B); - } - } -} diff --git a/RGB.NET.WPF/Properties/AssemblyInfo.cs b/RGB.NET.WPF/Properties/AssemblyInfo.cs deleted file mode 100644 index aaa37ef..0000000 --- a/RGB.NET.WPF/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RGB.NET.WPF")] -[assembly: AssemblyDescription("WPF-Controls of RGB.NET")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Wyrez")] -[assembly: AssemblyProduct("RGB.NET.WPF")] -[assembly: AssemblyCopyright("Copyright © Wyrez 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// 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)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("347c5f0f-f490-4dec-9c1c-6e84750d838d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RGB.NET.WPF/RGB.NET.WPF.csproj b/RGB.NET.WPF/RGB.NET.WPF.csproj deleted file mode 100644 index cf689a2..0000000 --- a/RGB.NET.WPF/RGB.NET.WPF.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - - Debug - AnyCPU - {8D6C4FE6-0046-4E98-876F-4C0B87249989} - Library - Properties - RGB.NET.WPF - RGB.NET.WPF - v4.5 - 512 - - - true - full - false - ..\bin\ - DEBUG;TRACE - prompt - 4 - ..\bin\RGB.NET.WPF.XML - - - pdbonly - true - ..\bin\ - TRACE - prompt - 4 - ..\bin\RGB.NET.WPF.XML - - - - - - - - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - - - - - - - - - - - - - - - - - - - - {5a4f9a75-75fe-47cd-90e5-914d5b20d232} - RGB.NET.Core - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - - - - \ No newline at end of file diff --git a/RGB.NET.WPF/Styles/LedVisualizer.xaml b/RGB.NET.WPF/Styles/LedVisualizer.xaml deleted file mode 100644 index 0ad5a21..0000000 --- a/RGB.NET.WPF/Styles/LedVisualizer.xaml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -