Browse Source

Removed redundant params.

And added file headers etc.
pull/103/head
Steven Kirk 11 years ago
parent
commit
7bee5a79ec
  1. 14
      src/Windows/Perspex.Direct2D1/Media/BrushImpl.cs
  2. 4
      src/Windows/Perspex.Direct2D1/Media/DrawingContext.cs
  3. 6
      src/Windows/Perspex.Direct2D1/Media/LinearGradientBrushImpl.cs
  4. 17
      src/Windows/Perspex.Direct2D1/Media/SolidColorBrushImpl.cs

14
src/Windows/Perspex.Direct2D1/Media/BrushImpl.cs

@ -1,19 +1,23 @@
using System; // -----------------------------------------------------------------------
// <copyright file="BrushImpl.cs" company="Steven Kirk">
// Copyright 2015 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Direct2D1.Media namespace Perspex.Direct2D1.Media
{ {
using System;
public abstract class BrushImpl : IDisposable public abstract class BrushImpl : IDisposable
{ {
public SharpDX.Direct2D1.Brush PlatformBrush { get; set; } public SharpDX.Direct2D1.Brush PlatformBrush { get; set; }
public BrushImpl(Perspex.Media.Brush brush, SharpDX.Direct2D1.RenderTarget target, Size destinationSize)
{
}
public virtual void Dispose() public virtual void Dispose()
{ {
if (this.PlatformBrush != null) if (this.PlatformBrush != null)
{
this.PlatformBrush.Dispose(); this.PlatformBrush.Dispose();
}
} }
} }
} }

4
src/Windows/Perspex.Direct2D1/Media/DrawingContext.cs

@ -267,7 +267,7 @@ namespace Perspex.Direct2D1.Media
if (solidColorBrush != null) if (solidColorBrush != null)
{ {
return new SolidColorBrushImpl(solidColorBrush, this.renderTarget, destinationSize); return new SolidColorBrushImpl(solidColorBrush, this.renderTarget);
} }
else if (linearGradientBrush != null) else if (linearGradientBrush != null)
{ {
@ -275,7 +275,7 @@ namespace Perspex.Direct2D1.Media
} }
else else
{ {
return new SolidColorBrushImpl(null, this.renderTarget, destinationSize); return new SolidColorBrushImpl(null, this.renderTarget);
} }
} }
} }

6
src/Windows/Perspex.Direct2D1/Media/LinearGradientBrushImpl.cs

@ -8,8 +8,10 @@
public class LinearGradientBrushImpl : BrushImpl public class LinearGradientBrushImpl : BrushImpl
{ {
public LinearGradientBrushImpl(Perspex.Media.LinearGradientBrush brush, SharpDX.Direct2D1.RenderTarget target, Size destinationSize) public LinearGradientBrushImpl(
: base(brush, target, destinationSize) Perspex.Media.LinearGradientBrush brush,
SharpDX.Direct2D1.RenderTarget target,
Size destinationSize)
{ {
if (brush != null) if (brush != null)
{ {

17
src/Windows/Perspex.Direct2D1/Media/SolidColorBrushImpl.cs

@ -1,15 +1,14 @@
namespace Perspex.Direct2D1.Media // -----------------------------------------------------------------------
{ // <copyright file="SolidColorBrushImpl.cs" company="Steven Kirk">
using System; // Copyright 2015 MIT Licence. See licence.md for more information.
using System.Collections.Generic; // </copyright>
using System.Linq; // -----------------------------------------------------------------------
using System.Text;
using System.Threading.Tasks;
namespace Perspex.Direct2D1.Media
{
public class SolidColorBrushImpl : BrushImpl public class SolidColorBrushImpl : BrushImpl
{ {
public SolidColorBrushImpl(Perspex.Media.SolidColorBrush brush, SharpDX.Direct2D1.RenderTarget target, Size destinationSize) public SolidColorBrushImpl(Perspex.Media.SolidColorBrush brush, SharpDX.Direct2D1.RenderTarget target)
: base(brush, target, destinationSize)
{ {
this.PlatformBrush = new SharpDX.Direct2D1.SolidColorBrush(target, brush?.Color.ToDirect2D() ?? new SharpDX.Color4()); this.PlatformBrush = new SharpDX.Direct2D1.SolidColorBrush(target, brush?.Color.ToDirect2D() ?? new SharpDX.Color4());
} }

Loading…
Cancel
Save