Skip to content

Commit

Permalink
v13
Browse files Browse the repository at this point in the history
+ Fix #1 (remove duplicate component args)
+ Fix scrolling propagation inside TreeView
  • Loading branch information
willnode committed Mar 2, 2018
1 parent d066c20 commit baec4d4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
7 changes: 3 additions & 4 deletions Vs2017-LIGUI/DocProcesser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public enum Depedency
public class DocProcesser
{

// Markdown parsing starts here
public void Process(string doc, List<Workload> Workloads)
{
Workloads.Clear();
Expand Down Expand Up @@ -120,9 +121,10 @@ public void Process(string doc, List<Workload> 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('|');
Expand All @@ -143,9 +145,6 @@ public void Process(string doc, List<Workload> Workloads)
i++;

}
foreach (var str in doc.Replace("\r", "").Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries))
{
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions Vs2017-LIGUI/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</Window.Resources>
<ScrollViewer>
<ScrollViewer x:Name="_app">
<StackPanel Orientation="Vertical" CanVerticallyScroll="True">
<GroupBox Header="1. Select Edition">
<UniformGrid Columns="3">
Expand Down Expand Up @@ -42,7 +42,7 @@
<Italic>First top workload (The core editor) must be included.</Italic>
</TextBlock>
</UniformGrid>
<TreeView x:Name="_workloads">
<TreeView x:Name="_workloads" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" PreviewMouseWheel="_workloads_PreviewMouseWheel">
<TreeView.ItemTemplate>
<DataTemplate DataType="Workload" >
<TreeViewItem IsExpanded="{Binding Expanded, Mode=TwoWay}" ItemsSource="{Binding Components}">
Expand Down
18 changes: 13 additions & 5 deletions Vs2017-LIGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Navigation;
using System.Linq;

namespace Vs2017LIGUI
{
Expand Down Expand Up @@ -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);
}
}


Expand Down Expand Up @@ -213,17 +220,17 @@ public void GenerateCLIs()
{
var exe = "vs_" + Name + ".exe ";
var layout = "--layout C:\\vs2017Layout ";
var body = "";
var body = new List<string>();
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)
Expand All @@ -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" : "");
}


Expand Down

0 comments on commit baec4d4

Please sign in to comment.