This commit is contained in:
sibille 2017-03-08 13:27:23 +01:00
Родитель a7f924dc4f 9631ba099a
Коммит fe6f0080c5
13 изменённых файлов: 76 добавлений и 79 удалений

Просмотреть файл

@ -14,21 +14,6 @@ namespace Microsoft.Templates.Core
public string ProjectName { get; protected set; }
public string OutputPath { get; protected set; }
public GenShell()
{
ProjectName = GetActiveProjectName();
OutputPath = GetSelectedItemPath();
}
public GenShell(Dictionary<string, string> replacements)
{
ProjectName = replacements["$safeprojectname$"];
var di = new DirectoryInfo(replacements["$destinationdirectory$"]);
OutputPath = di.FullName;
}
protected abstract string GetActiveProjectName();
protected abstract string GetActiveProjectPath();
protected abstract string GetSelectedItemPath();

Просмотреть файл

@ -9,8 +9,8 @@ namespace Microsoft.Templates.Core.PostActions.Catalog.Merge
public static class IEnumerableExtensions
{
private const string MacroBeforeMode = "^^";
private const string MacroStartGroup = "{{";
private const string MarcoEndGroup = "}}";
private const string MacroStartGroup = "{[{";
private const string MarcoEndGroup = "}]}";
public static int SafeIndexOf(this IEnumerable<string> source, string item, int skip)
{

Просмотреть файл

@ -27,7 +27,6 @@ namespace Microsoft.Templates.Wizard
public GenShell Shell { get; }
//TODO: ERROR HANDLING
public GenController(GenShell shell) : this(shell, new TemplatesRepository(new RemoteTemplatesLocation()))
{
}
@ -41,7 +40,6 @@ namespace Microsoft.Templates.Wizard
_composer = new GenComposer(shell, repository);
AppHealth.Current.AddWriter(new ShellHealthWriter(shell));
}
public WizardState GetUserSelection(WizardSteps selectionSteps)

9
code/src/Wizard/Steps/Summary/Strings.Designer.cs сгенерированный
Просмотреть файл

@ -149,5 +149,14 @@ namespace Microsoft.Templates.Wizard.Steps.Summary {
return ResourceManager.GetString("ProjectsTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to SelectedFramework: .
/// </summary>
public static string SelectedFramework {
get {
return ResourceManager.GetString("SelectedFramework", resourceCulture);
}
}
}
}

Просмотреть файл

@ -147,4 +147,7 @@
<data name="ConsumerFeaturesTitle" xml:space="preserve">
<value>Consumer feature templates selected:</value>
</data>
<data name="SelectedFramework" xml:space="preserve">
<value>SelectedFramework: </value>
</data>
</root>

Просмотреть файл

@ -60,24 +60,5 @@ namespace Microsoft.Templates.Wizard.Steps.Summary
get { return _author; }
set { SetProperty(ref _author, value); }
}
private string _framework;
public string Framework
{
get { return _framework; }
set { SetProperty(ref _framework, value); }
}
private Visibility _licenceVisibility;
public Visibility LicenceVisibility
{
get { return _licenceVisibility; }
set { SetProperty(ref _licenceVisibility, value); }
}
private void ShowLicence()
{
MessageBox.Show(string.Format(Strings.LicenceDialogCaption, TemplateName));
}
}
}

Просмотреть файл

@ -22,41 +22,46 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<ItemsControl ItemsSource="{Binding Templates}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Visibility="{Binding Items, Converter={StaticResource CollectionToVisibilityConverter}}" Style="{StaticResource SummaryInfoContainerStyle}">
<TextBlock Text="{Binding Title}" Style="{StaticResource SummaryInfoTitleStyle}" />
<ItemsControl ItemsSource="{Binding Items}" Style="{StaticResource SummaryInfoItemsStyle}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat=", {0}, {1}, {2}">
<Binding Path="TemplateName" />
<Binding Path="Author" />
<Binding Path="Framework" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{x:Static local:Strings.SelectedFramework}" Style="{StaticResource SummaryInfoTitleStyle}" />
<TextBlock Text="{Binding SelectedFramework}" />
</StackPanel>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<ItemsControl ItemsSource="{Binding Templates}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Visibility="{Binding Items, Converter={StaticResource CollectionToVisibilityConverter}}" Style="{StaticResource SummaryInfoContainerStyle}">
<TextBlock Text="{Binding Title}" Style="{StaticResource SummaryInfoTitleStyle}" />
<ItemsControl ItemsSource="{Binding Items}" Style="{StaticResource SummaryInfoItemsStyle}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}" />
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat=", {0}, {1}">
<Binding Path="TemplateName" />
<Binding Path="Author" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</StackPanel>
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<Grid Grid.Row="1">
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
<Grid Grid.Row="2">
<Grid.Style>
<Style TargetType="Grid" BasedOn="{StaticResource LicencesContainerStyle}">
<Setter Property="Visibility" Value="Visible" />
@ -93,7 +98,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
<CheckBox Grid.Row="2" IsChecked="{Binding TermsAccepted}" Style="{StaticResource AcceptTermsStyle}">
<CheckBox Grid.Row="3" IsChecked="{Binding TermsAccepted}" Style="{StaticResource AcceptTermsStyle}">
<TextBlock Text="{x:Static local:Strings.AcceptTerms}" TextWrapping="Wrap" />
</CheckBox>
</Grid>

Просмотреть файл

@ -25,6 +25,13 @@ namespace Microsoft.Templates.Wizard.Steps.Summary
#endif
}
private string _selectedFramework;
public string SelectedFramework
{
get { return _selectedFramework; }
set { SetProperty(ref _selectedFramework, value); }
}
private bool _termsAccepted;
public bool TermsAccepted
{
@ -38,6 +45,8 @@ namespace Microsoft.Templates.Wizard.Steps.Summary
public override async Task InitializeAsync()
{
SelectedFramework = Context.State.Framework;
//TODO: REVIEW THIS
var allTemplates = new GenComposer(Context.Shell, Context.TemplatesRepository).Compose(Context.State);

Просмотреть файл

@ -24,13 +24,16 @@ namespace Microsoft.Templates.Wizard.Vsix
private Lazy<IVsUIShell> _uiShell = new Lazy<IVsUIShell>(() => ServiceProvider.GlobalProvider.GetService(typeof(SVsUIShell)) as IVsUIShell, true);
private IVsUIShell UIShell => _uiShell.Value;
//TODO: CACHE ON THIS
private VsOutputPane OutputPane => new VsOutputPane();
public VsGenShell()
{
}
public VsGenShell(Dictionary<string, string> replacements) : base(replacements)
public VsGenShell(Dictionary<string, string> replacements)
{
ProjectName = replacements["$safeprojectname$"];
var di = new DirectoryInfo(replacements["$destinationdirectory$"]);
OutputPath = di.FullName;
}
public override void AddItems(params string[] itemsFullPath)

Просмотреть файл

@ -22,12 +22,12 @@ namespace App38
var s = "";
}
//{{
//{[{
private static void ThisIsANewMethod()
{
//INSIDE NEW METHOD!!
}
//}}
//}]}
protected override void OnActivated(IActivatedEventArgs args)
{

Просмотреть файл

@ -1,5 +1,5 @@
<Page
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
DataContext={Binding uct.ItemNameViewModel, Source={StaticResource Locator}}
DataContext="{Binding uct.ItemNameViewModel, Source={StaticResource Locator}}"
mc:Ignorable="d">
</Page>

Просмотреть файл

@ -23,8 +23,6 @@ namespace ItemNamespace.MapPage
{
throw new ArgumentNullException("Expected type is MapControl");
}
//TODO UWPTemplates: Set your map access key. If you don't have it, request at https://www.bingmapsportal.com/
//map.AccessKey = "";
ViewModel.SetMap(map);
}

Просмотреть файл

@ -33,7 +33,13 @@ namespace ItemNamespace.MapPage
ZoomLevel = 19;
}
public void SetMap(MapControl map) => _map = map;
public void SetMap(MapControl map)
{
_map = map;
//TODO UWPTemplates: Set your map service token. If you don't have it, request at https://www.bingmapsportal.com/
_map.MapServiceToken = "";
}
private void LoadDataAsync()
{