aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Scripting/TestApp/Properties/AssemblyInfo.cs
blob: d2b37f2f37416c77cabc42c02116ba0198b9296c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// 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("TestApp")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestApp")]
[assembly: AssemblyCopyright("Copyright ©  2019")]
[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)]

//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
//in your source files, set the <UICulture> to en-US.  Then uncomment
//the NeutralResourceLanguage attribute below.  Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[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,
                                     // or application resource dictionaries)
    ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
                                              //(used if a resource is not found in the page,
                                              // app, or any theme specific resource dictionaries)
)]


// 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")]
">; using System.Windows.Threading; using Tango.Core; using Tango.SharedUI; namespace Tango.MachineStudio.RML.ViewModels { public class RgbVM : ExtendedObject { private DispatcherTimer _color_change_timer; public event EventHandler<Color> ColorChanged; public RgbVM() { _color_change_timer = new DispatcherTimer(); _color_change_timer.Interval = TimeSpan.FromMilliseconds(30); _color_change_timer.Tick += _color_change_timer_Tick; _color_change_timer.Stop(); _color = Colors.DimGray; } private void _color_change_timer_Tick(object sender, EventArgs e) { _color_change_timer.Stop(); ColorChanged?.Invoke(this, Color); } private double _red; public double Red { get { return _red; } set { _red = value; SynchronizeColor(); RaisePropertyChangedAuto(); } } private double _green; public double Green { get { return _green; } set { _green = value; SynchronizeColor(); RaisePropertyChangedAuto(); } } private double _blue; public double Blue { get { return _blue; } set { _blue = value; SynchronizeColor(); RaisePropertyChangedAuto(); } } private double _l; public double L { get { return _l; } set { _l = value; SynchronizeColor(); RaisePropertyChangedAuto(); } } private double _a; public double A { get { return _a; } set { _a = value; SynchronizeColor(); RaisePropertyChangedAuto(); } } private double _b; public double B { get { return _b; } set { _b = value; SynchronizeColor(); RaisePropertyChangedAuto(); } } private Color _color; public Color Color { get { return _color; } set { _color = value; RaisePropertyChanged(nameof(Color)); SynchronizeComponents(); } } private bool _isLab; public bool IsLab { get { return _isLab; } set { _isLab = value; RaisePropertyChangedAuto(); } } private void SynchronizeColor() { _color_change_timer.Stop(); if (!IsLab) { Rgb rgb = new Rgb(Red, Green, Blue); Lab lab = rgb.To<Lab>(); _l = lab.L; _a = lab.A; _b = lab.B; } else { Lab lab = new Lab(L, A, B); Rgb rgb = lab.To<Rgb>(); _red = (int)rgb.R; _green = (int)rgb.G; _blue = (int)rgb.B; } _color = Color.FromRgb((byte)Red, (byte)Green, (byte)Blue); RaisePropertyChanged(nameof(Color)); _color_change_timer.Start(); } private void SynchronizeComponents() { _color_change_timer.Stop(); _red = Color.R; _green = Color.G; _blue = Color.B; if (IsLab) { Rgb rgb = new Rgb(Red, Green, Blue); Lab lab = rgb.To<Lab>(); _l = lab.L; _a = lab.A; _b = lab.B; } RaisePropertyChanged(nameof(Red)); RaisePropertyChanged(nameof(Green)); RaisePropertyChanged(nameof(Blue)); RaisePropertyChanged(nameof(L)); RaisePropertyChanged(nameof(A)); RaisePropertyChanged(nameof(B)); RaisePropertyChanged(nameof(Color)); _color_change_timer.Start(); } } }