166 changed files with 2013 additions and 4514 deletions
@ -1,7 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net46" /> |
|||
<package id="Splat" version="1.6.2" targetFramework="net46" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1,4 +0,0 @@ |
|||
<GettingStarted> |
|||
<LocalContent>GS\Android\CS\AndroidApp\GettingStarted.html</LocalContent> |
|||
<EmbeddedNavigation>false</EmbeddedNavigation> |
|||
</GettingStarted> |
|||
@ -1,4 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net451" /> |
|||
</packages> |
|||
@ -0,0 +1,13 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>netcoreapp1.1</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\Avalonia.DotNetCoreRuntime\Avalonia.DotNetCoreRuntime.csproj" /> |
|||
<ProjectReference Include="..\ControlCatalog\ControlCatalog.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using Avalonia; |
|||
|
|||
namespace ControlCatalog.NetCore |
|||
{ |
|||
class Program |
|||
{ |
|||
static void Main(string[] args) |
|||
{ |
|||
AppBuilder.Configure<App>() |
|||
.UsePlatformDetect() |
|||
.Start<MainWindow>(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,4 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net46" /> |
|||
</packages> |
|||
@ -1,11 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net45" /> |
|||
<package id="Splat" version="1.6.2" targetFramework="net45" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Windows.Threading" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1,7 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="net452" /> |
|||
<package id="Splat" version="1.6.2" targetFramework="net452" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net452" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net452" /> |
|||
</packages> |
|||
@ -1,19 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Collections" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Collections.Concurrent" version="4.0.12" targetFramework="monoandroid44" /> |
|||
<package id="System.ComponentModel" version="4.0.1" targetFramework="monoandroid44" /> |
|||
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Diagnostics.Tools" version="4.0.1" targetFramework="monoandroid44" /> |
|||
<package id="System.Globalization" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Linq" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reflection" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Resources.ResourceManager" version="4.0.1" targetFramework="monoandroid44" /> |
|||
<package id="System.Runtime" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Runtime.Extensions" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Threading" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Threading.Tasks" version="4.0.11" targetFramework="monoandroid44" /> |
|||
</packages> |
|||
@ -1,25 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="monoandroid44" /> |
|||
<package id="Splat" version="1.6.2" targetFramework="monoandroid51" /> |
|||
<package id="Sprache" version="2.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Collections" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Collections.Concurrent" version="4.0.12" targetFramework="monoandroid44" /> |
|||
<package id="System.ComponentModel" version="4.0.1" targetFramework="monoandroid44" /> |
|||
<package id="System.Diagnostics.Debug" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Diagnostics.Tools" version="4.0.1" targetFramework="monoandroid44" /> |
|||
<package id="System.Globalization" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Linq" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Reflection" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Resources.ResourceManager" version="4.0.1" targetFramework="monoandroid44" /> |
|||
<package id="System.Runtime" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Runtime.Extensions" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Text.RegularExpressions" version="4.1.0" targetFramework="monoandroid44" /> |
|||
<package id="System.Threading" version="4.0.11" targetFramework="monoandroid44" /> |
|||
<package id="System.Threading.Tasks" version="4.0.11" targetFramework="monoandroid44" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,9 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="JetBrains.Annotations" version="10.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,9 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="JetBrains.Annotations" version="10.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,9 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -0,0 +1,6 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System.Reflection; |
|||
|
|||
[assembly: AssemblyTitle("Avalonia.DotNetCoreRuntime")] |
|||
@ -1,11 +0,0 @@ |
|||
{ |
|||
"supports": {}, |
|||
"dependencies": { |
|||
"Microsoft.NETCore.Portable.Compatibility": "1.0.1", |
|||
"NETStandard.Library": "1.6.0", |
|||
"System.Threading.ThreadPool": "4.3.0" |
|||
}, |
|||
"frameworks": { |
|||
"netstandard1.5": {} |
|||
} |
|||
} |
|||
@ -1,5 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace System.Net |
|||
{ |
|||
internal class AsyncCompletedEventArgs |
|||
{ |
|||
public object UserState { get; set; } |
|||
public Exception Error { get; set; } |
|||
public bool Cancelled { get; set; } |
|||
|
|||
public AsyncCompletedEventArgs(Exception error, bool cancelled, object userState) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
|
|||
class WebException : Exception |
|||
{ |
|||
public object Response { get; set; } |
|||
} |
|||
|
|||
class HttpWebResponse |
|||
{ |
|||
public HttpStatusCode StatusCode { get; set; } |
|||
} |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="portable45-net45+win8" /> |
|||
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,4 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Serilog" version="1.5.14" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -0,0 +1,34 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace System.Runtime.Serialization |
|||
{ |
|||
class IgnoreDataMemberAttribute : Attribute |
|||
{ |
|||
} |
|||
|
|||
class DataMemberAttribute : Attribute |
|||
{ |
|||
} |
|||
class OnDeserializedAttribute : Attribute |
|||
{ |
|||
} |
|||
|
|||
class DataContractAttribute : Attribute |
|||
{ |
|||
} |
|||
|
|||
class StreamingContext { } |
|||
} |
|||
|
|||
namespace System.Diagnostics.Contracts |
|||
{ |
|||
static class Contract |
|||
{ |
|||
public static void Requires(bool condition) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -1,9 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Splat" version="1.6.2" targetFramework="portable45-net45+win8+wp8+wpa81" userInstalled="true" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8+wp8+wpa81" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
File diff suppressed because it is too large
@ -0,0 +1,16 @@ |
|||
using System; |
|||
|
|||
namespace Avalonia.Media |
|||
{ |
|||
/// <summary>
|
|||
/// Represents a mutable brush which can return an immutable clone of itself.
|
|||
/// </summary>
|
|||
public interface IMutableBrush : IBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Creates an immutable clone of the brush.
|
|||
/// </summary>
|
|||
/// <returns>The immutable clone.</returns>
|
|||
IBrush ToImmutable(); |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// A brush that draws with a gradient.
|
|||
/// </summary>
|
|||
public abstract class ImmutableGradientBrush : IGradientBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableGradientBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="gradientStops">The gradient stops.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
/// <param name="spreadMethod">The spread method.</param>
|
|||
protected ImmutableGradientBrush( |
|||
IReadOnlyList<GradientStop> gradientStops, |
|||
double opacity, |
|||
GradientSpreadMethod spreadMethod) |
|||
{ |
|||
GradientStops = gradientStops; |
|||
Opacity = opacity; |
|||
SpreadMethod = spreadMethod; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableGradientBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
protected ImmutableGradientBrush(IGradientBrush source) |
|||
: this(source.GradientStops.ToList(), source.Opacity, source.SpreadMethod) |
|||
{ |
|||
|
|||
} |
|||
|
|||
/// <inheritdoc/>
|
|||
public IReadOnlyList<GradientStop> GradientStops { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public double Opacity { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public GradientSpreadMethod SpreadMethod { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using System; |
|||
using Avalonia.Media.Imaging; |
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// Paints an area with an <see cref="IBitmap"/>.
|
|||
/// </summary>
|
|||
internal class ImmutableImageBrush : ImmutableTileBrush, IImageBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableImageBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The image to draw.</param>
|
|||
/// <param name="alignmentX">The horizontal alignment of a tile in the destination.</param>
|
|||
/// <param name="alignmentY">The vertical alignment of a tile in the destination.</param>
|
|||
/// <param name="destinationRect">The rectangle on the destination in which to paint a tile.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
/// <param name="sourceRect">The rectangle of the source image that will be displayed.</param>
|
|||
/// <param name="stretch">
|
|||
/// How the source rectangle will be stretched to fill the destination rect.
|
|||
/// </param>
|
|||
/// <param name="tileMode">The tile mode.</param>
|
|||
public ImmutableImageBrush( |
|||
IBitmap source, |
|||
AlignmentX alignmentX = AlignmentX.Center, |
|||
AlignmentY alignmentY = AlignmentY.Center, |
|||
RelativeRect? destinationRect = null, |
|||
double opacity = 1, |
|||
RelativeRect? sourceRect = null, |
|||
Stretch stretch = Stretch.Uniform, |
|||
TileMode tileMode = TileMode.None) |
|||
: base( |
|||
alignmentX, |
|||
alignmentY, |
|||
destinationRect ?? RelativeRect.Fill, |
|||
opacity, |
|||
sourceRect ?? RelativeRect.Fill, |
|||
stretch, |
|||
tileMode) |
|||
{ |
|||
Source = source; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableImageBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
public ImmutableImageBrush(IImageBrush source) |
|||
: base(source) |
|||
{ |
|||
Source = source.Source; |
|||
} |
|||
|
|||
/// <inheritdoc/>
|
|||
public IBitmap Source { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// A brush that draws with a linear gradient.
|
|||
/// </summary>
|
|||
public class ImmutableLinearGradientBrush : ImmutableGradientBrush, ILinearGradientBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableLinearGradientBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="gradientStops">The gradient stops.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
/// <param name="spreadMethod">The spread method.</param>
|
|||
/// <param name="startPoint">The start point for the gradient.</param>
|
|||
/// <param name="endPoint">The end point for the gradient.</param>
|
|||
public ImmutableLinearGradientBrush( |
|||
IReadOnlyList<GradientStop> gradientStops, |
|||
double opacity = 1, |
|||
GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad, |
|||
RelativePoint? startPoint = null, |
|||
RelativePoint? endPoint = null) |
|||
: base(gradientStops, opacity, spreadMethod) |
|||
{ |
|||
StartPoint = startPoint ?? RelativePoint.TopLeft; |
|||
EndPoint = endPoint ?? RelativePoint.BottomRight; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableLinearGradientBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
public ImmutableLinearGradientBrush(ILinearGradientBrush source) |
|||
: base(source) |
|||
{ |
|||
StartPoint = source.StartPoint; |
|||
EndPoint = source.EndPoint; |
|||
} |
|||
|
|||
/// <inheritdoc/>
|
|||
public RelativePoint StartPoint { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public RelativePoint EndPoint { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// A brush that draws with a radial gradient.
|
|||
/// </summary>
|
|||
public class ImmutableRadialGradientBrush : ImmutableGradientBrush, IRadialGradientBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableRadialGradientBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="gradientStops">The gradient stops.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
/// <param name="spreadMethod">The spread method.</param>
|
|||
/// <param name="center">The start point for the gradient.</param>
|
|||
/// <param name="gradientOrigin">
|
|||
/// The location of the two-dimensional focal point that defines the beginning of the gradient.
|
|||
/// </param>
|
|||
/// <param name="radius">
|
|||
/// The horizontal and vertical radius of the outermost circle of the radial gradient.
|
|||
/// </param>
|
|||
public ImmutableRadialGradientBrush( |
|||
IReadOnlyList<GradientStop> gradientStops, |
|||
double opacity = 1, |
|||
GradientSpreadMethod spreadMethod = GradientSpreadMethod.Pad, |
|||
RelativePoint? center = null, |
|||
RelativePoint? gradientOrigin = null, |
|||
double radius = 0.5) |
|||
: base(gradientStops, opacity, spreadMethod) |
|||
{ |
|||
Center = center ?? RelativePoint.Center; |
|||
GradientOrigin = gradientOrigin ?? RelativePoint.Center; |
|||
Radius = radius; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableRadialGradientBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
public ImmutableRadialGradientBrush(IRadialGradientBrush source) |
|||
: base(source) |
|||
{ |
|||
Center = source.Center; |
|||
GradientOrigin = source.GradientOrigin; |
|||
Radius = source.Radius; |
|||
} |
|||
|
|||
/// <inheritdoc/>
|
|||
public RelativePoint Center { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public RelativePoint GradientOrigin { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public double Radius { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,59 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// Fills an area with a solid color.
|
|||
/// </summary>
|
|||
public struct ImmutableSolidColorBrush : ISolidColorBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableSolidColorBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="color">The color to use.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
public ImmutableSolidColorBrush(Color color, double opacity = 1) |
|||
{ |
|||
Color = color; |
|||
Opacity = opacity; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableSolidColorBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="color">The color to use.</param>
|
|||
public ImmutableSolidColorBrush(uint color) |
|||
: this(Color.FromUInt32(color)) |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableSolidColorBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
public ImmutableSolidColorBrush(ISolidColorBrush source) |
|||
: this(source.Color, source.Opacity) |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets the color of the brush.
|
|||
/// </summary>
|
|||
public Color Color { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets the opacity of the brush.
|
|||
/// </summary>
|
|||
public double Opacity { get; } |
|||
|
|||
/// <summary>
|
|||
/// Returns a string representation of the brush.
|
|||
/// </summary>
|
|||
/// <returns>A string representation of the brush.</returns>
|
|||
public override string ToString() |
|||
{ |
|||
return Color.ToString(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,77 @@ |
|||
using System; |
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// A brush which displays a repeating image.
|
|||
/// </summary>
|
|||
public abstract class ImmutableTileBrush : ITileBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImageBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="alignmentX">The horizontal alignment of a tile in the destination.</param>
|
|||
/// <param name="alignmentY">The vertical alignment of a tile in the destination.</param>
|
|||
/// <param name="destinationRect">The rectangle on the destination in which to paint a tile.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
/// <param name="sourceRect">The rectangle of the source image that will be displayed.</param>
|
|||
/// <param name="stretch">
|
|||
/// How the source rectangle will be stretched to fill the destination rect.
|
|||
/// </param>
|
|||
/// <param name="tileMode">The tile mode.</param>
|
|||
protected ImmutableTileBrush( |
|||
AlignmentX alignmentX, |
|||
AlignmentY alignmentY, |
|||
RelativeRect destinationRect, |
|||
double opacity, |
|||
RelativeRect sourceRect, |
|||
Stretch stretch, |
|||
TileMode tileMode) |
|||
{ |
|||
AlignmentX = alignmentX; |
|||
AlignmentY = alignmentY; |
|||
DestinationRect = destinationRect; |
|||
Opacity = opacity; |
|||
SourceRect = sourceRect; |
|||
Stretch = stretch; |
|||
TileMode = tileMode; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImageBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
protected ImmutableTileBrush(ITileBrush source) |
|||
: this( |
|||
source.AlignmentX, |
|||
source.AlignmentY, |
|||
source.DestinationRect, |
|||
source.Opacity, |
|||
source.SourceRect, |
|||
source.Stretch, |
|||
source.TileMode) |
|||
{ |
|||
} |
|||
|
|||
/// <inheritdoc/>
|
|||
public AlignmentX AlignmentX { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public AlignmentY AlignmentY { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public RelativeRect DestinationRect { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public double Opacity { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public RelativeRect SourceRect { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public Stretch Stretch { get; } |
|||
|
|||
/// <inheritdoc/>
|
|||
public TileMode TileMode { get; } |
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using System; |
|||
using Avalonia.VisualTree; |
|||
|
|||
namespace Avalonia.Media.Immutable |
|||
{ |
|||
/// <summary>
|
|||
/// Paints an area with an <see cref="IVisual"/>.
|
|||
/// </summary>
|
|||
internal class ImmutableVisualBrush : ImmutableTileBrush, IVisualBrush |
|||
{ |
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableImageBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="visual">The visual to draw.</param>
|
|||
/// <param name="alignmentX">The horizontal alignment of a tile in the destination.</param>
|
|||
/// <param name="alignmentY">The vertical alignment of a tile in the destination.</param>
|
|||
/// <param name="destinationRect">The rectangle on the destination in which to paint a tile.</param>
|
|||
/// <param name="opacity">The opacity of the brush.</param>
|
|||
/// <param name="sourceRect">The rectangle of the source image that will be displayed.</param>
|
|||
/// <param name="stretch">
|
|||
/// How the source rectangle will be stretched to fill the destination rect.
|
|||
/// </param>
|
|||
/// <param name="tileMode">The tile mode.</param>
|
|||
public ImmutableVisualBrush( |
|||
IVisual visual, |
|||
AlignmentX alignmentX = AlignmentX.Center, |
|||
AlignmentY alignmentY = AlignmentY.Center, |
|||
RelativeRect? destinationRect = null, |
|||
double opacity = 1, |
|||
RelativeRect? sourceRect = null, |
|||
Stretch stretch = Stretch.Uniform, |
|||
TileMode tileMode = TileMode.None) |
|||
: base( |
|||
alignmentX, |
|||
alignmentY, |
|||
destinationRect ?? RelativeRect.Fill, |
|||
opacity, |
|||
sourceRect ?? RelativeRect.Fill, |
|||
stretch, |
|||
tileMode) |
|||
{ |
|||
Visual = visual; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="ImmutableVisualBrush"/> class.
|
|||
/// </summary>
|
|||
/// <param name="source">The brush from which this brush's properties should be copied.</param>
|
|||
public ImmutableVisualBrush(IVisualBrush source) |
|||
: base(source) |
|||
{ |
|||
Visual = source.Visual; |
|||
} |
|||
|
|||
/// <inheritdoc/>
|
|||
public IVisual Visual { get; } |
|||
} |
|||
} |
|||
@ -1,35 +0,0 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
namespace Avalonia.Media.Mutable |
|||
{ |
|||
/// <summary>
|
|||
/// Fills an area with a solid color.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This is a mutable version of the normal immutable <see cref="Avalonia.Media.SolidColorBrush"/>
|
|||
/// for use in XAML. XAML really needs support for immutable data...
|
|||
/// </remarks>
|
|||
public class SolidColorBrush : Brush, ISolidColorBrush |
|||
{ |
|||
public static readonly DirectProperty<SolidColorBrush, Color> ColorProperty = |
|||
AvaloniaProperty.RegisterDirect<SolidColorBrush, Color>( |
|||
"Color", |
|||
o => o.Color, |
|||
(o, v) => o.Color = v); |
|||
|
|||
/// <summary>
|
|||
/// Gets the color of the brush.
|
|||
/// </summary>
|
|||
public Color Color { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// Returns a string representation of the brush.
|
|||
/// </summary>
|
|||
/// <returns>A string representation of the brush.</returns>
|
|||
public override string ToString() |
|||
{ |
|||
return Color.ToString(); |
|||
} |
|||
} |
|||
} |
|||
@ -1,8 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,5 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1,5 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="net45" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="net45" /> |
|||
</packages> |
|||
@ -1 +0,0 @@ |
|||
project.lock.json |
|||
@ -1,10 +0,0 @@ |
|||
{ |
|||
"supports": {}, |
|||
"dependencies": { |
|||
"Microsoft.NETCore.Portable.Compatibility": "1.0.1", |
|||
"NETStandard.Library": "1.6.0" |
|||
}, |
|||
"frameworks": { |
|||
"netstandard1.1": {} |
|||
} |
|||
} |
|||
@ -1,13 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="Sprache" version="2.1.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Globalization" version="4.0.11" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Linq" version="4.1.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Runtime" version="4.1.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Text.RegularExpressions" version="4.1.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
@ -1,9 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="System.ComponentModel.Annotations" version="4.1.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Core" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Interfaces" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.Linq" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
<package id="System.Reactive.PlatformServices" version="3.0.0" targetFramework="portable45-net45+win8" /> |
|||
</packages> |
|||
Binary file not shown.
@ -0,0 +1,67 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- |
|||
This file is for a workaround for this NuGet issue https://github.com/NuGet/Home/issues/4532 |
|||
It is built from the master branch of NuGet.BuildTasks with a different class name as not to conflict with the original. |
|||
It can most likely be removed when the next version of NuGet.BuildTasks is released: https://github.com/NuGet/NuGet.BuildTasks/pull/29 |
|||
--> |
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
|||
<UsingTask TaskName="Microsoft.NuGet.Build.Tasks.ResolveNuGetPackageAssetsPatched" AssemblyFile="Microsoft.NuGet.Build.Tasks.Patched.dll" /> |
|||
|
|||
<Target Name="ResolveNuGetPackageAssets" |
|||
DependsOnTargets="$(ResolveNuGetPackageAssetsDependsOn)" |
|||
Condition="'$(ResolveNuGetPackages)' == 'true' and exists('$(ProjectLockFile)')"> |
|||
|
|||
<ResolveNuGetPackageAssetsPatched AllowFallbackOnTargetSelection="$(DesignTimeBuild)" |
|||
ContinueOnError="$(ContinueOnError)" |
|||
IncludeFrameworkReferences="$(IncludeFrameworkReferencesFromNuGet)" |
|||
NuGetPackagesDirectory="$(NuGetPackagesDirectory)" |
|||
RuntimeIdentifier="$(NuGetRuntimeIdentifier)" |
|||
ProjectLanguage="$(Language)" |
|||
ProjectLockFile="$(ProjectLockFile)" |
|||
ContentPreprocessorValues="@(NuGetPreprocessorValue)" |
|||
ContentPreprocessorOutputDirectory="$(IntermediateOutputPath)\NuGet" |
|||
TargetMonikers="$(NuGetTargetMoniker);$(_NuGetTargetFallbackMoniker)"> |
|||
|
|||
<Output TaskParameter="ResolvedAnalyzers" ItemName="Analyzer" /> |
|||
<Output TaskParameter="ResolvedCopyLocalItems" ItemName="ReferenceCopyLocalPaths" /> |
|||
<Output TaskParameter="ResolvedReferences" ItemName="_ReferencesFromNuGetPackages" /> |
|||
<Output TaskParameter="ReferencedPackages" ItemName="ReferencedNuGetPackages" /> |
|||
<Output TaskParameter="ContentItems" ItemName="_NuGetContentItems" /> |
|||
<Output TaskParameter="FileWrites" ItemName="FileWrites" /> |
|||
</ResolveNuGetPackageAssetsPatched> |
|||
|
|||
<ItemGroup> |
|||
<!-- Remove exact references, such as if a package had a framework reference to 'System' that we already have --> |
|||
<Reference Remove="@(_ReferencesFromNuGetPackages)" /> |
|||
|
|||
<!-- Remove simple name references that are already implicitly added --> |
|||
<_ReferencesFromNuGetPackages Remove="%(ReferencePath.FileName)" Condition="'%(ReferencePath.ResolvedFrom)' == 'ImplicitlyExpandTargetFramework'" /> |
|||
|
|||
<!-- Include NuGet references in the proper groups. Project-to-project references must go in the |
|||
_ResolvedProjectReferencePaths group which matches the behavior of the ResolveProjectReferences |
|||
target. This ensures that even if the assembly is missing on disk, it still makes it to the compiler. --> |
|||
<Reference Include="@(_ReferencesFromNuGetPackages)" Condition="'%(_ReferencesFromNuGetPackages.NuGetSourceType)' != 'Project'" /> |
|||
<_ResolvedProjectReferencePaths Include="@(_ReferencesFromNuGetPackages)" Condition="'%(_ReferencesFromNuGetPackages.NuGetSourceType)' == 'Project'" /> |
|||
|
|||
<Reference Include="@(_ReferencesFromNuGetPackages)" /> |
|||
<!-- Remove simple name references if we're directly providing a reference assembly to the compiler. For example, |
|||
consider a project with an Reference Include="System", and some NuGet package is providing System.dll --> |
|||
<Reference Remove="%(_ReferencesFromNuGetPackages.FileName)" Condition="'%(_ReferencesFromNuGetPackages.NuGetIsFrameworkReference)' == 'false'"/> |
|||
</ItemGroup> |
|||
|
|||
<PropertyGroup Condition=" '$(AutoUnifyAssemblyReferences)' == 'true' "> |
|||
<!-- Normally Design Time Assembly Resolution (DTAR) won't consider these references. |
|||
Put DTAR in a mode where it will prefer the output of RAR and unify. --> |
|||
<DTARUseReferencesFromProject>true</DTARUseReferencesFromProject> |
|||
</PropertyGroup> |
|||
|
|||
<!-- The items in _NuGetContentItems need to go into the appropriately-named item group, but the names depend upon the items |
|||
themselves. Split it apart. --> |
|||
<CreateItem Include="@(_NuGetContentItems)" Condition="'@(_NuGetContentItems)' != ''"> |
|||
<Output TaskParameter="Include" ItemName="%(_NuGetContentItems.NuGetItemType)" /> |
|||
</CreateItem> |
|||
</Target> |
|||
<PropertyGroup Condition="'$(UseRoslynPathHack)' == 'true'"> |
|||
<CscToolPath>$(MSBuildToolsPath)\..\Roslyn</CscToolPath> |
|||
</PropertyGroup> |
|||
</Project> |
|||
@ -1,4 +0,0 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<packages> |
|||
<package id="SkiaSharp" version="1.56.1-beta" targetFramework="monoandroid44" /> |
|||
</packages> |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue