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
{
using System;
public abstract class BrushImpl : IDisposable
{
public SharpDX.Direct2D1.Brush PlatformBrush { get; set; }
public BrushImpl(Perspex.Media.Brush brush, SharpDX.Direct2D1.RenderTarget target, Size destinationSize)
{
}
public virtual void Dispose()
{
if (this.PlatformBrush != null)
{
this.PlatformBrush.Dispose();
}
}
}
}

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

@ -267,7 +267,7 @@ namespace Perspex.Direct2D1.Media
if (solidColorBrush != null)
{
return new SolidColorBrushImpl(solidColorBrush, this.renderTarget, destinationSize);
return new SolidColorBrushImpl(solidColorBrush, this.renderTarget);
}
else if (linearGradientBrush != null)
{
@ -275,7 +275,7 @@ namespace Perspex.Direct2D1.Media
}
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 LinearGradientBrushImpl(Perspex.Media.LinearGradientBrush brush, SharpDX.Direct2D1.RenderTarget target, Size destinationSize)
: base(brush, target, destinationSize)
public LinearGradientBrushImpl(
Perspex.Media.LinearGradientBrush brush,
SharpDX.Direct2D1.RenderTarget target,
Size destinationSize)
{
if (brush != null)
{

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

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

Loading…
Cancel
Save