Browse Source

Merge branch 'master' into add_common_math_operators_to_vector

pull/2761/head
Josua Jäger 7 years ago
committed by GitHub
parent
commit
3a01a2a860
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      build/AndroidWorkarounds.props
  2. 1
      src/Avalonia.Dialogs/Avalonia.Dialogs.csproj
  3. 2
      src/Avalonia.Dialogs/ManagedFileChooserViewModel.cs
  4. 57
      src/Avalonia.X11/X11KeyTransform.cs
  5. 2
      src/Markup/Avalonia.Markup.Xaml/XamlIl/CompilerExtensions/Transformers/AvaloniaXamlIlTransformInstanceAttachedProperties.cs
  6. 2
      src/Markup/Avalonia.Markup.Xaml/XamlIl/xamlil.github
  7. 2
      src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs
  8. 20
      tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BindingTests.cs

8
build/AndroidWorkarounds.props

@ -5,4 +5,12 @@
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.1" /> <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.1" />
<PackageReference Include="System.Buffers" Version="4.5.0" /> <PackageReference Include="System.Buffers" Version="4.5.0" />
</ItemGroup> </ItemGroup>
<Target Name="_RemoveNonExistingResgenFile" BeforeTargets="CoreCompile" Condition="'$(_SdkSetAndroidResgenFile)' == 'true' And '$(AndroidResgenFile)' != '' And !Exists('$(AndroidResgenFile)')">
<ItemGroup>
<Compile Remove="$(AndroidResgenFile)"/>
</ItemGroup>
</Target>
<PropertyGroup>
<DesignTimeBuild>false</DesignTimeBuild>
</PropertyGroup>
</Project> </Project>

1
src/Avalonia.Dialogs/Avalonia.Dialogs.csproj

@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

2
src/Avalonia.Dialogs/ManagedFileChooserViewModel.cs

@ -255,7 +255,7 @@ namespace Avalonia.Dialogs
{ {
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
infos = infos.Where(i => (i.Attributes & (FileAttributes.Hidden | FileAttributes.System)) != 0); infos = infos.Where(i => (i.Attributes & (FileAttributes.Hidden | FileAttributes.System)) == 0);
} }
else else
{ {

57
src/Avalonia.X11/X11KeyTransform.cs

@ -52,16 +52,6 @@ namespace Avalonia.X11
{X11Key.Delete, Key.Delete}, {X11Key.Delete, Key.Delete},
{X11Key.KP_Delete, Key.Delete}, {X11Key.KP_Delete, Key.Delete},
{X11Key.Help, Key.Help}, {X11Key.Help, Key.Help},
{X11Key.XK_0, Key.D0},
{X11Key.XK_1, Key.D1},
{X11Key.XK_2, Key.D2},
{X11Key.XK_3, Key.D3},
{X11Key.XK_4, Key.D4},
{X11Key.XK_5, Key.D5},
{X11Key.XK_6, Key.D6},
{X11Key.XK_7, Key.D7},
{X11Key.XK_8, Key.D8},
{X11Key.XK_9, Key.D9},
{X11Key.A, Key.A}, {X11Key.A, Key.A},
{X11Key.B, Key.B}, {X11Key.B, Key.B},
{X11Key.C, Key.C}, {X11Key.C, Key.C},
@ -114,8 +104,8 @@ namespace Avalonia.X11
{X11Key.x, Key.X}, {X11Key.x, Key.X},
{X11Key.y, Key.Y}, {X11Key.y, Key.Y},
{X11Key.z, Key.Z}, {X11Key.z, Key.Z},
//{ X11Key.?, Key.LWin } {X11Key.Meta_L, Key.LWin },
//{ X11Key.?, Key.RWin } {X11Key.Meta_R, Key.RWin },
{X11Key.Menu, Key.Apps}, {X11Key.Menu, Key.Apps},
//{ X11Key.?, Key.Sleep } //{ X11Key.?, Key.Sleep }
{X11Key.KP_0, Key.NumPad0}, {X11Key.KP_0, Key.NumPad0},
@ -185,20 +175,51 @@ namespace Avalonia.X11
//{ X11Key.?, Key.SelectMedia } //{ X11Key.?, Key.SelectMedia }
//{ X11Key.?, Key.LaunchApplication1 } //{ X11Key.?, Key.LaunchApplication1 }
//{ X11Key.?, Key.LaunchApplication2 } //{ X11Key.?, Key.LaunchApplication2 }
{X11Key.semicolon, Key.OemSemicolon}, {X11Key.minus, Key.OemMinus},
{X11Key.underscore, Key.OemMinus},
{X11Key.plus, Key.OemPlus}, {X11Key.plus, Key.OemPlus},
{X11Key.equal, Key.OemPlus}, {X11Key.equal, Key.OemPlus},
{X11Key.bracketleft, Key.OemOpenBrackets},
{X11Key.braceleft, Key.OemOpenBrackets},
{X11Key.bracketright, Key.OemCloseBrackets},
{X11Key.braceright, Key.OemCloseBrackets},
{X11Key.backslash, Key.OemPipe},
{X11Key.bar, Key.OemPipe},
{X11Key.semicolon, Key.OemSemicolon},
{X11Key.colon, Key.OemSemicolon},
{X11Key.apostrophe, Key.OemQuotes},
{X11Key.quotedbl, Key.OemQuotes},
{X11Key.comma, Key.OemComma}, {X11Key.comma, Key.OemComma},
{X11Key.minus, Key.OemMinus}, {X11Key.less, Key.OemComma},
{X11Key.period, Key.OemPeriod}, {X11Key.period, Key.OemPeriod},
{X11Key.greater, Key.OemPeriod},
{X11Key.slash, Key.Oem2}, {X11Key.slash, Key.Oem2},
{X11Key.question, Key.Oem2},
{X11Key.grave, Key.OemTilde}, {X11Key.grave, Key.OemTilde},
{X11Key.asciitilde, Key.OemTilde},
{X11Key.XK_1, Key.D1},
{X11Key.exclam, Key.D1},
{X11Key.XK_2, Key.D2},
{X11Key.at, Key.D2},
{X11Key.XK_3, Key.D3},
{X11Key.numbersign, Key.D3},
{X11Key.XK_4, Key.D4},
{X11Key.dollar, Key.D4},
{X11Key.XK_5, Key.D5},
{X11Key.percent, Key.D5},
{X11Key.XK_6, Key.D6},
{X11Key.asciicircum, Key.D6},
{X11Key.XK_7, Key.D7},
{X11Key.ampersand, Key.D7},
{X11Key.XK_8, Key.D8},
{X11Key.asterisk, Key.D8},
{X11Key.XK_9, Key.D9},
{X11Key.parenleft, Key.D9},
{X11Key.XK_0, Key.D0},
{X11Key.parenright, Key.D0},
//{ X11Key.?, Key.AbntC1 } //{ X11Key.?, Key.AbntC1 }
//{ X11Key.?, Key.AbntC2 } //{ X11Key.?, Key.AbntC2 }
{X11Key.bracketleft, Key.OemOpenBrackets},
{X11Key.backslash, Key.OemPipe},
{X11Key.bracketright, Key.OemCloseBrackets},
{X11Key.apostrophe, Key.OemQuotes},
//{ X11Key.?, Key.Oem8 } //{ X11Key.?, Key.Oem8 }
//{ X11Key.?, Key.Oem102 } //{ X11Key.?, Key.Oem102 }
//{ X11Key.?, Key.ImeProcessed } //{ X11Key.?, Key.ImeProcessed }

2
src/Markup/Avalonia.Markup.Xaml/XamlIl/CompilerExtensions/Transformers/AvaloniaXamlIlTransformInstanceAttachedProperties.cs

@ -164,6 +164,8 @@ namespace Avalonia.Markup.Xaml.XamlIl.CompilerExtensions.Transformers
public bool IsStatic => true; public bool IsStatic => true;
public string Name { get; protected set; } public string Name { get; protected set; }
public IXamlIlType DeclaringType { get; } public IXamlIlType DeclaringType { get; }
public IXamlIlMethod MakeGenericMethod(IReadOnlyList<IXamlIlType> typeArguments)
=> throw new System.NotSupportedException();
public bool Equals(IXamlIlMethod other) => public bool Equals(IXamlIlMethod other) =>

2
src/Markup/Avalonia.Markup.Xaml/XamlIl/xamlil.github

@ -1 +1 @@
Subproject commit c2ec091f79fb4e1eea629bc823c9c24da7050022 Subproject commit c7155c5f6c1a5153ee2d8cd78e5d1524dd6744cf

2
src/Windows/Avalonia.Win32/WindowsMountedVolumeInfoListener.cs

@ -11,7 +11,7 @@ namespace Avalonia.Win32
internal class WindowsMountedVolumeInfoListener : IDisposable internal class WindowsMountedVolumeInfoListener : IDisposable
{ {
private readonly CompositeDisposable _disposables; private readonly CompositeDisposable _disposables;
private readonly ObservableCollection<MountedVolumeInfo> _targetObs; private readonly ObservableCollection<MountedVolumeInfo> _targetObs = new ObservableCollection<MountedVolumeInfo>();
private bool _beenDisposed = false; private bool _beenDisposed = false;
private ObservableCollection<MountedVolumeInfo> mountedDrives; private ObservableCollection<MountedVolumeInfo> mountedDrives;

20
tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BindingTests.cs

@ -309,8 +309,12 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
} }
} }
[Fact] [Theory,
public void Binding_To_TextBlock_Text_With_StringConverter_Works() InlineData(@"Hello \{0\}"),
InlineData(@"'Hello {0}'"),
InlineData(@"Hello {0}")]
public void Binding_To_TextBlock_Text_With_StringConverter_Works(string fmt)
{ {
using (UnitTestApplication.Start(TestServices.StyledWindow)) using (UnitTestApplication.Start(TestServices.StyledWindow))
{ {
@ -318,8 +322,8 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
<Window xmlns='https://github.com/avaloniaui' <Window xmlns='https://github.com/avaloniaui'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
xmlns:local='clr-namespace:Avalonia.Markup.Xaml.UnitTests.Xaml;assembly=Avalonia.Markup.Xaml.UnitTests'> xmlns:local='clr-namespace:Avalonia.Markup.Xaml.UnitTests.Xaml;assembly=Avalonia.Markup.Xaml.UnitTests'>
<TextBlock Name='textBlock' Text='{Binding Foo, StringFormat=Hello \{0\}}'/> <TextBlock Name='textBlock' Text=""{Binding Foo, StringFormat=" + fmt + @"}""/>
</Window>"; </Window>";
var loader = new AvaloniaXamlLoader(); var loader = new AvaloniaXamlLoader();
var window = (Window)loader.Load(xaml); var window = (Window)loader.Load(xaml);
var textBlock = window.FindControl<TextBlock>("textBlock"); var textBlock = window.FindControl<TextBlock>("textBlock");
@ -331,8 +335,10 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
} }
} }
[Fact(Skip="Issue #2592")] [Theory,
public void MultiBinding_To_TextBlock_Text_With_StringConverter_Works() InlineData("{}{0} {1}!"),
InlineData(@"\{0\} \{1\}!")]
public void MultiBinding_To_TextBlock_Text_With_StringConverter_Works(string fmt)
{ {
using (UnitTestApplication.Start(TestServices.StyledWindow)) using (UnitTestApplication.Start(TestServices.StyledWindow))
{ {
@ -342,7 +348,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
xmlns:local='clr-namespace:Avalonia.Markup.Xaml.UnitTests.Xaml;assembly=Avalonia.Markup.Xaml.UnitTests'> xmlns:local='clr-namespace:Avalonia.Markup.Xaml.UnitTests.Xaml;assembly=Avalonia.Markup.Xaml.UnitTests'>
<TextBlock Name='textBlock'> <TextBlock Name='textBlock'>
<TextBlock.Text> <TextBlock.Text>
<MultiBinding StringFormat='\{0\} \{1\}!'> <MultiBinding StringFormat='" + fmt + @"'>
<Binding Path='Greeting1'/> <Binding Path='Greeting1'/>
<Binding Path='Greeting2'/> <Binding Path='Greeting2'/>
</MultiBinding> </MultiBinding>

Loading…
Cancel
Save