From baec4d444e4962076f538a7b494237ff1798b6cf Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Sat, 3 Mar 2018 06:53:48 +0700 Subject: [PATCH] v13 + Fix #1 (remove duplicate component args) + Fix scrolling propagation inside TreeView --- Vs2017-LIGUI/DocProcesser.cs | 7 +++---- Vs2017-LIGUI/MainWindow.xaml | 4 ++-- Vs2017-LIGUI/MainWindow.xaml.cs | 18 +++++++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Vs2017-LIGUI/DocProcesser.cs b/Vs2017-LIGUI/DocProcesser.cs index f8ccce2..97ed5e1 100644 --- a/Vs2017-LIGUI/DocProcesser.cs +++ b/Vs2017-LIGUI/DocProcesser.cs @@ -89,6 +89,7 @@ public enum Depedency public class DocProcesser { + // Markdown parsing starts here public void Process(string doc, List Workloads) { Workloads.Clear(); @@ -120,9 +121,10 @@ public void Process(string doc, List Workloads) while (i < lines.Length && lines[i++].Substring(0, 5) != "--- |") { + // we're incrementing i } - // begin fetch component + // begin fetching components while (lines[i].Substring(0, 3) != "## ") { var line3rd = lines[i++].Split('|'); @@ -143,9 +145,6 @@ public void Process(string doc, List Workloads) i++; } - foreach (var str in doc.Replace("\r", "").Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries)) - { - } } } diff --git a/Vs2017-LIGUI/MainWindow.xaml b/Vs2017-LIGUI/MainWindow.xaml index 6e22cb8..528370d 100644 --- a/Vs2017-LIGUI/MainWindow.xaml +++ b/Vs2017-LIGUI/MainWindow.xaml @@ -14,7 +14,7 @@ - + @@ -42,7 +42,7 @@ First top workload (The core editor) must be included. - + diff --git a/Vs2017-LIGUI/MainWindow.xaml.cs b/Vs2017-LIGUI/MainWindow.xaml.cs index 5a2276c..efd4e57 100644 --- a/Vs2017-LIGUI/MainWindow.xaml.cs +++ b/Vs2017-LIGUI/MainWindow.xaml.cs @@ -8,6 +8,7 @@ using System.Windows.Controls; using System.Windows.Data; using System.Windows.Navigation; +using System.Linq; namespace Vs2017LIGUI { @@ -174,6 +175,12 @@ private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e Process.Start(e.Uri.AbsoluteUri); e.Handled = true; } + + private void _workloads_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) + { + e.Handled = true; + _app.ScrollToVerticalOffset(_app.VerticalOffset - e.Delta * 0.5); + } } @@ -213,17 +220,17 @@ public void GenerateCLIs() { var exe = "vs_" + Name + ".exe "; var layout = "--layout C:\\vs2017Layout "; - var body = ""; + var body = new List(); var foot = ""; var lang = "--lang " + ComponentSettings.Lang; foreach (var loads in metadata.Workloads) { if (!string.IsNullOrEmpty(loads.ID) && loads.Selected) - body += "--add " + loads.ID + " "; + body.Add("--add " + loads.ID + " "); foreach (var comp in loads.Components) if (comp.SelfSelected && !comp.SelectedFromWorkload()) - body += "--add " + comp.ID + " "; + body.Add("--add " + comp.ID + " "); } if (ComponentSettings.UseRecommended) @@ -232,8 +239,9 @@ public void GenerateCLIs() if (ComponentSettings.UseOptional) foot = "--includeOptional " + foot; - GeneratedFetch = exe + layout + body + foot + lang; - GeneratedInstall = exe + body + foot + (Name == "Enterprise" ? "--noWeb" : ""); + var bodystr = string.Join("", body.Distinct()); + GeneratedFetch = (exe + layout + bodystr + foot + lang).Replace(" ", " "); + GeneratedInstall = exe + bodystr + foot + (Name == "Enterprise" ? "--noWeb" : ""); }