├── icon_newparam.ico
├── src
├── icon_newparam.ico
├── images
│ ├── icon_a.png
│ ├── screenshot.jpg
│ ├── icon_loading.png
│ ├── icon_newparam.ico
│ ├── icon_newparam.png
│ ├── icon_noparam.png
│ ├── icon_unknown.png
│ ├── icon_warning.png
│ └── icon_hybridparam.png
├── Program.cs
├── FormPreference.cs
├── FormInfo.cs
├── IDEPreferences.cs
├── Settings.cs
├── Form1.resx
├── FormInfo.resx
├── FormPreference.Designer.cs
├── Arduino.cs
├── FormInfo.Designer.cs
├── Form1.Designer.cs
└── Form1.cs
├── images
└── Application_Screenshot.jpg
├── Properties
├── AssemblyInfo.cs
├── Settings1.settings
├── Resources.Designer.cs
├── Resources.resx
└── Settings1.Designer.cs
├── README.MD
├── .gitattributes
├── ArduinoIDE_Launcher.csproj
├── App.config
├── ArduinoIDE_Launcher.sln
├── netFramework.csproj
└── .gitignore
/icon_newparam.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/icon_newparam.ico
--------------------------------------------------------------------------------
/src/icon_newparam.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/icon_newparam.ico
--------------------------------------------------------------------------------
/src/images/icon_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_a.png
--------------------------------------------------------------------------------
/src/images/screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/screenshot.jpg
--------------------------------------------------------------------------------
/src/images/icon_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_loading.png
--------------------------------------------------------------------------------
/src/images/icon_newparam.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_newparam.ico
--------------------------------------------------------------------------------
/src/images/icon_newparam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_newparam.png
--------------------------------------------------------------------------------
/src/images/icon_noparam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_noparam.png
--------------------------------------------------------------------------------
/src/images/icon_unknown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_unknown.png
--------------------------------------------------------------------------------
/src/images/icon_warning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_warning.png
--------------------------------------------------------------------------------
/src/images/icon_hybridparam.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/src/images/icon_hybridparam.png
--------------------------------------------------------------------------------
/images/Application_Screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Adrianotiger/ArduinoIDE_Launcher/master/images/Application_Screenshot.jpg
--------------------------------------------------------------------------------
/src/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Threading.Tasks;
5 | using System.Windows.Forms;
6 |
7 | namespace ArduinoIDE_Launcher
8 | {
9 | static class Program
10 | {
11 | ///
12 | /// The main entry point for the application.
13 | ///
14 | [STAThread]
15 | static void Main()
16 | {
17 | #if NETCOREAPP
18 | Application.SetHighDpiMode(HighDpiMode.SystemAware);
19 | #endif
20 | Application.EnableVisualStyles();
21 | Application.SetCompatibleTextRenderingDefault(false);
22 | Application.Run(new Form1());
23 | }
24 |
25 | public static List ErrorLog { get; set; } = new List();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/FormPreference.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace ArduinoIDE_Launcher
10 | {
11 | public partial class FormPreference : Form
12 | {
13 | public string NewValue { get; private set; } = "";
14 |
15 | public FormPreference(string parameterName, string parameterDefault, string parameterCustom)
16 | {
17 | InitializeComponent();
18 |
19 | label4.Text = parameterName;
20 | textBox2.Text = parameterDefault;
21 | textBox1.Text = NewValue = parameterCustom;
22 |
23 | textBox1.TextChanged += TextBox1_TextChanged;
24 | }
25 |
26 | private void TextBox1_TextChanged(object sender, EventArgs e)
27 | {
28 | button1.Enabled = true;
29 | NewValue = textBox1.Text;
30 | }
31 |
32 | private void button2_Click(object sender, EventArgs e)
33 | {
34 | DialogResult = DialogResult.Cancel;
35 | Close();
36 | }
37 |
38 | private void button1_Click(object sender, EventArgs e)
39 | {
40 | DialogResult = DialogResult.OK;
41 | Close();
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // Allgemeine Informationen über eine Assembly werden über die folgenden
6 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
7 | // die einer Assembly zugeordnet sind.
8 | [assembly: AssemblyTitle("Arduino IDE Launcher")]
9 | [assembly: AssemblyDescription("Launch Arduino IDE with custom preferences")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("-")]
12 | [assembly: AssemblyProduct("ArduinoIDE_Launcher.Properties")]
13 | [assembly: AssemblyCopyright("Adriano")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
18 | // für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
19 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
20 | [assembly: ComVisible(false)]
21 |
22 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
23 | [assembly: Guid("d2f845cd-71bf-4844-84d8-ef07e96b4d85")]
24 |
25 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
26 | //
27 | // Hauptversion
28 | // Nebenversion
29 | // Buildnummer
30 | // Revision
31 | //
32 | [assembly: AssemblyVersion("1.4.1.0")]
33 | [assembly: AssemblyFileVersion("1.4.1.0")]
34 |
--------------------------------------------------------------------------------
/src/FormInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Diagnostics;
6 | using System.Drawing;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace ArduinoIDE_Launcher
11 | {
12 | public partial class FormInfo : Form
13 | {
14 | public FormInfo()
15 | {
16 | InitializeComponent();
17 |
18 | //var ver1 = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
19 | //var ver2 = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
20 | }
21 |
22 | private void FormInfo_Load(object sender, EventArgs e)
23 | {
24 | label1.Text = "Framework: ";
25 | label2.Text = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription;
26 |
27 | label3.Text = "For OS: ";
28 | label4.Text = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
29 |
30 | label5.Text = "Framework version: ";
31 | label6.Text = System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion();
32 |
33 | label7.Text = "System/Process architecture: ";
34 | label8.Text = System.Runtime.InteropServices.RuntimeInformation.OSArchitecture.ToString() + " / " + System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString();
35 |
36 | label9.Text = "Application version: ";
37 | label10.Text = Application.ProductVersion;
38 | }
39 |
40 | private void button1_Click(object sender, EventArgs e)
41 | {
42 | Close();
43 | }
44 |
45 | private void LinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
46 | {
47 | ProcessStartInfo startInfo = new ProcessStartInfo
48 | {
49 | FileName = (sender as LinkLabel).Text
50 | };
51 |
52 | Process.Start(startInfo);
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/IDEPreferences.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Windows.Forms;
5 |
6 | namespace ArduinoIDE_Launcher
7 | {
8 | class IDEPreferences
9 | {
10 | private readonly List CheckStandard = new List { "board", "programmer", "software", "target_package", "target_platform" };
11 | private readonly List CheckGroups = new List { "CUSTOM" };
12 | private readonly List IgnoredParams = new List { "last.", "recent.sketches" };
13 |
14 | private String _param = "";
15 | public ListViewItem LVItem { get; set; } = null;
16 | public String Value { get; set; } = "";
17 |
18 | public String Group { get; private set; } = "";
19 | public String Parameter
20 | {
21 | get
22 | {
23 | return _param;
24 | }
25 | set
26 | {
27 | if (value.StartsWith("custom_")) Group = "CUSTOM";
28 | else if (value.Contains(".")) Group = value.Substring(0, value.IndexOf("."));
29 | _param = value;
30 | }
31 | }
32 |
33 | public String SubParameter
34 | {
35 | get
36 | {
37 | if (Parameter.Contains(".")) return Parameter.Substring(Parameter.IndexOf(".") + 1);
38 | else return Parameter;
39 | }
40 | }
41 |
42 | public bool CheckedDefault { get
43 | {
44 | if (Group != "") return (CheckGroups.Contains(Group));
45 | else return CheckStandard.Contains(Parameter);
46 | }
47 | }
48 |
49 | public bool IsIgnoring
50 | {
51 | get
52 | {
53 | for(var j=0;j
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 | 16
55 |
56 |
57 | 0
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 | False
67 |
68 |
69 |
--------------------------------------------------------------------------------
/ArduinoIDE_Launcher.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WinExe
5 | netcoreapp3.0
6 | true
7 | ArduinoIDE_Launcher.Program
8 | src\images\icon_newparam.ico
9 | Adriano
10 | -
11 | Launch Arduino with Project settings
12 | 1.4.1
13 | https://github.com/Adrianotiger/ArduinoIDE_Launcher
14 | icon_newparam.png
15 |
16 | https://github.com/Adrianotiger/ArduinoIDE_Launcher
17 |
18 |
19 |
20 | bin\netcore3\Debug\
21 | obj\netcore3\Debug\
22 |
23 |
24 |
25 | bin\netcore3\Release\
26 | obj\netcore3\Release\
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 | True
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 | True
58 | True
59 | Resources.resx
60 |
61 |
62 | True
63 | True
64 | Settings1.settings
65 |
66 |
67 |
68 |
69 |
70 | ResXFileCodeGenerator
71 | Resources.Designer.cs
72 |
73 |
74 |
75 |
76 |
77 | SettingsSingleFileGenerator
78 | Settings1.Designer.cs
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/App.config:
--------------------------------------------------------------------------------
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 |
56 |
57 |
58 |
59 |
60 |
61 |
62 | 16
63 |
64 |
65 | 0
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | False
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/ArduinoIDE_Launcher.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.779
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArduinoIDE_Launcher", "ArduinoIDE_Launcher.csproj", "{15A6B2B8-0DFF-41DD-8897-2442A44A9F11}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "netFramework", "netFramework.csproj", "{E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Debug|ARM = Debug|ARM
14 | Debug|ARM64 = Debug|ARM64
15 | Debug|x64 = Debug|x64
16 | Debug|x86 = Debug|x86
17 | Release|Any CPU = Release|Any CPU
18 | Release|ARM = Release|ARM
19 | Release|ARM64 = Release|ARM64
20 | Release|x64 = Release|x64
21 | Release|x86 = Release|x86
22 | EndGlobalSection
23 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
24 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|Any CPU.Build.0 = Debug|Any CPU
26 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|ARM.ActiveCfg = Debug|Any CPU
27 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|ARM.Build.0 = Debug|Any CPU
28 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|ARM64.ActiveCfg = Debug|Any CPU
29 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|ARM64.Build.0 = Debug|Any CPU
30 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|x64.ActiveCfg = Debug|Any CPU
31 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|x64.Build.0 = Debug|Any CPU
32 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|x86.ActiveCfg = Debug|Any CPU
33 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Debug|x86.Build.0 = Debug|Any CPU
34 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|Any CPU.ActiveCfg = Release|Any CPU
35 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|Any CPU.Build.0 = Release|Any CPU
36 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|ARM.ActiveCfg = Release|Any CPU
37 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|ARM.Build.0 = Release|Any CPU
38 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|ARM64.ActiveCfg = Release|Any CPU
39 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|ARM64.Build.0 = Release|Any CPU
40 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|x64.ActiveCfg = Release|Any CPU
41 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|x64.Build.0 = Release|Any CPU
42 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|x86.ActiveCfg = Release|Any CPU
43 | {15A6B2B8-0DFF-41DD-8897-2442A44A9F11}.Release|x86.Build.0 = Release|Any CPU
44 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|Any CPU.Build.0 = Debug|Any CPU
46 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|ARM.ActiveCfg = Debug|Any CPU
47 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|ARM.Build.0 = Debug|Any CPU
48 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|ARM64.ActiveCfg = Debug|Any CPU
49 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|ARM64.Build.0 = Debug|Any CPU
50 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|x64.ActiveCfg = Debug|Any CPU
51 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|x64.Build.0 = Debug|Any CPU
52 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|x86.ActiveCfg = Debug|Any CPU
53 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Debug|x86.Build.0 = Debug|Any CPU
54 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|Any CPU.ActiveCfg = Release|Any CPU
55 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|Any CPU.Build.0 = Release|Any CPU
56 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|ARM.ActiveCfg = Release|Any CPU
57 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|ARM.Build.0 = Release|Any CPU
58 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|ARM64.ActiveCfg = Release|Any CPU
59 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|ARM64.Build.0 = Release|Any CPU
60 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|x64.ActiveCfg = Release|Any CPU
61 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|x64.Build.0 = Release|Any CPU
62 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|x86.ActiveCfg = Release|Any CPU
63 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}.Release|x86.Build.0 = Release|Any CPU
64 | EndGlobalSection
65 | GlobalSection(SolutionProperties) = preSolution
66 | HideSolutionNode = FALSE
67 | EndGlobalSection
68 | GlobalSection(ExtensibilityGlobals) = postSolution
69 | SolutionGuid = {5793F624-7003-4D44-81F7-EA7562BAF969}
70 | EndGlobalSection
71 | EndGlobal
72 |
--------------------------------------------------------------------------------
/src/Settings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Text;
5 | using System.Windows.Forms;
6 |
7 | namespace ArduinoIDE_Launcher
8 | {
9 | class Settings
10 | {
11 | public static void Init()
12 | {
13 | if (!Properties.Settings1.Default.SettingsUpdated)
14 | {
15 | Properties.Settings1.Default.Upgrade();
16 | Properties.Settings1.Default.SettingsUpdated = true;
17 | Properties.Settings1.Default.Save();
18 | }
19 | }
20 |
21 | private static string FindArduinoFolderFromRegistry()
22 | {
23 | string arduinoIDEPath = null;
24 | var obj = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(".ino");
25 | if (obj != null && obj.GetValue("") != null)
26 | {
27 | var key = obj.GetValue("").ToString();
28 | var obj2 = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(key);
29 | var cmd = obj2.OpenSubKey("shell\\open\\command");
30 | if (cmd != null && cmd.GetValue("") != null)
31 | {
32 | var path = cmd.GetValue("").ToString();
33 | path = path.Trim('"');
34 | path = path.Substring(0, path.IndexOf('"'));
35 | arduinoIDEPath = path;
36 | }
37 | }
38 | return arduinoIDEPath;
39 | }
40 |
41 | public static string GetArduinoFolder()
42 | {
43 | if (Properties.Settings1.Default.ArduinoFolder.Length > 10)
44 | return Properties.Settings1.Default.ArduinoFolder;
45 | else
46 | return FindArduinoFolderFromRegistry();
47 | }
48 |
49 | public static void SetArduinoFolder(string path)
50 | {
51 | Properties.Settings1.Default.ArduinoFolder = path;
52 | Properties.Settings1.Default.Save();
53 | }
54 |
55 | public static void AddToRecent(string recent)
56 | {
57 | var found = false;
58 | for (var j = 0; j < Properties.Settings1.Default.RecentNum; j++)
59 | {
60 | if (recent == Properties.Settings1.Default["Recent" + j.ToString("D2")].ToString())
61 | {
62 | if (j > 0)
63 | {
64 | for (var k = j; k > 0; k--)
65 | {
66 | Properties.Settings1.Default["Recent" + k.ToString("D2")] = Properties.Settings1.Default["Recent" + (k - 1).ToString("D2")];
67 | }
68 | Properties.Settings1.Default["Recent00"] = recent;
69 | }
70 | found = true;
71 | break;
72 | }
73 | }
74 | if (!found)
75 | {
76 | for (var k = Properties.Settings1.Default.RecentNum; k > 0; k--)
77 | {
78 | Properties.Settings1.Default["Recent" + k.ToString("D2")] = Properties.Settings1.Default["Recent" + (k - 1).ToString("D2")];
79 | }
80 | Properties.Settings1.Default["Recent00"] = recent;
81 | if (Properties.Settings1.Default.RecentNum < 16) Properties.Settings1.Default.RecentNum++;
82 | }
83 | Properties.Settings1.Default.Save();
84 | }
85 |
86 | public static List GetRecentSketches()
87 | {
88 | List removeSketches = new List();
89 | List itemsList = new List();
90 | var recentCount = Properties.Settings1.Default.RecentNum;
91 | for (var j = 0; j < recentCount; j++)
92 | {
93 | var full = Properties.Settings1.Default["Recent" + j.ToString("D2")].ToString();
94 | var dir = Path.GetFileName(Path.GetDirectoryName(full));
95 | if (File.Exists(full))
96 | {
97 | var lvi = new ListViewItem(dir)
98 | {
99 | Tag = Path.GetDirectoryName(full),
100 | Group = new ListViewGroup("Recent"),// listView1.Groups["Recent"];
101 | ImageKey = "icon_loading"
102 | };
103 | itemsList.Add(lvi);
104 | }
105 | else
106 | {
107 | removeSketches.Add(j);
108 | }
109 | }
110 | removeSketches.Reverse();
111 | removeSketches.ForEach(i => RemoveRecentSketch(i));
112 | return itemsList;
113 | }
114 |
115 | public static void RemoveRecentSketch(int index)
116 | {
117 | var recentCount = Properties.Settings1.Default.RecentNum - 1;
118 | for (var j = index; j < recentCount; j++)
119 | {
120 | Properties.Settings1.Default["Recent" + j.ToString("D2")] = Properties.Settings1.Default["Recent" + (j+1).ToString("D2")].ToString();
121 | }
122 | Properties.Settings1.Default.RecentNum = recentCount;
123 | Properties.Settings1.Default.Save();
124 | }
125 | }
126 | }
--------------------------------------------------------------------------------
/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.42000
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ArduinoIDE_Launcher.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
17 | ///
18 | // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert
19 | // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert.
20 | // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen
21 | // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu.
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 | /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
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("ArduinoIDE_Launcher.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
51 | /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
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 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap icon_hybridparam {
67 | get {
68 | object obj = ResourceManager.GetObject("icon_hybridparam", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap icon_loading {
77 | get {
78 | object obj = ResourceManager.GetObject("icon_loading", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap icon_newparam {
87 | get {
88 | object obj = ResourceManager.GetObject("icon_newparam", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap icon_noparam {
97 | get {
98 | object obj = ResourceManager.GetObject("icon_noparam", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 |
103 | ///
104 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
105 | ///
106 | internal static System.Drawing.Bitmap icon_unknown {
107 | get {
108 | object obj = ResourceManager.GetObject("icon_unknown", resourceCulture);
109 | return ((System.Drawing.Bitmap)(obj));
110 | }
111 | }
112 |
113 | ///
114 | /// Sucht eine lokalisierte Ressource vom Typ System.Drawing.Bitmap.
115 | ///
116 | internal static System.Drawing.Bitmap icon_warning {
117 | get {
118 | object obj = ResourceManager.GetObject("icon_warning", resourceCulture);
119 | return ((System.Drawing.Bitmap)(obj));
120 | }
121 | }
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/src/Form1.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 |
--------------------------------------------------------------------------------
/src/FormInfo.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 |
--------------------------------------------------------------------------------
/src/FormPreference.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ArduinoIDE_Launcher
2 | {
3 | partial class FormPreference
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 Windows Form 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.label1 = new System.Windows.Forms.Label();
32 | this.label2 = new System.Windows.Forms.Label();
33 | this.label3 = new System.Windows.Forms.Label();
34 | this.label4 = new System.Windows.Forms.Label();
35 | this.textBox1 = new System.Windows.Forms.TextBox();
36 | this.button1 = new System.Windows.Forms.Button();
37 | this.button2 = new System.Windows.Forms.Button();
38 | this.textBox2 = new System.Windows.Forms.TextBox();
39 | //
40 | // label1
41 | //
42 | this.label1.AutoSize = true;
43 | this.label1.Location = new System.Drawing.Point(15, 14);
44 | this.label1.Name = "label1";
45 | this.label1.Size = new System.Drawing.Size(64, 15);
46 | this.label1.TabIndex = 0;
47 | this.label1.Text = "Parameter:";
48 | //
49 | // label2
50 | //
51 | this.label2.AutoSize = true;
52 | this.label2.Location = new System.Drawing.Point(15, 51);
53 | this.label2.Name = "label2";
54 | this.label2.Size = new System.Drawing.Size(48, 15);
55 | this.label2.TabIndex = 0;
56 | this.label2.Text = "Default:";
57 | //
58 | // label3
59 | //
60 | this.label3.AutoSize = true;
61 | this.label3.Location = new System.Drawing.Point(15, 91);
62 | this.label3.Name = "label3";
63 | this.label3.Size = new System.Drawing.Size(65, 15);
64 | this.label3.TabIndex = 0;
65 | this.label3.Text = "New value:";
66 | //
67 | // label4
68 | //
69 | this.label4.AutoSize = true;
70 | this.label4.Location = new System.Drawing.Point(123, 14);
71 | this.label4.Name = "label4";
72 | this.label4.Size = new System.Drawing.Size(38, 15);
73 | this.label4.TabIndex = 1;
74 | this.label4.Text = "label4";
75 | //
76 | // textBox1
77 | //
78 | this.textBox1.Location = new System.Drawing.Point(123, 88);
79 | this.textBox1.Name = "textBox1";
80 | this.textBox1.Size = new System.Drawing.Size(420, 23);
81 | this.textBox1.TabIndex = 3;
82 | //
83 | // button1
84 | //
85 | this.button1.Enabled = false;
86 | this.button1.Location = new System.Drawing.Point(69, 127);
87 | this.button1.Name = "button1";
88 | this.button1.Size = new System.Drawing.Size(189, 30);
89 | this.button1.TabIndex = 4;
90 | this.button1.Text = "SAVE";
91 | this.button1.UseVisualStyleBackColor = true;
92 | this.button1.Click += new System.EventHandler(this.button1_Click);
93 | //
94 | // button2
95 | //
96 | this.button2.Location = new System.Drawing.Point(309, 127);
97 | this.button2.Name = "button2";
98 | this.button2.Size = new System.Drawing.Size(189, 30);
99 | this.button2.TabIndex = 4;
100 | this.button2.Text = "CANCEL";
101 | this.button2.UseVisualStyleBackColor = true;
102 | this.button2.Click += new System.EventHandler(this.button2_Click);
103 | //
104 | // textBox2
105 | //
106 | this.textBox2.Location = new System.Drawing.Point(123, 48);
107 | this.textBox2.Name = "textBox2";
108 | this.textBox2.ReadOnly = true;
109 | this.textBox2.Size = new System.Drawing.Size(420, 23);
110 | this.textBox2.TabIndex = 5;
111 | //
112 | // FormPreference
113 | //
114 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
115 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
116 | this.ClientSize = new System.Drawing.Size(560, 174);
117 | this.Controls.Add(this.textBox2);
118 | this.Controls.Add(this.button1);
119 | this.Controls.Add(this.textBox1);
120 | this.Controls.Add(this.label4);
121 | this.Controls.Add(this.label1);
122 | this.Controls.Add(this.label2);
123 | this.Controls.Add(this.label3);
124 | this.Controls.Add(this.button2);
125 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
126 | this.Name = "FormPreference";
127 | this.ShowIcon = false;
128 | this.ShowInTaskbar = false;
129 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
130 | this.Text = "Preference Parameter";
131 |
132 | }
133 |
134 | #endregion
135 |
136 | private System.Windows.Forms.Label label1;
137 | private System.Windows.Forms.Label label2;
138 | private System.Windows.Forms.Label label3;
139 | private System.Windows.Forms.Label label4;
140 | private System.Windows.Forms.TextBox textBox1;
141 | private System.Windows.Forms.Button button1;
142 | private System.Windows.Forms.Button button2;
143 | private System.Windows.Forms.TextBox textBox2;
144 | }
145 | }
--------------------------------------------------------------------------------
/netFramework.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | WinExe
8 | ArduinoIDE_Launcher
9 | ArduinoIDE_Launcher
10 | 512
11 | false
12 | true
13 | false
14 | {E6D87CC8-884E-45E1-9B5B-C6E38FA90A51}
15 | v4.7.2
16 |
17 | publish\
18 | true
19 | Disk
20 | false
21 | Foreground
22 | 7
23 | Days
24 | false
25 | false
26 | true
27 | 0
28 | 1.0.0.%2a
29 | false
30 | true
31 |
32 |
33 | AnyCPU
34 | true
35 | full
36 | false
37 | bin\netframework47\Debug\
38 | obj\net47\Debug\
39 | obj\net47\
40 | DEBUG;TRACE
41 | prompt
42 | 4
43 | 8
44 | false
45 |
46 |
47 | AnyCPU
48 | pdbonly
49 | true
50 | bin\netframework47\Release\
51 | obj\net47\Release\
52 | obj\net47\
53 | TRACE
54 | prompt
55 | 4
56 | 8
57 | false
58 |
59 |
60 | src\images\icon_newparam.ico
61 |
62 |
63 | ArduinoIDE_Launcher.Program
64 |
65 |
66 |
67 |
68 | Settings11.Designer.cs
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | Form1.cs
84 |
85 |
86 | FormInfo.cs
87 |
88 |
89 |
90 |
91 |
92 | True
93 | True
94 | Resources.resx
95 |
96 |
97 | True
98 | True
99 | Settings1.settings
100 |
101 |
102 |
103 | Form
104 |
105 |
106 | Form1.cs
107 |
108 |
109 | Form
110 |
111 |
112 | FormInfo.cs
113 |
114 |
115 | Form
116 |
117 |
118 | FormPreference.cs
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 | ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.dll
127 |
128 |
129 |
130 |
131 | ..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2\System.Windows.Forms.dll
132 |
133 |
134 |
135 |
136 |
137 |
138 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | [Aa][Rr][Mm]/
24 | [Aa][Rr][Mm]64/
25 | bld/
26 | [Bb]in/
27 | [Oo]bj/
28 | [Ll]og/
29 |
30 | # Visual Studio 2015/2017 cache/options directory
31 | .vs/
32 | # Uncomment if you have tasks that create the project's static files in wwwroot
33 | #wwwroot/
34 |
35 | # Visual Studio 2017 auto generated files
36 | Generated\ Files/
37 |
38 | # MSTest test Results
39 | [Tt]est[Rr]esult*/
40 | [Bb]uild[Ll]og.*
41 |
42 | # NUNIT
43 | *.VisualState.xml
44 | TestResult.xml
45 |
46 | # Build Results of an ATL Project
47 | [Dd]ebugPS/
48 | [Rr]eleasePS/
49 | dlldata.c
50 |
51 | # Benchmark Results
52 | BenchmarkDotNet.Artifacts/
53 |
54 | # .NET Core
55 | project.lock.json
56 | project.fragment.lock.json
57 | artifacts/
58 |
59 | # StyleCop
60 | StyleCopReport.xml
61 |
62 | # Files built by Visual Studio
63 | *_i.c
64 | *_p.c
65 | *_h.h
66 | *.ilk
67 | *.meta
68 | *.obj
69 | *.iobj
70 | *.pch
71 | *.pdb
72 | *.ipdb
73 | *.pgc
74 | *.pgd
75 | *.rsp
76 | *.sbr
77 | *.tlb
78 | *.tli
79 | *.tlh
80 | *.tmp
81 | *.tmp_proj
82 | *_wpftmp.csproj
83 | *.log
84 | *.vspscc
85 | *.vssscc
86 | .builds
87 | *.pidb
88 | *.svclog
89 | *.scc
90 |
91 | # Chutzpah Test files
92 | _Chutzpah*
93 |
94 | # Visual C++ cache files
95 | ipch/
96 | *.aps
97 | *.ncb
98 | *.opendb
99 | *.opensdf
100 | *.sdf
101 | *.cachefile
102 | *.VC.db
103 | *.VC.VC.opendb
104 |
105 | # Visual Studio profiler
106 | *.psess
107 | *.vsp
108 | *.vspx
109 | *.sap
110 |
111 | # Visual Studio Trace Files
112 | *.e2e
113 |
114 | # TFS 2012 Local Workspace
115 | $tf/
116 |
117 | # Guidance Automation Toolkit
118 | *.gpState
119 |
120 | # ReSharper is a .NET coding add-in
121 | _ReSharper*/
122 | *.[Rr]e[Ss]harper
123 | *.DotSettings.user
124 |
125 | # JustCode is a .NET coding add-in
126 | .JustCode
127 |
128 | # TeamCity is a build add-in
129 | _TeamCity*
130 |
131 | # DotCover is a Code Coverage Tool
132 | *.dotCover
133 |
134 | # AxoCover is a Code Coverage Tool
135 | .axoCover/*
136 | !.axoCover/settings.json
137 |
138 | # Visual Studio code coverage results
139 | *.coverage
140 | *.coveragexml
141 |
142 | # NCrunch
143 | _NCrunch_*
144 | .*crunch*.local.xml
145 | nCrunchTemp_*
146 |
147 | # MightyMoose
148 | *.mm.*
149 | AutoTest.Net/
150 |
151 | # Web workbench (sass)
152 | .sass-cache/
153 |
154 | # Installshield output folder
155 | [Ee]xpress/
156 |
157 | # DocProject is a documentation generator add-in
158 | DocProject/buildhelp/
159 | DocProject/Help/*.HxT
160 | DocProject/Help/*.HxC
161 | DocProject/Help/*.hhc
162 | DocProject/Help/*.hhk
163 | DocProject/Help/*.hhp
164 | DocProject/Help/Html2
165 | DocProject/Help/html
166 |
167 | # Click-Once directory
168 | publish/
169 |
170 | # Publish Web Output
171 | *.[Pp]ublish.xml
172 | *.azurePubxml
173 | # Note: Comment the next line if you want to checkin your web deploy settings,
174 | # but database connection strings (with potential passwords) will be unencrypted
175 | *.pubxml
176 | *.publishproj
177 |
178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
179 | # checkin your Azure Web App publish settings, but sensitive information contained
180 | # in these scripts will be unencrypted
181 | PublishScripts/
182 |
183 | # NuGet Packages
184 | *.nupkg
185 | # The packages folder can be ignored because of Package Restore
186 | **/[Pp]ackages/*
187 | # except build/, which is used as an MSBuild target.
188 | !**/[Pp]ackages/build/
189 | # Uncomment if necessary however generally it will be regenerated when needed
190 | #!**/[Pp]ackages/repositories.config
191 | # NuGet v3's project.json files produces more ignorable files
192 | *.nuget.props
193 | *.nuget.targets
194 |
195 | # Microsoft Azure Build Output
196 | csx/
197 | *.build.csdef
198 |
199 | # Microsoft Azure Emulator
200 | ecf/
201 | rcf/
202 |
203 | # Windows Store app package directories and files
204 | AppPackages/
205 | BundleArtifacts/
206 | Package.StoreAssociation.xml
207 | _pkginfo.txt
208 | *.appx
209 |
210 | # Visual Studio cache files
211 | # files ending in .cache can be ignored
212 | *.[Cc]ache
213 | # but keep track of directories ending in .cache
214 | !?*.[Cc]ache/
215 |
216 | # Others
217 | ClientBin/
218 | ~$*
219 | *~
220 | *.dbmdl
221 | *.dbproj.schemaview
222 | *.jfm
223 | *.pfx
224 | *.publishsettings
225 | orleans.codegen.cs
226 |
227 | # Including strong name files can present a security risk
228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
229 | #*.snk
230 |
231 | # Since there are multiple workflows, uncomment next line to ignore bower_components
232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
233 | #bower_components/
234 |
235 | # RIA/Silverlight projects
236 | Generated_Code/
237 |
238 | # Backup & report files from converting an old project file
239 | # to a newer Visual Studio version. Backup files are not needed,
240 | # because we have git ;-)
241 | _UpgradeReport_Files/
242 | Backup*/
243 | UpgradeLog*.XML
244 | UpgradeLog*.htm
245 | ServiceFabricBackup/
246 | *.rptproj.bak
247 |
248 | # SQL Server files
249 | *.mdf
250 | *.ldf
251 | *.ndf
252 |
253 | # Business Intelligence projects
254 | *.rdl.data
255 | *.bim.layout
256 | *.bim_*.settings
257 | *.rptproj.rsuser
258 | *- Backup*.rdl
259 |
260 | # Microsoft Fakes
261 | FakesAssemblies/
262 |
263 | # GhostDoc plugin setting file
264 | *.GhostDoc.xml
265 |
266 | # Node.js Tools for Visual Studio
267 | .ntvs_analysis.dat
268 | node_modules/
269 |
270 | # Visual Studio 6 build log
271 | *.plg
272 |
273 | # Visual Studio 6 workspace options file
274 | *.opt
275 |
276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
277 | *.vbw
278 |
279 | # Visual Studio LightSwitch build output
280 | **/*.HTMLClient/GeneratedArtifacts
281 | **/*.DesktopClient/GeneratedArtifacts
282 | **/*.DesktopClient/ModelManifest.xml
283 | **/*.Server/GeneratedArtifacts
284 | **/*.Server/ModelManifest.xml
285 | _Pvt_Extensions
286 |
287 | # Paket dependency manager
288 | .paket/paket.exe
289 | paket-files/
290 |
291 | # FAKE - F# Make
292 | .fake/
293 |
294 | # JetBrains Rider
295 | .idea/
296 | *.sln.iml
297 |
298 | # CodeRush personal settings
299 | .cr/personal
300 |
301 | # Python Tools for Visual Studio (PTVS)
302 | __pycache__/
303 | *.pyc
304 |
305 | # Cake - Uncomment if you are using it
306 | # tools/**
307 | # !tools/packages.config
308 |
309 | # Tabs Studio
310 | *.tss
311 |
312 | # Telerik's JustMock configuration file
313 | *.jmconfig
314 |
315 | # BizTalk build output
316 | *.btp.cs
317 | *.btm.cs
318 | *.odx.cs
319 | *.xsd.cs
320 |
321 | # OpenCover UI analysis results
322 | OpenCover/
323 |
324 | # Azure Stream Analytics local run output
325 | ASALocalRun/
326 |
327 | # MSBuild Binary and Structured Log
328 | *.binlog
329 |
330 | # NVidia Nsight GPU debugger configuration file
331 | *.nvuser
332 |
333 | # MFractors (Xamarin productivity tool) working folder
334 | .mfractor/
335 |
336 | # Local History for Visual Studio
337 | .localhistory/
338 |
339 | # BeatPulse healthcheck temp database
340 | healthchecksdb
--------------------------------------------------------------------------------
/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 |
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 |
121 |
122 | ..\src\images\icon_hybridparam.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\src\images\icon_loading.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\src\images\icon_newparam.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 | ..\src\images\icon_noparam.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
132 |
133 |
134 | ..\src\images\icon_unknown.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
135 |
136 |
137 | ..\src\images\icon_warning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
138 |
139 |
--------------------------------------------------------------------------------
/src/Arduino.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace ArduinoIDE_Launcher
10 | {
11 | class Arduino
12 | {
13 | public static readonly string PreferencesFileName = "Preferences.txt";
14 | public static readonly string PreferencesFilePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
15 | public static readonly string PreferencesSketchBookParam = "sketchbook.path";
16 | public static readonly List PreferencesApplicationGroups = new List { "CUSTOM", "PROJECT" };
17 | public static readonly string IDE_PARAM_KEY = "**#ide_param:";
18 |
19 | public static class PreferencesColor
20 | {
21 | public static readonly Color Void = Color.White;
22 | public static readonly Color Disabled = Color.FromArgb(200, 200, 200);
23 | public static readonly Color Intendical = Color.FromArgb(200, 255, 200);
24 | public static readonly Color DifferentFile = Color.FromArgb(255, 255, 200);
25 | public static readonly Color DifferentIno = Color.FromArgb(250, 230, 200);
26 | };
27 |
28 | private readonly FileSystemWatcher Watcher = new FileSystemWatcher();
29 | private Action WatcherCallback = null;
30 |
31 | public Arduino()
32 | {
33 |
34 | }
35 |
36 | public string GetPreferencesDefaultFullPath()
37 | {
38 | string path = PreferencesFilePath;
39 | if (PreferencesFilePath.Contains("Roaming"))
40 | {
41 | path = PreferencesFilePath.Replace("Roaming", "Local");
42 | }
43 | path = Path.Combine(path, "Arduino15");
44 | return Path.Combine(path, PreferencesFileName);
45 | }
46 |
47 | public Dictionary LoadPreferences()
48 | {
49 | Dictionary settings = new Dictionary(StringComparer.InvariantCulture);
50 |
51 | if(!File.Exists(GetPreferencesDefaultFullPath()))
52 | {
53 | Program.ErrorLog.Add("[E|LoadPreferences] Preferences file '" + GetPreferencesDefaultFullPath() + "' not found.");
54 | return settings;
55 | }
56 | try
57 | {
58 | var lines = File.ReadAllLines(GetPreferencesDefaultFullPath());
59 |
60 | for (var j = 0; j < lines.Length; j++)
61 | {
62 | if (lines[j].IndexOf("=") > 1)
63 | {
64 | var param = lines[j].Substring(0, lines[j].IndexOf("="));
65 | var paramValue = lines[j].Substring(lines[j].IndexOf("=") + 1);
66 | settings.Add(param, new IDEPreferences
67 | {
68 | Value = paramValue,
69 | Parameter = param
70 | });
71 | }
72 | else
73 | {
74 | Program.ErrorLog.Add("[E|LoadPreferences] Error reading line '" + lines[j] + "'");
75 | }
76 | }
77 | }
78 | catch(Exception ex)
79 | {
80 | Program.ErrorLog.Add("[E|LoadPreferences] " + ex.Message);
81 | }
82 | return settings;
83 | }
84 |
85 | public List FindSketches(string path)
86 | {
87 | List itemsList = new List();
88 |
89 | if (path == null || path == "")
90 | {
91 | Program.ErrorLog.Add("Unable to find Arduino Sketch Path");
92 | return itemsList;
93 | }
94 |
95 | itemsList.AddRange(Settings.GetRecentSketches());
96 |
97 | var dirs = Directory.GetDirectories(path, "*", SearchOption.TopDirectoryOnly);
98 | for (var j = 0; j < dirs.Length; j++)
99 | {
100 | var dir = Path.GetFileName(dirs[j]);
101 | if (File.Exists(Path.Combine(dirs[j], dir + ".ino")))
102 | {
103 | var lvi = new ListViewItem(dir)
104 | {
105 | Tag = dirs[j],
106 | Group = new ListViewGroup("SketchFolder"),// listView1.Groups["SketchFolder"];
107 | ImageKey = "icon_loading"
108 | };
109 | itemsList.Add(lvi);
110 | }
111 | }
112 |
113 | return itemsList;
114 | }
115 |
116 | public void StartPreferencesWatcher(Action callback = null)
117 | {
118 | if (callback != null)
119 | {
120 | var path = Path.GetDirectoryName(GetPreferencesDefaultFullPath());
121 | try
122 | {
123 | Watcher.Path = path;
124 | Watcher.Filter = PreferencesFileName;
125 | Watcher.NotifyFilter = NotifyFilters.LastWrite;
126 | Watcher.Changed += Watcher_Changed; ;
127 | WatcherCallback = callback;
128 | }
129 | catch(Exception ex)
130 | {
131 | Program.ErrorLog.Add("[E|StartPreferencesWatcher]" + ex.Message);
132 | }
133 | }
134 | Watcher.EnableRaisingEvents = true;
135 | }
136 |
137 | public void StopPreferencesWatcher()
138 | {
139 | Watcher.EnableRaisingEvents = false;
140 | }
141 |
142 | private void Watcher_Changed(object sender, FileSystemEventArgs e)
143 | {
144 | WatcherCallback(0);
145 | }
146 |
147 | public Dictionary GetCustomPreferencesFile(string projectDirectory)
148 | {
149 | var ret = new Dictionary();
150 | var filePath = Path.GetFullPath(projectDirectory);
151 | if(File.Exists(Path.Combine(filePath, "." + PreferencesFileName)))
152 | {
153 | List lines = new List(File.ReadAllLines(Path.Combine(filePath, "." + PreferencesFileName)));
154 | lines.ForEach(s =>
155 | {
156 | if(s.Contains("="))
157 | {
158 | char[] splits = { '=' };
159 | var pair = s.Split(splits, 2);
160 | ret.Add(pair[0], pair[1]);
161 | }
162 | });
163 | }
164 | return ret;
165 | }
166 |
167 | public Dictionary GetCustomPreferencesIno(string projectFilePath)
168 | {
169 | var ret = new Dictionary();
170 | if (File.Exists(projectFilePath))
171 | {
172 | List lines = new List(File.ReadAllLines(projectFilePath));
173 | lines.ForEach(s =>
174 | {
175 | if (s.Contains(IDE_PARAM_KEY) && s.Contains("=") && s.IndexOf("=") > s.IndexOf(IDE_PARAM_KEY))
176 | {
177 | char[] splits = { '=' };
178 | var pair = s.Substring(s.IndexOf(IDE_PARAM_KEY) + IDE_PARAM_KEY.Length).Split(splits);
179 | ret.Add(pair[0], pair[1]);
180 | }
181 | });
182 | }
183 | return ret;
184 | }
185 |
186 | public bool LaunchArduinoIDE(Dictionary customPreferences, Dictionary settingsList, string projectPath)
187 | {
188 | bool successfull = true;
189 | using (Process pr = new Process())
190 | {
191 | try
192 | {
193 |
194 | var project = Path.GetFileName(projectPath) + ".ino";
195 | var projectArg = "\"" + Path.Combine(projectPath, project) + "\"";
196 |
197 | if (customPreferences.Count == 0)
198 | {
199 | pr.StartInfo = new ProcessStartInfo
200 | {
201 | FileName = Settings.GetArduinoFolder(),
202 | Arguments = " " + projectArg + ""
203 | };
204 | }
205 | else
206 | {
207 | var preference = "";
208 | foreach (var sl in settingsList.Values)
209 | {
210 | var p = "";
211 | if (sl.IsIgnoring) continue;
212 | p += sl.Parameter;
213 |
214 | if (sl.LVItem.Checked)
215 | {
216 | if (sl.Parameter == "sketchbook.path" && sl.LVItem.SubItems[2].Text.StartsWith(".."))
217 | {
218 | p += "=" + Path.Combine(projectPath, sl.LVItem.SubItems[2].Text) + "\r\n";
219 | }
220 | else
221 | {
222 | p += "=" + sl.LVItem.SubItems[2].Text + "\r\n";
223 | }
224 | }
225 | else
226 | p += "=" + sl.LVItem.SubItems[1].Text + "\r\n";
227 | preference += p;
228 | }
229 |
230 | var tempFile = Path.Combine(Path.GetTempPath(), project + "." + Arduino.PreferencesFileName);
231 | File.WriteAllText(tempFile, preference);
232 |
233 | pr.StartInfo = new ProcessStartInfo
234 | {
235 | FileName = Settings.GetArduinoFolder(),
236 | Arguments = " --preferences-file " + tempFile + " " + projectArg + ""
237 | };
238 | }
239 |
240 | pr.Start();
241 | }
242 | catch (Exception ex)
243 | {
244 | Program.ErrorLog.Add("[E|LaunchArduinoIDE]" + ex.Message);
245 | successfull = false;
246 | }
247 | }
248 |
249 | return successfull;
250 | }
251 |
252 | public void OpenSketchFolder(string sketchPath)
253 | {
254 | ProcessStartInfo startInfo = new ProcessStartInfo
255 | {
256 | Arguments = sketchPath,
257 | FileName = "explorer.exe"
258 | };
259 |
260 | Process.Start(startInfo);
261 | }
262 | }
263 | }
264 |
--------------------------------------------------------------------------------
/Properties/Settings1.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // Dieser Code wurde von einem Tool generiert.
4 | // Laufzeitversion:4.0.30319.42000
5 | //
6 | // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
7 | // der Code erneut generiert wird.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ArduinoIDE_Launcher.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.4.0.0")]
16 | internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1())));
19 |
20 | public static Settings1 Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 |
26 | [global::System.Configuration.UserScopedSettingAttribute()]
27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
28 | [global::System.Configuration.DefaultSettingValueAttribute("")]
29 | public string Recent01 {
30 | get {
31 | return ((string)(this["Recent01"]));
32 | }
33 | set {
34 | this["Recent01"] = value;
35 | }
36 | }
37 |
38 | [global::System.Configuration.UserScopedSettingAttribute()]
39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
40 | [global::System.Configuration.DefaultSettingValueAttribute("")]
41 | public string Recent02 {
42 | get {
43 | return ((string)(this["Recent02"]));
44 | }
45 | set {
46 | this["Recent02"] = value;
47 | }
48 | }
49 |
50 | [global::System.Configuration.UserScopedSettingAttribute()]
51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
52 | [global::System.Configuration.DefaultSettingValueAttribute("")]
53 | public string Recent03 {
54 | get {
55 | return ((string)(this["Recent03"]));
56 | }
57 | set {
58 | this["Recent03"] = value;
59 | }
60 | }
61 |
62 | [global::System.Configuration.UserScopedSettingAttribute()]
63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
64 | [global::System.Configuration.DefaultSettingValueAttribute("")]
65 | public string Recent04 {
66 | get {
67 | return ((string)(this["Recent04"]));
68 | }
69 | set {
70 | this["Recent04"] = value;
71 | }
72 | }
73 |
74 | [global::System.Configuration.UserScopedSettingAttribute()]
75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
76 | [global::System.Configuration.DefaultSettingValueAttribute("")]
77 | public string Recent05 {
78 | get {
79 | return ((string)(this["Recent05"]));
80 | }
81 | set {
82 | this["Recent05"] = value;
83 | }
84 | }
85 |
86 | [global::System.Configuration.UserScopedSettingAttribute()]
87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
88 | [global::System.Configuration.DefaultSettingValueAttribute("")]
89 | public string Recent06 {
90 | get {
91 | return ((string)(this["Recent06"]));
92 | }
93 | set {
94 | this["Recent06"] = value;
95 | }
96 | }
97 |
98 | [global::System.Configuration.UserScopedSettingAttribute()]
99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
100 | [global::System.Configuration.DefaultSettingValueAttribute("")]
101 | public string Recent07 {
102 | get {
103 | return ((string)(this["Recent07"]));
104 | }
105 | set {
106 | this["Recent07"] = value;
107 | }
108 | }
109 |
110 | [global::System.Configuration.UserScopedSettingAttribute()]
111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
112 | [global::System.Configuration.DefaultSettingValueAttribute("")]
113 | public string Recent08 {
114 | get {
115 | return ((string)(this["Recent08"]));
116 | }
117 | set {
118 | this["Recent08"] = value;
119 | }
120 | }
121 |
122 | [global::System.Configuration.UserScopedSettingAttribute()]
123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
124 | [global::System.Configuration.DefaultSettingValueAttribute("")]
125 | public string Recent09 {
126 | get {
127 | return ((string)(this["Recent09"]));
128 | }
129 | set {
130 | this["Recent09"] = value;
131 | }
132 | }
133 |
134 | [global::System.Configuration.UserScopedSettingAttribute()]
135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
136 | [global::System.Configuration.DefaultSettingValueAttribute("")]
137 | public string Recent10 {
138 | get {
139 | return ((string)(this["Recent10"]));
140 | }
141 | set {
142 | this["Recent10"] = value;
143 | }
144 | }
145 |
146 | [global::System.Configuration.UserScopedSettingAttribute()]
147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
148 | [global::System.Configuration.DefaultSettingValueAttribute("")]
149 | public string Recent11 {
150 | get {
151 | return ((string)(this["Recent11"]));
152 | }
153 | set {
154 | this["Recent11"] = value;
155 | }
156 | }
157 |
158 | [global::System.Configuration.UserScopedSettingAttribute()]
159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
160 | [global::System.Configuration.DefaultSettingValueAttribute("")]
161 | public string Recent12 {
162 | get {
163 | return ((string)(this["Recent12"]));
164 | }
165 | set {
166 | this["Recent12"] = value;
167 | }
168 | }
169 |
170 | [global::System.Configuration.UserScopedSettingAttribute()]
171 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
172 | [global::System.Configuration.DefaultSettingValueAttribute("")]
173 | public string Recent13 {
174 | get {
175 | return ((string)(this["Recent13"]));
176 | }
177 | set {
178 | this["Recent13"] = value;
179 | }
180 | }
181 |
182 | [global::System.Configuration.UserScopedSettingAttribute()]
183 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
184 | [global::System.Configuration.DefaultSettingValueAttribute("")]
185 | public string Recent14 {
186 | get {
187 | return ((string)(this["Recent14"]));
188 | }
189 | set {
190 | this["Recent14"] = value;
191 | }
192 | }
193 |
194 | [global::System.Configuration.UserScopedSettingAttribute()]
195 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
196 | [global::System.Configuration.DefaultSettingValueAttribute("")]
197 | public string Recent15 {
198 | get {
199 | return ((string)(this["Recent15"]));
200 | }
201 | set {
202 | this["Recent15"] = value;
203 | }
204 | }
205 |
206 | [global::System.Configuration.UserScopedSettingAttribute()]
207 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
208 | [global::System.Configuration.DefaultSettingValueAttribute("")]
209 | public string Recent16 {
210 | get {
211 | return ((string)(this["Recent16"]));
212 | }
213 | set {
214 | this["Recent16"] = value;
215 | }
216 | }
217 |
218 | [global::System.Configuration.UserScopedSettingAttribute()]
219 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
220 | [global::System.Configuration.DefaultSettingValueAttribute("16")]
221 | public int RecentMax {
222 | get {
223 | return ((int)(this["RecentMax"]));
224 | }
225 | set {
226 | this["RecentMax"] = value;
227 | }
228 | }
229 |
230 | [global::System.Configuration.UserScopedSettingAttribute()]
231 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
232 | [global::System.Configuration.DefaultSettingValueAttribute("0")]
233 | public int RecentNum {
234 | get {
235 | return ((int)(this["RecentNum"]));
236 | }
237 | set {
238 | this["RecentNum"] = value;
239 | }
240 | }
241 |
242 | [global::System.Configuration.UserScopedSettingAttribute()]
243 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
244 | [global::System.Configuration.DefaultSettingValueAttribute("")]
245 | public string Recent00 {
246 | get {
247 | return ((string)(this["Recent00"]));
248 | }
249 | set {
250 | this["Recent00"] = value;
251 | }
252 | }
253 |
254 | [global::System.Configuration.UserScopedSettingAttribute()]
255 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
256 | [global::System.Configuration.DefaultSettingValueAttribute("")]
257 | public string ArduinoFolder {
258 | get {
259 | return ((string)(this["ArduinoFolder"]));
260 | }
261 | set {
262 | this["ArduinoFolder"] = value;
263 | }
264 | }
265 |
266 | [global::System.Configuration.UserScopedSettingAttribute()]
267 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
268 | [global::System.Configuration.DefaultSettingValueAttribute("False")]
269 | public bool SettingsUpdated {
270 | get {
271 | return ((bool)(this["SettingsUpdated"]));
272 | }
273 | set {
274 | this["SettingsUpdated"] = value;
275 | }
276 | }
277 | }
278 | }
279 |
--------------------------------------------------------------------------------
/src/FormInfo.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace ArduinoIDE_Launcher
2 | {
3 | partial class FormInfo
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 Windows Form 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.label1 = new System.Windows.Forms.Label();
32 | this.label2 = new System.Windows.Forms.Label();
33 | this.label3 = new System.Windows.Forms.Label();
34 | this.label4 = new System.Windows.Forms.Label();
35 | this.label5 = new System.Windows.Forms.Label();
36 | this.label6 = new System.Windows.Forms.Label();
37 | this.label7 = new System.Windows.Forms.Label();
38 | this.label8 = new System.Windows.Forms.Label();
39 | this.label9 = new System.Windows.Forms.Label();
40 | this.label10 = new System.Windows.Forms.Label();
41 | this.button1 = new System.Windows.Forms.Button();
42 | this.label11 = new System.Windows.Forms.Label();
43 | this.linkLabel1 = new System.Windows.Forms.LinkLabel();
44 | this.linkLabel2 = new System.Windows.Forms.LinkLabel();
45 | this.label12 = new System.Windows.Forms.Label();
46 | this.linkLabel3 = new System.Windows.Forms.LinkLabel();
47 | this.label13 = new System.Windows.Forms.Label();
48 | this.label14 = new System.Windows.Forms.Label();
49 | this.label15 = new System.Windows.Forms.Label();
50 | this.SuspendLayout();
51 | //
52 | // label1
53 | //
54 | this.label1.AutoSize = true;
55 | this.label1.Location = new System.Drawing.Point(102, 9);
56 | this.label1.Name = "label1";
57 | this.label1.Size = new System.Drawing.Size(35, 13);
58 | this.label1.TabIndex = 0;
59 | this.label1.Text = "label1";
60 | //
61 | // label2
62 | //
63 | this.label2.AutoSize = true;
64 | this.label2.Location = new System.Drawing.Point(264, 9);
65 | this.label2.Name = "label2";
66 | this.label2.Size = new System.Drawing.Size(35, 13);
67 | this.label2.TabIndex = 1;
68 | this.label2.Text = "label2";
69 | //
70 | // label3
71 | //
72 | this.label3.AutoSize = true;
73 | this.label3.Location = new System.Drawing.Point(102, 31);
74 | this.label3.Name = "label3";
75 | this.label3.Size = new System.Drawing.Size(35, 13);
76 | this.label3.TabIndex = 3;
77 | this.label3.Text = "label3";
78 | //
79 | // label4
80 | //
81 | this.label4.AutoSize = true;
82 | this.label4.Location = new System.Drawing.Point(264, 31);
83 | this.label4.Name = "label4";
84 | this.label4.Size = new System.Drawing.Size(35, 13);
85 | this.label4.TabIndex = 2;
86 | this.label4.Text = "label4";
87 | //
88 | // label5
89 | //
90 | this.label5.AutoSize = true;
91 | this.label5.Location = new System.Drawing.Point(102, 53);
92 | this.label5.Name = "label5";
93 | this.label5.Size = new System.Drawing.Size(35, 13);
94 | this.label5.TabIndex = 5;
95 | this.label5.Text = "label5";
96 | //
97 | // label6
98 | //
99 | this.label6.AutoSize = true;
100 | this.label6.Location = new System.Drawing.Point(264, 53);
101 | this.label6.Name = "label6";
102 | this.label6.Size = new System.Drawing.Size(35, 13);
103 | this.label6.TabIndex = 4;
104 | this.label6.Text = "label6";
105 | //
106 | // label7
107 | //
108 | this.label7.AutoSize = true;
109 | this.label7.Location = new System.Drawing.Point(102, 76);
110 | this.label7.Name = "label7";
111 | this.label7.Size = new System.Drawing.Size(35, 13);
112 | this.label7.TabIndex = 7;
113 | this.label7.Text = "label7";
114 | //
115 | // label8
116 | //
117 | this.label8.AutoSize = true;
118 | this.label8.Location = new System.Drawing.Point(264, 76);
119 | this.label8.Name = "label8";
120 | this.label8.Size = new System.Drawing.Size(35, 13);
121 | this.label8.TabIndex = 6;
122 | this.label8.Text = "label8";
123 | //
124 | // label9
125 | //
126 | this.label9.AutoSize = true;
127 | this.label9.Location = new System.Drawing.Point(102, 98);
128 | this.label9.Name = "label9";
129 | this.label9.Size = new System.Drawing.Size(35, 13);
130 | this.label9.TabIndex = 8;
131 | this.label9.Text = "label9";
132 | //
133 | // label10
134 | //
135 | this.label10.AutoSize = true;
136 | this.label10.Location = new System.Drawing.Point(264, 98);
137 | this.label10.Name = "label10";
138 | this.label10.Size = new System.Drawing.Size(41, 13);
139 | this.label10.TabIndex = 9;
140 | this.label10.Text = "label10";
141 | //
142 | // button1
143 | //
144 | this.button1.Location = new System.Drawing.Point(267, 254);
145 | this.button1.Name = "button1";
146 | this.button1.Size = new System.Drawing.Size(66, 30);
147 | this.button1.TabIndex = 10;
148 | this.button1.Text = "OK";
149 | this.button1.UseVisualStyleBackColor = true;
150 | this.button1.Click += new System.EventHandler(this.button1_Click);
151 | //
152 | // label11
153 | //
154 | this.label11.AutoSize = true;
155 | this.label11.Location = new System.Drawing.Point(102, 128);
156 | this.label11.Name = "label11";
157 | this.label11.Size = new System.Drawing.Size(91, 13);
158 | this.label11.TabIndex = 11;
159 | this.label11.Text = "Launcher Project:";
160 | //
161 | // linkLabel1
162 | //
163 | this.linkLabel1.AutoSize = true;
164 | this.linkLabel1.Location = new System.Drawing.Point(267, 128);
165 | this.linkLabel1.Name = "linkLabel1";
166 | this.linkLabel1.Size = new System.Drawing.Size(266, 13);
167 | this.linkLabel1.TabIndex = 12;
168 | this.linkLabel1.TabStop = true;
169 | this.linkLabel1.Text = "https://github.com/Adrianotiger/ArduinoIDE_Launcher";
170 | this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabel_LinkClicked);
171 | //
172 | // linkLabel2
173 | //
174 | this.linkLabel2.AutoSize = true;
175 | this.linkLabel2.Location = new System.Drawing.Point(267, 151);
176 | this.linkLabel2.Name = "linkLabel2";
177 | this.linkLabel2.Size = new System.Drawing.Size(212, 13);
178 | this.linkLabel2.TabIndex = 14;
179 | this.linkLabel2.TabStop = true;
180 | this.linkLabel2.Text = "https://www.arduino.cc/en/Main/Software";
181 | //
182 | // label12
183 | //
184 | this.label12.AutoSize = true;
185 | this.label12.Location = new System.Drawing.Point(102, 151);
186 | this.label12.Name = "label12";
187 | this.label12.Size = new System.Drawing.Size(82, 13);
188 | this.label12.TabIndex = 13;
189 | this.label12.Text = "Arduino Project:";
190 | //
191 | // linkLabel3
192 | //
193 | this.linkLabel3.AutoSize = true;
194 | this.linkLabel3.Location = new System.Drawing.Point(267, 175);
195 | this.linkLabel3.Name = "linkLabel3";
196 | this.linkLabel3.Size = new System.Drawing.Size(271, 13);
197 | this.linkLabel3.TabIndex = 16;
198 | this.linkLabel3.TabStop = true;
199 | this.linkLabel3.Text = "https://dotnet.microsoft.com/download/dotnet-core/3.1";
200 | //
201 | // label13
202 | //
203 | this.label13.AutoSize = true;
204 | this.label13.Location = new System.Drawing.Point(102, 175);
205 | this.label13.Name = "label13";
206 | this.label13.Size = new System.Drawing.Size(111, 13);
207 | this.label13.TabIndex = 15;
208 | this.label13.Text = "Download .NET Core:";
209 | //
210 | // label14
211 | //
212 | this.label14.AutoSize = true;
213 | this.label14.Location = new System.Drawing.Point(102, 204);
214 | this.label14.Name = "label14";
215 | this.label14.Size = new System.Drawing.Size(61, 13);
216 | this.label14.TabIndex = 17;
217 | this.label14.Text = "Created by:";
218 | //
219 | // label15
220 | //
221 | this.label15.AutoSize = true;
222 | this.label15.Location = new System.Drawing.Point(264, 204);
223 | this.label15.Name = "label15";
224 | this.label15.Size = new System.Drawing.Size(85, 13);
225 | this.label15.TabIndex = 18;
226 | this.label15.Text = "Adriano Petrucci";
227 | //
228 | // FormInfo
229 | //
230 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
231 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
232 | this.ClientSize = new System.Drawing.Size(600, 298);
233 | this.Controls.Add(this.label14);
234 | this.Controls.Add(this.label15);
235 | this.Controls.Add(this.linkLabel3);
236 | this.Controls.Add(this.label13);
237 | this.Controls.Add(this.linkLabel2);
238 | this.Controls.Add(this.label12);
239 | this.Controls.Add(this.linkLabel1);
240 | this.Controls.Add(this.label11);
241 | this.Controls.Add(this.button1);
242 | this.Controls.Add(this.label9);
243 | this.Controls.Add(this.label10);
244 | this.Controls.Add(this.label8);
245 | this.Controls.Add(this.label6);
246 | this.Controls.Add(this.label4);
247 | this.Controls.Add(this.label2);
248 | this.Controls.Add(this.label7);
249 | this.Controls.Add(this.label5);
250 | this.Controls.Add(this.label3);
251 | this.Controls.Add(this.label1);
252 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
253 | this.Name = "FormInfo";
254 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
255 | this.Text = "About";
256 | this.Load += new System.EventHandler(this.FormInfo_Load);
257 | this.ResumeLayout(false);
258 | this.PerformLayout();
259 |
260 | }
261 |
262 | #endregion
263 |
264 | private System.Windows.Forms.Label label1;
265 | private System.Windows.Forms.Label label2;
266 | private System.Windows.Forms.Label label3;
267 | private System.Windows.Forms.Label label4;
268 | private System.Windows.Forms.Label label5;
269 | private System.Windows.Forms.Label label6;
270 | private System.Windows.Forms.Label label7;
271 | private System.Windows.Forms.Label label8;
272 | private System.Windows.Forms.Label label9;
273 | private System.Windows.Forms.Label label10;
274 | private System.Windows.Forms.Button button1;
275 | private System.Windows.Forms.Label label11;
276 | private System.Windows.Forms.LinkLabel linkLabel1;
277 | private System.Windows.Forms.LinkLabel linkLabel2;
278 | private System.Windows.Forms.Label label12;
279 | private System.Windows.Forms.LinkLabel linkLabel3;
280 | private System.Windows.Forms.Label label13;
281 | private System.Windows.Forms.Label label14;
282 | private System.Windows.Forms.Label label15;
283 | }
284 | }
--------------------------------------------------------------------------------
/src/Form1.Designer.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 |
3 | namespace ArduinoIDE_Launcher
4 | {
5 | partial class Form1
6 | {
7 | ///
8 | /// Required designer variable.
9 | ///
10 | private System.ComponentModel.IContainer components = null;
11 |
12 | ///
13 | /// Clean up any resources being used.
14 | ///
15 | /// true if managed resources should be disposed; otherwise, false.
16 | protected override void Dispose(bool disposing)
17 | {
18 | if (disposing && (components != null))
19 | {
20 | components.Dispose();
21 | }
22 | base.Dispose(disposing);
23 | }
24 |
25 | #region Windows Form Designer generated code
26 |
27 | ///
28 | /// Required method for Designer support - do not modify
29 | /// the contents of this method with the code editor.
30 | ///
31 | private void InitializeComponent()
32 | {
33 | System.Windows.Forms.ListViewGroup listViewGroup5 = new System.Windows.Forms.ListViewGroup("PROJECT", System.Windows.Forms.HorizontalAlignment.Left);
34 | System.Windows.Forms.ListViewGroup listViewGroup6 = new System.Windows.Forms.ListViewGroup("CUSTOM", System.Windows.Forms.HorizontalAlignment.Right);
35 | System.Windows.Forms.ListViewGroup listViewGroup7 = new System.Windows.Forms.ListViewGroup("Recent", System.Windows.Forms.HorizontalAlignment.Left);
36 | System.Windows.Forms.ListViewGroup listViewGroup8 = new System.Windows.Forms.ListViewGroup("Sketch Folder", System.Windows.Forms.HorizontalAlignment.Left);
37 | this.textBox1 = new System.Windows.Forms.TextBox();
38 | this.ListViewPreferences = new System.Windows.Forms.ListView();
39 | this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
40 | this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
41 | this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
42 | this.ListViewSketches = new System.Windows.Forms.ListView();
43 | this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
44 | this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
45 | this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
46 | this.ButtonImportIno = new System.Windows.Forms.Button();
47 | this.ButtonSavePref = new System.Windows.Forms.Button();
48 | this.progressBar1 = new System.Windows.Forms.ProgressBar();
49 | this.button3 = new System.Windows.Forms.Button();
50 | this.CheckBoxOptionStartDefault = new System.Windows.Forms.CheckBox();
51 | this.label1 = new System.Windows.Forms.Label();
52 | this.label2 = new System.Windows.Forms.Label();
53 | this.label4 = new System.Windows.Forms.Label();
54 | this.label3 = new System.Windows.Forms.Label();
55 | this.ButtonSaveCustom = new System.Windows.Forms.Button();
56 | this.button1 = new System.Windows.Forms.Button();
57 | this.SuspendLayout();
58 | //
59 | // textBox1
60 | //
61 | this.textBox1.Location = new System.Drawing.Point(521, 35);
62 | this.textBox1.Name = "textBox1";
63 | this.textBox1.ReadOnly = true;
64 | this.textBox1.Size = new System.Drawing.Size(348, 20);
65 | this.textBox1.TabIndex = 1;
66 | //
67 | // ListViewPreferences
68 | //
69 | this.ListViewPreferences.Activation = System.Windows.Forms.ItemActivation.OneClick;
70 | this.ListViewPreferences.CheckBoxes = true;
71 | this.ListViewPreferences.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
72 | this.columnHeader1,
73 | this.columnHeader2,
74 | this.columnHeader6});
75 | this.ListViewPreferences.FullRowSelect = true;
76 | this.ListViewPreferences.GridLines = true;
77 | listViewGroup5.Header = "PROJECT";
78 | listViewGroup5.Name = "PROJECT";
79 | listViewGroup6.Header = "CUSTOM";
80 | listViewGroup6.HeaderAlignment = System.Windows.Forms.HorizontalAlignment.Right;
81 | listViewGroup6.Name = "CUSTOM";
82 | this.ListViewPreferences.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
83 | listViewGroup5,
84 | listViewGroup6});
85 | this.ListViewPreferences.HideSelection = false;
86 | this.ListViewPreferences.LabelWrap = false;
87 | this.ListViewPreferences.Location = new System.Drawing.Point(416, 89);
88 | this.ListViewPreferences.MultiSelect = false;
89 | this.ListViewPreferences.Name = "ListViewPreferences";
90 | this.ListViewPreferences.Size = new System.Drawing.Size(453, 400);
91 | this.ListViewPreferences.TabIndex = 3;
92 | this.ListViewPreferences.UseCompatibleStateImageBehavior = false;
93 | this.ListViewPreferences.View = System.Windows.Forms.View.Details;
94 | this.ListViewPreferences.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.ListViewPreferences_ItemCheck);
95 | this.ListViewPreferences.SelectedIndexChanged += new System.EventHandler(this.ListViewPreferences_SelectedIndexChanged);
96 | this.ListViewPreferences.DoubleClick += new System.EventHandler(this.ListViewPreferences_DoubleClick);
97 | this.ListViewPreferences.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ListViewPreferences_MouseDown);
98 | //
99 | // columnHeader1
100 | //
101 | this.columnHeader1.Text = "Param";
102 | this.columnHeader1.Width = 200;
103 | //
104 | // columnHeader2
105 | //
106 | this.columnHeader2.Text = "Value";
107 | this.columnHeader2.Width = 150;
108 | //
109 | // columnHeader6
110 | //
111 | this.columnHeader6.Text = "New";
112 | this.columnHeader6.Width = 150;
113 | //
114 | // ListViewSketches
115 | //
116 | this.ListViewSketches.AllowColumnReorder = true;
117 | this.ListViewSketches.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
118 | this.columnHeader3,
119 | this.columnHeader4,
120 | this.columnHeader5});
121 | this.ListViewSketches.FullRowSelect = true;
122 | this.ListViewSketches.GridLines = true;
123 | listViewGroup7.Header = "Recent";
124 | listViewGroup7.Name = "Recent";
125 | listViewGroup8.Header = "Sketch Folder";
126 | listViewGroup8.Name = "SketchFolder";
127 | this.ListViewSketches.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] {
128 | listViewGroup7,
129 | listViewGroup8});
130 | this.ListViewSketches.HideSelection = false;
131 | this.ListViewSketches.Location = new System.Drawing.Point(11, 36);
132 | this.ListViewSketches.MultiSelect = false;
133 | this.ListViewSketches.Name = "ListViewSketches";
134 | this.ListViewSketches.Size = new System.Drawing.Size(400, 454);
135 | this.ListViewSketches.Sorting = System.Windows.Forms.SortOrder.Ascending;
136 | this.ListViewSketches.TabIndex = 5;
137 | this.ListViewSketches.UseCompatibleStateImageBehavior = false;
138 | this.ListViewSketches.View = System.Windows.Forms.View.Details;
139 | this.ListViewSketches.SelectedIndexChanged += new System.EventHandler(this.ListViewSketches_SelectedIndexChanged);
140 | this.ListViewSketches.DoubleClick += new System.EventHandler(this.ListViewSketches_DoubleClick);
141 | //
142 | // columnHeader3
143 | //
144 | this.columnHeader3.Text = "Project Name";
145 | this.columnHeader3.Width = 200;
146 | //
147 | // columnHeader4
148 | //
149 | this.columnHeader4.Text = "Board";
150 | this.columnHeader4.Width = 100;
151 | //
152 | // columnHeader5
153 | //
154 | this.columnHeader5.Text = "Date";
155 | this.columnHeader5.Width = 130;
156 | //
157 | // ButtonImportIno
158 | //
159 | this.ButtonImportIno.Location = new System.Drawing.Point(11, 5);
160 | this.ButtonImportIno.Name = "ButtonImportIno";
161 | this.ButtonImportIno.Size = new System.Drawing.Size(89, 21);
162 | this.ButtonImportIno.TabIndex = 6;
163 | this.ButtonImportIno.Text = "Import .ino";
164 | this.ButtonImportIno.UseVisualStyleBackColor = true;
165 | this.ButtonImportIno.Click += new System.EventHandler(this.ButtonImportIno_Click);
166 | //
167 | // ButtonSavePref
168 | //
169 | this.ButtonSavePref.Location = new System.Drawing.Point(534, 498);
170 | this.ButtonSavePref.Name = "ButtonSavePref";
171 | this.ButtonSavePref.Size = new System.Drawing.Size(192, 21);
172 | this.ButtonSavePref.TabIndex = 6;
173 | this.ButtonSavePref.Text = "Save current preferences to project";
174 | this.ButtonSavePref.UseVisualStyleBackColor = true;
175 | this.ButtonSavePref.Click += new System.EventHandler(this.ButtonSavePref_Click);
176 | //
177 | // progressBar1
178 | //
179 | this.progressBar1.Location = new System.Drawing.Point(11, 26);
180 | this.progressBar1.Name = "progressBar1";
181 | this.progressBar1.Size = new System.Drawing.Size(399, 9);
182 | this.progressBar1.TabIndex = 7;
183 | //
184 | // button3
185 | //
186 | this.button3.Location = new System.Drawing.Point(521, 60);
187 | this.button3.Name = "button3";
188 | this.button3.Size = new System.Drawing.Size(345, 24);
189 | this.button3.TabIndex = 8;
190 | this.button3.Text = "Click to set Arduino Path";
191 | this.button3.UseVisualStyleBackColor = true;
192 | this.button3.Click += new System.EventHandler(this.ButtonFindArduino_Click);
193 | //
194 | // CheckBoxOptionStartDefault
195 | //
196 | this.CheckBoxOptionStartDefault.AutoSize = true;
197 | this.CheckBoxOptionStartDefault.Location = new System.Drawing.Point(11, 502);
198 | this.CheckBoxOptionStartDefault.Name = "CheckBoxOptionStartDefault";
199 | this.CheckBoxOptionStartDefault.Size = new System.Drawing.Size(273, 17);
200 | this.CheckBoxOptionStartDefault.TabIndex = 9;
201 | this.CheckBoxOptionStartDefault.Text = "Start project with the default Arduino IDE parameters";
202 | this.CheckBoxOptionStartDefault.UseVisualStyleBackColor = true;
203 | //
204 | // label1
205 | //
206 | this.label1.AutoSize = true;
207 | this.label1.Location = new System.Drawing.Point(416, 37);
208 | this.label1.Name = "label1";
209 | this.label1.Size = new System.Drawing.Size(107, 13);
210 | this.label1.TabIndex = 10;
211 | this.label1.Text = "Preferences location:";
212 | //
213 | // label2
214 | //
215 | this.label2.AutoSize = true;
216 | this.label2.Location = new System.Drawing.Point(416, 64);
217 | this.label2.Name = "label2";
218 | this.label2.Size = new System.Drawing.Size(70, 13);
219 | this.label2.TabIndex = 11;
220 | this.label2.Text = "Arduino path:";
221 | //
222 | // label4
223 | //
224 | this.label4.AutoSize = true;
225 | this.label4.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
226 | this.label4.Location = new System.Drawing.Point(416, 13);
227 | this.label4.Name = "label4";
228 | this.label4.Size = new System.Drawing.Size(123, 15);
229 | this.label4.TabIndex = 11;
230 | this.label4.Text = "Arduino IDE settings:";
231 | //
232 | // label3
233 | //
234 | this.label3.AutoSize = true;
235 | this.label3.Font = new System.Drawing.Font("Segoe UI", 13F);
236 | this.label3.Location = new System.Drawing.Point(499, 498);
237 | this.label3.Name = "label3";
238 | this.label3.Size = new System.Drawing.Size(35, 25);
239 | this.label3.TabIndex = 12;
240 | this.label3.Text = "💾";
241 | //
242 | // ButtonSaveCustom
243 | //
244 | this.ButtonSaveCustom.Location = new System.Drawing.Point(731, 498);
245 | this.ButtonSaveCustom.Name = "ButtonSaveCustom";
246 | this.ButtonSaveCustom.Size = new System.Drawing.Size(137, 21);
247 | this.ButtonSaveCustom.TabIndex = 6;
248 | this.ButtonSaveCustom.Text = "Save new preferences";
249 | this.ButtonSaveCustom.UseVisualStyleBackColor = true;
250 | this.ButtonSaveCustom.Click += new System.EventHandler(this.ButtonSaveCustom_Click);
251 | //
252 | // button1
253 | //
254 | this.button1.Location = new System.Drawing.Point(322, 5);
255 | this.button1.Name = "button1";
256 | this.button1.Size = new System.Drawing.Size(89, 21);
257 | this.button1.TabIndex = 13;
258 | this.button1.Text = "About";
259 | this.button1.UseVisualStyleBackColor = true;
260 | this.button1.Click += new System.EventHandler(this.Button1_Click);
261 | //
262 | // Form1
263 | //
264 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
265 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
266 | this.ClientSize = new System.Drawing.Size(876, 528);
267 | this.Controls.Add(this.button1);
268 | this.Controls.Add(this.textBox1);
269 | this.Controls.Add(this.progressBar1);
270 | this.Controls.Add(this.label2);
271 | this.Controls.Add(this.label1);
272 | this.Controls.Add(this.CheckBoxOptionStartDefault);
273 | this.Controls.Add(this.button3);
274 | this.Controls.Add(this.ButtonImportIno);
275 | this.Controls.Add(this.ListViewSketches);
276 | this.Controls.Add(this.ListViewPreferences);
277 | this.Controls.Add(this.ButtonSavePref);
278 | this.Controls.Add(this.label4);
279 | this.Controls.Add(this.label3);
280 | this.Controls.Add(this.ButtonSaveCustom);
281 | this.DoubleBuffered = true;
282 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
283 | this.MaximizeBox = false;
284 | this.Name = "Form1";
285 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
286 | this.Text = "Arduino IDE Launcher";
287 | this.Load += new System.EventHandler(this.Form1_Load);
288 | this.ResumeLayout(false);
289 | this.PerformLayout();
290 |
291 | }
292 |
293 | #endregion
294 | private System.Windows.Forms.TextBox textBox1;
295 | private System.Windows.Forms.ListView ListViewPreferences;
296 | private System.Windows.Forms.ColumnHeader columnHeader1;
297 | private System.Windows.Forms.ColumnHeader columnHeader2;
298 | private System.Windows.Forms.ListView ListViewSketches;
299 | private System.Windows.Forms.ColumnHeader columnHeader3;
300 | private System.Windows.Forms.ColumnHeader columnHeader4;
301 | private System.Windows.Forms.ColumnHeader columnHeader5;
302 | private System.Windows.Forms.Button ButtonImportIno;
303 | private System.Windows.Forms.Button ButtonSavePref;
304 | private System.Windows.Forms.ProgressBar progressBar1;
305 | private System.Windows.Forms.ColumnHeader columnHeader6;
306 | private System.Windows.Forms.Button button3;
307 | private System.Windows.Forms.CheckBox CheckBoxOptionStartDefault;
308 | private System.Windows.Forms.Label label1;
309 | private System.Windows.Forms.Label label2;
310 | private System.Windows.Forms.Label label4;
311 | private System.Windows.Forms.Label label3;
312 | private System.Windows.Forms.Button ButtonSaveCustom;
313 | private System.Windows.Forms.Button button1;
314 | }
315 | }
316 |
317 |
--------------------------------------------------------------------------------
/src/Form1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Collections.Generic;
4 | using System.Drawing;
5 | using System.Globalization;
6 | using System.IO;
7 | using System.Linq;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 |
11 | namespace ArduinoIDE_Launcher
12 | {
13 | public partial class Form1 : Form
14 | {
15 | private Dictionary SettingList;
16 | private readonly Arduino ArduinoIDE = new Arduino();
17 | private bool PreferencesFilled = false;
18 | private bool checkFromDoubleClick = false;
19 |
20 | public Form1()
21 | {
22 | InitializeComponent();
23 | textBox1.Text = ArduinoIDE.GetPreferencesDefaultFullPath();
24 | ButtonSavePref.Enabled = false;
25 | }
26 |
27 | private void Form1_Load(object sender, EventArgs e)
28 | {
29 | if (!File.Exists(ArduinoIDE.GetPreferencesDefaultFullPath()))
30 | {
31 | MessageBox.Show("Unable to find Arduino parameters on " + ArduinoIDE.GetPreferencesDefaultFullPath(), "File not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
32 | return;
33 | }
34 |
35 | this.Enabled = false;
36 |
37 | progressBar1.Visible = true;
38 | progressBar1.Value = 10;
39 | PreferencesFilled = false;
40 |
41 | Text += " - v" + Application.ProductVersion;
42 |
43 | Settings.Init();
44 |
45 |
46 |
47 | if (Settings.GetArduinoFolder() != null)
48 | button3.Text = Settings.GetArduinoFolder();
49 |
50 | Task.Run(async () =>
51 | {
52 | await Task.Delay(50); // leave time to show form.
53 |
54 | SettingList = ArduinoIDE.LoadPreferences();
55 |
56 | this.Invoke(new Action(() =>
57 | {
58 | InitApplication();
59 | }));
60 |
61 | this.Invoke(new Action(() => { progressBar1.Value = 30; }));
62 |
63 | do {
64 | await Task.Delay(20);
65 | if (SettingList.ContainsKey(Arduino.PreferencesSketchBookParam)) break;
66 | } while (!PreferencesFilled);
67 |
68 | var sketches = ArduinoIDE.FindSketches(SettingList[Arduino.PreferencesSketchBookParam]?.Value);
69 |
70 | this.Invoke(new Action(() => { progressBar1.Value = 60; }));
71 |
72 | sketches.ForEach(lv =>
73 | {
74 | UpdateIcon(lv);
75 | });
76 |
77 | this.Invoke(new Action(() =>
78 | {
79 | FillSketches(sketches);
80 | }));
81 |
82 | this.Invoke(new Action(() => { progressBar1.Value = 100; }));
83 |
84 | await Task.Delay(500);
85 |
86 | this.Invoke(new Action(() => {
87 | ArduinoIDE.StartPreferencesWatcher(WatcherChanged);
88 | progressBar1.Visible = false;
89 | this.Enabled = true;
90 | }));
91 | });
92 | }
93 |
94 | private void InitApplication()
95 | {
96 | ListViewSketches.SmallImageList = new ImageList
97 | {
98 | ColorDepth = ColorDepth.Depth32Bit,
99 | ImageSize = new Size(16, 16)
100 | };
101 | var resourceSet = Properties.Resources.ResourceManager.GetResourceSet(CultureInfo.InvariantCulture, true, false);
102 | if (resourceSet != null)
103 | {
104 | foreach (DictionaryEntry entry in resourceSet)
105 | {
106 | //only get images
107 | if (entry.Value is Bitmap value)
108 | {
109 | ListViewSketches.SmallImageList.Images.Add((string)entry.Key, value);
110 | }
111 | }
112 | }
113 |
114 |
115 | ListViewSketches.ContextMenuStrip = new ContextMenuStrip
116 | {
117 | Text = "Sketch options",
118 | };
119 | var itemOpen = ListViewSketches.ContextMenuStrip.Items.Add("&Open");
120 | itemOpen.Click += (s, e) =>
121 | {
122 | ListViewSketches_DoubleClick(s, e);
123 | };
124 | var itemFolder = ListViewSketches.ContextMenuStrip.Items.Add("Open Sketch &Folder");
125 | itemFolder.Click += (s, e) =>
126 | {
127 | if (ListViewSketches.SelectedItems.Count > 0)
128 | {
129 | ArduinoIDE.OpenSketchFolder(ListViewSketches.SelectedItems[0].Tag.ToString());
130 | }
131 | };
132 |
133 |
134 |
135 | FillPreferences();
136 | }
137 |
138 | private void FillSketches(List items)
139 | {
140 | items.ForEach(i =>
141 | {
142 | i.Group = ListViewSketches.Groups[i.Group.Header];
143 | });
144 | ListViewSketches.Items.AddRange(items.ToArray());
145 | }
146 |
147 | private void UpdateIcon(ListViewItem lvi)
148 | {
149 | var path = lvi.Tag.ToString();
150 | var ino = Path.GetFileName(path).ToString();
151 | var filePath = Path.Combine(path, ino + ".ino");
152 | //var prefPath = Path.Combine(path, "." + Arduino.PreferencesFileName);
153 | lvi.SubItems.Clear();
154 | lvi.Text = ino;
155 | var paramsFile = ArduinoIDE.GetCustomPreferencesFile(path);
156 | var paramsIno = ArduinoIDE.GetCustomPreferencesIno(filePath);
157 |
158 | if (paramsFile.Count == 0 && paramsIno.Count == 0)
159 | {
160 | lvi.ImageKey = "icon_noparam";
161 | lvi.SubItems.Add("-");
162 | }
163 | else
164 | {
165 | if(paramsIno.ContainsKey("board"))
166 | {
167 | lvi.SubItems.Add(paramsIno["board"]);
168 | if(paramsFile.Count > 0)
169 | lvi.ImageKey = "icon_hybridparam";
170 | else
171 | lvi.ImageKey = "icon_newparam";
172 | }
173 | else if(paramsFile.ContainsKey("board"))
174 | {
175 | lvi.SubItems.Add(paramsFile["board"]);
176 | if (paramsIno.Count > 0)
177 | lvi.ImageKey = "icon_hybridparam";
178 | else
179 | lvi.ImageKey = "icon_warning";
180 | }
181 | else
182 | {
183 | lvi.SubItems.Add("-");
184 |
185 | if (paramsFile.Count > 0 && paramsIno.Count > 0)
186 | lvi.ImageKey = "icon_hybridparam";
187 | else if(paramsIno.Count > 0)
188 | lvi.ImageKey = "icon_newparam";
189 | else
190 | lvi.ImageKey = "icon_warning";
191 | }
192 | }
193 | lvi.SubItems.Add(File.GetLastWriteTime(filePath).ToString());
194 | }
195 |
196 | private void WatcherChanged(int status)
197 | {
198 | ArduinoIDE.StopPreferencesWatcher();
199 |
200 | this.Invoke(new Action(() =>
201 | {
202 | if (MessageBox.Show("Preferences changed, do you want reload the file?", "Arduino Preferences", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) == DialogResult.Yes)
203 | {
204 | SettingList = ArduinoIDE.LoadPreferences();
205 | FillPreferences();
206 | ListViewSketches.SelectedItems.Clear();
207 | }
208 | ArduinoIDE.StartPreferencesWatcher();
209 | }));
210 | }
211 |
212 | private void FillPreferences()
213 | {
214 | ListViewPreferences.Items.Clear();
215 | ListViewPreferences.Groups.Clear();
216 | Arduino.PreferencesApplicationGroups.ForEach(g => { ListViewPreferences.Groups.Add(g, g); });
217 |
218 | foreach (var s in SettingList.Values)
219 | {
220 | if (s.Group != "" && ListViewPreferences.Groups[s.Group] == null)
221 | {
222 | ListViewPreferences.Groups.Add(s.Group, s.Group);
223 | }
224 |
225 | var lvi = new ListViewItem(s.SubParameter);
226 | lvi.SubItems.Add(s.Value);
227 | lvi.SubItems.Add("");
228 |
229 | lvi.Group = ListViewPreferences.Groups[s.Group];
230 | lvi.Name = s.Parameter;
231 | lvi.Checked = s.CheckedDefault;
232 |
233 | s.LVItem = ListViewPreferences.Items.Add(lvi);
234 | };
235 |
236 | PreferencesFilled = true;
237 | }
238 |
239 | private void BlankListView2()
240 | {
241 | foreach (var sl in SettingList.Values)
242 | {
243 | if (sl.IsIgnoring)
244 | sl.LVItem.BackColor = Arduino.PreferencesColor.Disabled;
245 | else
246 | sl.LVItem.BackColor = Arduino.PreferencesColor.Void;
247 | sl.LVItem.SubItems[2].Text = "";
248 | };
249 | }
250 |
251 |
252 | private void ButtonFindArduino_Click(object sender, EventArgs e)
253 | {
254 | using var fo = new OpenFileDialog
255 | {
256 | Filter = "?rduino.exe|Arduino",
257 | FileName = "*rduino.exe",
258 | Title = "Find Arduino Location",
259 | InitialDirectory = button3.Text,
260 | CheckFileExists = true
261 | };
262 | if (fo.ShowDialog() == DialogResult.OK)
263 | {
264 | button3.Text = fo.FileName;
265 | Settings.SetArduinoFolder(fo.FileName);
266 | }
267 | }
268 |
269 | private void ButtonImportIno_Click(object sender, EventArgs e)
270 | {
271 | using var fd = new OpenFileDialog
272 | {
273 | Filter = "*.ino|ino project",
274 | Title = "Open Arduino Project",
275 | CheckFileExists = true,
276 | FileName = "*.ino",
277 | Multiselect = false
278 | };
279 | if (fd.ShowDialog() == DialogResult.OK)
280 | {
281 | var fn = Path.GetFileName(fd.FileName);
282 |
283 | var lvi = new ListViewItem(fn)
284 | {
285 | Tag = Path.GetDirectoryName(fd.FileName),
286 | Group = ListViewSketches.Groups["Recent"],
287 | ImageKey = "icon_loading"
288 | };
289 | ListViewSketches.Items.Add(lvi);
290 |
291 | Settings.AddToRecent(fd.FileName);
292 |
293 | UpdateIcon(lvi);
294 | }
295 | }
296 |
297 | private void ButtonSavePref_Click(object sender, EventArgs e)
298 | {
299 | if (ListViewSketches.SelectedItems.Count > 0)
300 | {
301 | var newFileName = Path.Combine(ListViewSketches.SelectedItems[0].Tag.ToString(), "." + Arduino.PreferencesFileName);
302 | if(File.Exists(newFileName))
303 | {
304 | if(MessageBox.Show("Do your really want overwrite your personalized preferences with this one?", "File already exists", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question) != DialogResult.Yes)
305 | {
306 | return;
307 | }
308 | }
309 | var preference = "";
310 | for (var j = 0; j < ListViewPreferences.Items.Count; j++)
311 | {
312 | if (ListViewPreferences.Items[j].Checked)
313 | {
314 | var p = "";
315 | if (ListViewPreferences.Items[j].Group == null || Arduino.PreferencesApplicationGroups.Contains(ListViewPreferences.Items[j].Group.Header))
316 | {
317 | p += ListViewPreferences.Items[j].Text;
318 | }
319 | else
320 | {
321 | p += ListViewPreferences.Items[j].Group.Name + "." + ListViewPreferences.Items[j].Text;
322 | }
323 | p += "=" + ListViewPreferences.Items[j].SubItems[1].Text + "\n";
324 | preference += p;
325 | }
326 | }
327 | File.WriteAllText(newFileName, preference);
328 | UpdateIcon(ListViewSketches.SelectedItems[0]);
329 | ListViewSketches.SelectedItems.Clear();
330 | }
331 | }
332 |
333 | private void ButtonSaveCustom_Click(object sender, EventArgs e)
334 | {
335 | if (ListViewSketches.SelectedItems.Count > 0)
336 | {
337 | var newFileName = Path.Combine(ListViewSketches.SelectedItems[0].Tag.ToString(), "." + Arduino.PreferencesFileName);
338 | var preference = "";
339 | for (var j = 0; j < ListViewPreferences.Items.Count; j++)
340 | {
341 | if (ListViewPreferences.Items[j].Checked)
342 | {
343 | var p = "";
344 | if (ListViewPreferences.Items[j].Group == null || Arduino.PreferencesApplicationGroups.Contains(ListViewPreferences.Items[j].Group.Header))
345 | {
346 | p += ListViewPreferences.Items[j].Text;
347 | }
348 | else
349 | {
350 | p += ListViewPreferences.Items[j].Group.Name + "." + ListViewPreferences.Items[j].Text;
351 | }
352 | p += "=" + ListViewPreferences.Items[j].SubItems[2].Text + "\n";
353 | preference += p;
354 | }
355 | }
356 | File.WriteAllText(newFileName, preference);
357 | UpdateIcon(ListViewSketches.SelectedItems[0]);
358 | ListViewSketches.SelectedItems.Clear();
359 | }
360 | }
361 |
362 | private void ListViewSketches_SelectedIndexChanged(object sender, EventArgs e)
363 | {
364 | BlankListView2();
365 | if (ListViewSketches.SelectedItems.Count > 0)
366 | {
367 | var lvi = ListViewSketches.SelectedItems[0];
368 | var pathIno = Path.Combine(lvi.Tag.ToString(), Path.GetFileName(lvi.Tag.ToString()) + ".ino");
369 |
370 | var paramsFile = ArduinoIDE.GetCustomPreferencesFile(lvi.Tag.ToString());
371 | var paramsIno = ArduinoIDE.GetCustomPreferencesIno(pathIno);
372 |
373 | foreach(var p in paramsFile)
374 | {
375 | if(SettingList.ContainsKey(p.Key))
376 | {
377 | if (SettingList[p.Key].LVItem.SubItems[1].Text == p.Value)
378 | {
379 | SettingList[p.Key].LVItem.BackColor = Arduino.PreferencesColor.Intendical;
380 | }
381 | else
382 | {
383 | SettingList[p.Key].LVItem.BackColor = Arduino.PreferencesColor.DifferentFile;
384 | SettingList[p.Key].LVItem.Checked = true;
385 | }
386 | SettingList[p.Key].LVItem.SubItems[2].Text = p.Value;
387 | }
388 | }
389 |
390 | foreach (var p in paramsIno)
391 | {
392 | if (SettingList.ContainsKey(p.Key))
393 | {
394 | if (SettingList[p.Key].LVItem.SubItems[1].Text == p.Value)
395 | {
396 | SettingList[p.Key].LVItem.BackColor = Arduino.PreferencesColor.Intendical;
397 | }
398 | else
399 | {
400 | SettingList[p.Key].LVItem.BackColor = Arduino.PreferencesColor.DifferentIno;
401 | SettingList[p.Key].LVItem.Checked = true;
402 | }
403 | SettingList[p.Key].LVItem.SubItems[2].Text = p.Value;
404 | }
405 | }
406 |
407 | ButtonSavePref.Enabled = true;
408 | ButtonSaveCustom.Enabled = false;
409 | }
410 | else
411 | {
412 | ButtonSavePref.Enabled = false;
413 | ButtonSaveCustom.Enabled = false;
414 | }
415 | }
416 |
417 | private void ListViewSketches_DoubleClick(object sender, EventArgs e)
418 | {
419 | if (ListViewSketches.SelectedItems.Count > 0)
420 | {
421 | ArduinoIDE.StopPreferencesWatcher();
422 |
423 | var lvi = ListViewSketches.SelectedItems[0];
424 | var projectPath = lvi.Tag.ToString();
425 | var pathIno = Path.Combine(lvi.Tag.ToString(), Path.GetFileName(projectPath) + ".ino");
426 | var success = true;
427 |
428 | if(CheckBoxOptionStartDefault.Checked)
429 | {
430 | success = ArduinoIDE.LaunchArduinoIDE(new Dictionary(), null, projectPath);
431 | }
432 | else
433 | {
434 | var paramsFile = ArduinoIDE.GetCustomPreferencesFile(lvi.Tag.ToString());
435 | var paramsIno = ArduinoIDE.GetCustomPreferencesIno(pathIno);
436 |
437 | paramsFile.ToList().ForEach(x => { if (!paramsIno.ContainsKey(x.Key)) paramsIno.Add(x.Key, x.Value); });
438 |
439 | success = ArduinoIDE.LaunchArduinoIDE(paramsIno, SettingList, projectPath);
440 | }
441 |
442 | if (success)
443 | {
444 | Settings.AddToRecent(pathIno);
445 | bool found = false;
446 |
447 | for (var j = 0; j < ListViewSketches.Groups["Recent"].Items.Count; j++)
448 | {
449 | if (ListViewSketches.Groups["Recent"].Items[j].Tag.ToString() == projectPath)
450 | {
451 | found = true;
452 | UpdateIcon(ListViewSketches.SelectedItems[0]);
453 | ListViewSketches.SelectedItems.Clear();
454 | ListViewSketches.Groups["Recent"].Items[j].Selected = true;
455 | break;
456 | }
457 | }
458 | if (!found)
459 | {
460 | ListViewSketches.SelectedItems[0].Group = ListViewSketches.Groups["Recent"];
461 | UpdateIcon(ListViewSketches.SelectedItems[0]);
462 | }
463 | }
464 | else
465 | {
466 | if(MessageBox.Show("Unable to launch Arduino IDE: \n Be sure the Arduino folder is selected", "Arduino launcher", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
467 | ButtonFindArduino_Click(sender, e);
468 | }
469 |
470 | ArduinoIDE.StartPreferencesWatcher();
471 | }
472 | }
473 |
474 | private void ListViewPreferences_DoubleClick(object sender, EventArgs e)
475 | {
476 | if (ListViewPreferences.SelectedItems.Count > 0)
477 | {
478 | var lvi = ListViewPreferences.SelectedItems[0];
479 |
480 | var param = SettingList.FirstOrDefault(x => x.Value.LVItem == lvi);
481 |
482 | if (param.Value != null)
483 | {
484 | using var f2 = new FormPreference(param.Key, param.Value.Value, lvi.SubItems[2].Text);
485 | if (f2.ShowDialog() == DialogResult.OK)
486 | {
487 | param.Value.LVItem.SubItems[2].Text = f2.NewValue;
488 | ButtonSaveCustom.Enabled = true;
489 | param.Value.LVItem.Checked = true;
490 | }
491 | }
492 | }
493 | }
494 |
495 | private void ListViewPreferences_ItemCheck(object sender, ItemCheckEventArgs e)
496 | {
497 | if(checkFromDoubleClick)
498 | {
499 | e.NewValue = e.CurrentValue;
500 | checkFromDoubleClick = false;
501 | }
502 | else if(ListViewSketches.SelectedItems.Count > 0)
503 | {
504 | ButtonSaveCustom.Enabled = true;
505 | }
506 | }
507 |
508 | private void ListViewPreferences_MouseDown(object sender, MouseEventArgs e)
509 | {
510 | if(e.Clicks > 1)
511 | {
512 | checkFromDoubleClick = true;
513 | }
514 | }
515 |
516 | private void ListViewPreferences_SelectedIndexChanged(object sender, EventArgs e)
517 | {
518 |
519 | }
520 |
521 | private void Button1_Click(object sender, EventArgs e)
522 | {
523 | var info = new FormInfo();
524 | info.ShowDialog();
525 | }
526 | }
527 | }
528 |
--------------------------------------------------------------------------------