├── .gitignore
├── .vs
└── config
│ └── applicationhost.config
├── Demo
├── TestWPF
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.resx
│ │ ├── Settings.Designer.cs
│ │ └── Settings.settings
│ ├── Services.cs
│ ├── Settings
│ │ ├── AppSettings.cs
│ │ ├── DisplaySettings.cs
│ │ └── GeneralSettings.cs
│ ├── TestWPF.csproj
│ ├── app.config
│ └── packages.config
└── TestWinForms
│ ├── ColorPickerUC.Designer.cs
│ ├── ColorPickerUC.cs
│ ├── ColorPickerUC.resx
│ ├── Person.cs
│ ├── Program.cs
│ ├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
│ ├── Services.cs
│ ├── TestForm.Designer.cs
│ ├── TestForm.cs
│ ├── TestForm.resx
│ ├── TestWinForms.csproj
│ ├── TestWinForms.csproj.user
│ ├── app.config
│ └── packages.config
├── Jot.Tests
├── Jot.Tests.csproj
├── JsonFileStoreTests.cs
├── TestData
│ ├── Bar.cs
│ ├── Foo.cs
│ ├── Foo2.cs
│ ├── FooAtt.cs
│ ├── TestStore.cs
│ └── TrackingAwareTestClass.cs
└── TrackerTests.cs
├── Jot.sln
├── Jot
├── Configuration
│ ├── Attributes
│ │ ├── PersistTriggerAttributete.cs
│ │ ├── StopTrackingTrigger.cs
│ │ ├── TrackableAttribute.cs
│ │ └── TrackingKeyAttribute.cs
│ ├── ITrackingAware.cs
│ ├── ITrackingConfiguration.cs
│ ├── TrackedPropertyInfo.cs
│ ├── TrackingConfiguration.cs
│ ├── TrackingConfigurationGeneric.cs
│ ├── TrackingOperationEventArgs.cs
│ └── Trigger.cs
├── Jot.csproj
├── Jot.csproj.user
├── Jot.xml
├── Properties
│ └── launchSettings.json
├── Storage
│ ├── IStore.cs
│ └── JsonFileStore.cs
├── Tracker.cs
└── mykey.snk
├── LICENSE.txt
├── README.md
└── _config.yml
/.gitignore:
--------------------------------------------------------------------------------
1 | obj/
2 | bin/
3 | Debug/
4 | Release/
5 | TestResults/
6 | packages/
7 | Ignored/
8 | .vs/
9 |
10 | storage.ide
11 | *.nupkg
12 | *.exe
13 | *.dll
14 | *.suo
15 | *.ncb
16 | *.vspcc
17 | *.vscc
18 | *.vssscc
19 | *.scc
20 | *.vspscc
21 | *.obproj.vspscc
22 | *.obproj.map
23 | *.cache
24 |
25 |
--------------------------------------------------------------------------------
/Demo/TestWPF/App.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/TestWPF/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Windows;
7 | using TestWPF.Settings;
8 |
9 | namespace TestWPF
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | public static AppSettings Settings = new AppSettings();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Demo/TestWPF/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/Demo/TestWPF/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Jot.Configuration;
2 | using System;
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using TestWPF.Settings;
6 |
7 | namespace TestWPF
8 | {
9 | ///
10 | /// Interaction logic for MainWindow.xaml
11 | ///
12 | public partial class MainWindow : Window
13 | {
14 |
15 | public MainWindow()
16 | {
17 | InitializeComponent();
18 |
19 | //set up tracking and apply state to the application settings object
20 | Services.Tracker.Track(App.Settings);
21 |
22 | // in addition to tracking standard window properties, also track selected tab and first-grid-column width for MainWindow instances
23 | Services.Tracker.Configure()
24 | .Property(w => w.tabControl.SelectedIndex, "SelectedTab")
25 | .Property(w => w.firstCol.Width);
26 |
27 | //set up tracking and apply state for the main window
28 | Services.Tracker.Track(this);
29 |
30 | this.DataContext = App.Settings;
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/Demo/TestWPF/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("TestWPF")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("Microsoft")]
14 | [assembly: AssemblyProduct("TestWPF")]
15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestWPF.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestWPF.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestWPF.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Services.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.IO;
6 | using Jot;
7 | using System.Windows;
8 | using System.Windows.Forms;
9 |
10 | namespace TestWPF
11 | {
12 | //this class can be replaced by the use of an IOC container
13 | static class Services
14 | {
15 | public static Tracker Tracker = new Tracker();
16 |
17 | static Services()
18 | {
19 | Tracker
20 | .Configure()
21 | .Id(w => w.Name, SystemInformation.VirtualScreen.Size)
22 | .Properties(w => new { w.Top, w.Width, w.Height, w.Left, w.WindowState })
23 | .PersistOn(nameof(Window.Closing))
24 | .StopTrackingOn(nameof(Window.Closing));
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Settings/AppSettings.cs:
--------------------------------------------------------------------------------
1 | using Jot.Configuration;
2 |
3 | namespace TestWPF.Settings
4 | {
5 | public class AppSettings : ITrackingAware
6 | {
7 | public DisplaySettings DisplaySettings { get; set; }
8 | public GeneralSettings GeneralSettings { get; set; }
9 |
10 | public AppSettings()
11 | {
12 | DisplaySettings = new DisplaySettings();
13 | GeneralSettings = new GeneralSettings();
14 | }
15 |
16 | public void ConfigureTracking(TrackingConfiguration configuration)
17 | {
18 | configuration.AsGeneric().Properties(s => new { s.DisplaySettings, s.GeneralSettings });
19 | System.Windows.Application.Current.Exit += (s, e) => { configuration.Tracker.Persist(this); };
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Settings/DisplaySettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.ComponentModel;
6 | using System.Windows.Media;
7 | using System.Runtime.CompilerServices;
8 |
9 | namespace TestWPF.Settings
10 | {
11 | [Serializable]
12 | public class DisplaySettings : INotifyPropertyChanged
13 | {
14 | private FontFamily _font;
15 | public FontFamily Font
16 | {
17 | get { return _font; }
18 | set { _font = value; OnPropertyChanged(); }
19 | }
20 |
21 | private decimal _fontSize = 15;
22 | public decimal FontSize
23 | {
24 | get { return _fontSize; }
25 | set { _fontSize = value; OnPropertyChanged(); }
26 | }
27 |
28 | [field: NonSerialized]
29 | public event PropertyChangedEventHandler PropertyChanged;
30 |
31 | protected virtual void OnPropertyChanged([CallerMemberName]string propertyName = null)
32 | {
33 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Demo/TestWPF/Settings/GeneralSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 |
7 | namespace TestWPF.Settings
8 | {
9 | [Serializable]
10 | public class GeneralSettings
11 | {
12 | public int Property1 { get; set; }
13 | public string Property2 { get; set; }
14 | public IPAddress Property3 { get; set; }
15 | public bool Property4 { get; set; }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Demo/TestWPF/TestWPF.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {9D1520D9-DE96-4C8D-8C19-FA921851C9DA}
9 | WinExe
10 | Properties
11 | TestWPF
12 | TestWPF
13 | v4.7.2
14 |
15 |
16 | 512
17 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
18 | 4
19 |
20 |
21 |
22 |
23 | x86
24 | true
25 | full
26 | false
27 | bin\Debug\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 | false
32 |
33 |
34 | x86
35 | pdbonly
36 | true
37 | bin\Release\
38 | TRACE
39 | prompt
40 | 4
41 | false
42 |
43 |
44 |
45 | ..\..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll
46 |
47 |
48 | ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
49 |
50 |
51 |
52 | ..\..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
53 |
54 |
55 |
56 |
57 | ..\..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
58 |
59 |
60 |
61 | ..\..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
62 |
63 |
64 | ..\..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | 4.0
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | MSBuild:Compile
82 | Designer
83 |
84 |
85 |
86 |
87 |
88 |
89 | MSBuild:Compile
90 | Designer
91 |
92 |
93 | App.xaml
94 | Code
95 |
96 |
97 | MainWindow.xaml
98 | Code
99 |
100 |
101 |
102 |
103 | Code
104 |
105 |
106 | True
107 | True
108 | Resources.resx
109 |
110 |
111 | True
112 | Settings.settings
113 | True
114 |
115 |
116 | ResXFileCodeGenerator
117 | Resources.Designer.cs
118 |
119 |
120 |
121 |
122 | SettingsSingleFileGenerator
123 | Settings.Designer.cs
124 |
125 |
126 |
127 |
128 |
129 | {77c39ace-7180-4f7d-9b16-8408e1bc058b}
130 | Jot
131 |
132 |
133 |
134 |
141 |
--------------------------------------------------------------------------------
/Demo/TestWPF/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Demo/TestWPF/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/ColorPickerUC.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace TestWinForms
2 | {
3 | partial class ColorPickerUC
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.groupBox1 = new System.Windows.Forms.GroupBox();
32 | this.pnlSample = new System.Windows.Forms.Panel();
33 | this.lblBlue = new System.Windows.Forms.Label();
34 | this.tbBlue = new System.Windows.Forms.TrackBar();
35 | this.lblGreen = new System.Windows.Forms.Label();
36 | this.tbGreen = new System.Windows.Forms.TrackBar();
37 | this.lblRed = new System.Windows.Forms.Label();
38 | this.tbRed = new System.Windows.Forms.TrackBar();
39 | this.groupBox1.SuspendLayout();
40 | ((System.ComponentModel.ISupportInitialize)(this.tbBlue)).BeginInit();
41 | ((System.ComponentModel.ISupportInitialize)(this.tbGreen)).BeginInit();
42 | ((System.ComponentModel.ISupportInitialize)(this.tbRed)).BeginInit();
43 | this.SuspendLayout();
44 | //
45 | // groupBox1
46 | //
47 | this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
48 | | System.Windows.Forms.AnchorStyles.Left)
49 | | System.Windows.Forms.AnchorStyles.Right)));
50 | this.groupBox1.Controls.Add(this.pnlSample);
51 | this.groupBox1.Controls.Add(this.lblBlue);
52 | this.groupBox1.Controls.Add(this.tbBlue);
53 | this.groupBox1.Controls.Add(this.lblGreen);
54 | this.groupBox1.Controls.Add(this.tbGreen);
55 | this.groupBox1.Controls.Add(this.lblRed);
56 | this.groupBox1.Controls.Add(this.tbRed);
57 | this.groupBox1.Location = new System.Drawing.Point(3, 3);
58 | this.groupBox1.Name = "groupBox1";
59 | this.groupBox1.Size = new System.Drawing.Size(345, 360);
60 | this.groupBox1.TabIndex = 0;
61 | this.groupBox1.TabStop = false;
62 | this.groupBox1.Text = "groupBox1";
63 | //
64 | // pnlSample
65 | //
66 | this.pnlSample.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
67 | | System.Windows.Forms.AnchorStyles.Left)
68 | | System.Windows.Forms.AnchorStyles.Right)));
69 | this.pnlSample.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
70 | this.pnlSample.Location = new System.Drawing.Point(17, 178);
71 | this.pnlSample.Name = "pnlSample";
72 | this.pnlSample.Size = new System.Drawing.Size(313, 158);
73 | this.pnlSample.TabIndex = 13;
74 | //
75 | // lblBlue
76 | //
77 | this.lblBlue.AutoSize = true;
78 | this.lblBlue.Location = new System.Drawing.Point(14, 140);
79 | this.lblBlue.Name = "lblBlue";
80 | this.lblBlue.Size = new System.Drawing.Size(28, 13);
81 | this.lblBlue.TabIndex = 12;
82 | this.lblBlue.Text = "Blue";
83 | //
84 | // tbBlue
85 | //
86 | this.tbBlue.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
87 | | System.Windows.Forms.AnchorStyles.Right)));
88 | this.tbBlue.BackColor = System.Drawing.Color.White;
89 | this.tbBlue.Location = new System.Drawing.Point(68, 127);
90 | this.tbBlue.Maximum = 255;
91 | this.tbBlue.Name = "tbBlue";
92 | this.tbBlue.Size = new System.Drawing.Size(262, 45);
93 | this.tbBlue.TabIndex = 11;
94 | this.tbBlue.ValueChanged += new System.EventHandler(this.tb_ValueChanged);
95 | //
96 | // lblGreen
97 | //
98 | this.lblGreen.AutoSize = true;
99 | this.lblGreen.Location = new System.Drawing.Point(14, 89);
100 | this.lblGreen.Name = "lblGreen";
101 | this.lblGreen.Size = new System.Drawing.Size(36, 13);
102 | this.lblGreen.TabIndex = 10;
103 | this.lblGreen.Text = "Green";
104 | //
105 | // tbGreen
106 | //
107 | this.tbGreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
108 | | System.Windows.Forms.AnchorStyles.Right)));
109 | this.tbGreen.BackColor = System.Drawing.Color.White;
110 | this.tbGreen.Location = new System.Drawing.Point(68, 76);
111 | this.tbGreen.Maximum = 255;
112 | this.tbGreen.Name = "tbGreen";
113 | this.tbGreen.Size = new System.Drawing.Size(262, 45);
114 | this.tbGreen.TabIndex = 9;
115 | this.tbGreen.ValueChanged += new System.EventHandler(this.tb_ValueChanged);
116 | //
117 | // lblRed
118 | //
119 | this.lblRed.AutoSize = true;
120 | this.lblRed.Location = new System.Drawing.Point(14, 38);
121 | this.lblRed.Name = "lblRed";
122 | this.lblRed.Size = new System.Drawing.Size(27, 13);
123 | this.lblRed.TabIndex = 8;
124 | this.lblRed.Text = "Red";
125 | //
126 | // tbRed
127 | //
128 | this.tbRed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
129 | | System.Windows.Forms.AnchorStyles.Right)));
130 | this.tbRed.BackColor = System.Drawing.Color.White;
131 | this.tbRed.Location = new System.Drawing.Point(68, 25);
132 | this.tbRed.Maximum = 255;
133 | this.tbRed.Name = "tbRed";
134 | this.tbRed.Size = new System.Drawing.Size(262, 45);
135 | this.tbRed.TabIndex = 7;
136 | this.tbRed.ValueChanged += new System.EventHandler(this.tb_ValueChanged);
137 | //
138 | // ColorPickerUC
139 | //
140 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
141 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
142 | this.Controls.Add(this.groupBox1);
143 | this.Name = "ColorPickerUC";
144 | this.Size = new System.Drawing.Size(348, 366);
145 | this.groupBox1.ResumeLayout(false);
146 | this.groupBox1.PerformLayout();
147 | ((System.ComponentModel.ISupportInitialize)(this.tbBlue)).EndInit();
148 | ((System.ComponentModel.ISupportInitialize)(this.tbGreen)).EndInit();
149 | ((System.ComponentModel.ISupportInitialize)(this.tbRed)).EndInit();
150 | this.ResumeLayout(false);
151 |
152 | }
153 |
154 | #endregion
155 |
156 | private System.Windows.Forms.GroupBox groupBox1;
157 | private System.Windows.Forms.Panel pnlSample;
158 | private System.Windows.Forms.Label lblBlue;
159 | private System.Windows.Forms.TrackBar tbBlue;
160 | private System.Windows.Forms.Label lblGreen;
161 | private System.Windows.Forms.TrackBar tbGreen;
162 | private System.Windows.Forms.Label lblRed;
163 | private System.Windows.Forms.TrackBar tbRed;
164 |
165 | }
166 | }
167 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/ColorPickerUC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Windows.Forms;
4 | using Jot.Configuration;
5 |
6 | namespace TestWinForms
7 | {
8 | public partial class ColorPickerUC : UserControl, ITrackingAware
9 | {
10 | public ColorPickerUC()
11 | {
12 | InitializeComponent();
13 | }
14 |
15 | public void ConfigureTracking(TrackingConfiguration configuration)
16 | {
17 | configuration
18 | .AsGeneric()
19 | .Id(_ => Name)
20 | .Properties(x => new { red = tbRed.Value, green = tbGreen.Value, blue = tbBlue.Value })
21 | .PersistOn(nameof(Form.FormClosing), this.FindForm());
22 | }
23 |
24 | protected override void OnLoad(EventArgs e)
25 | {
26 | base.OnLoad(e);
27 | groupBox1.Text = Name;
28 | }
29 |
30 | private void tb_ValueChanged(object sender, EventArgs e)
31 | {
32 | pnlSample.BackColor = Color.FromArgb(255, tbRed.Value, tbGreen.Value, tbBlue.Value);
33 | }
34 | }
35 | }
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/ColorPickerUC.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Person.cs:
--------------------------------------------------------------------------------
1 | namespace TestWinForms
2 | {
3 | internal class Person
4 | {
5 | public string Name { get; internal set; }
6 | public string LastName { get; internal set; }
7 | public int Age { get; internal set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/Demo/TestWinForms/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace TestWinForms
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("TestWinForms")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("TestWinForms")]
13 | [assembly: AssemblyCopyright("Copyright © 2013")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("81d41f34-27ac-4cb3-8e9c-0a454716d560")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestWinForms.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TestWinForms.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace TestWinForms.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.3.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Demo/TestWinForms/Services.cs:
--------------------------------------------------------------------------------
1 | using Jot;
2 | using System.Windows.Forms;
3 |
4 | namespace TestWinForms
5 | {
6 | // tracker can be injected via an IOC container
7 | static class Services
8 | {
9 | public static Tracker Tracker = new Tracker();
10 |
11 | static Services()
12 | {
13 | // configure tracking for all Form objects
14 |
15 | Tracker
16 | .Configure