Browse Source

More stylecop fixes.

pull/10/head
Steven Kirk 12 years ago
parent
commit
32587825b3
  1. 5
      Cairo/Perspex.Cairo/CairoExtensions.cs
  2. 14
      Cairo/Perspex.Cairo/CairoPlatform.cs
  3. 3
      Cairo/Perspex.Cairo/Media/DrawingContext.cs
  4. 1
      Cairo/Perspex.Cairo/Media/Imaging/BitmapImpl.cs
  5. 2
      Cairo/Perspex.Cairo/Media/StreamGeometryContextImpl.cs
  6. 2
      Cairo/Perspex.Cairo/Media/StreamGeometryImpl.cs
  7. 8
      Cairo/Perspex.Cairo/Perspex.Cairo.csproj
  8. 2
      Cairo/Perspex.Cairo/Renderer.cs
  9. 1
      Cairo/Perspex.Cairo/packages.config
  10. 2
      Gtk/Perspex.Gtk/GtkExtensions.cs
  11. 77
      Gtk/Perspex.Gtk/GtkPlatform.cs
  12. 3
      Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs
  13. 3
      Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs
  14. 12
      Gtk/Perspex.Gtk/Perspex.Gtk.csproj
  15. 35
      Gtk/Perspex.Gtk/Properties/AssemblyInfo.cs
  16. 12
      Gtk/Perspex.Gtk/WindowImpl.cs
  17. 1
      Gtk/Perspex.Gtk/packages.config
  18. 4
      Perspex.Controls/Primitives/HeaderedContentControl.cs
  19. 2
      Perspex.Diagnostics/Debug.cs
  20. 4
      Perspex.Diagnostics/LogManager.cs
  21. 8
      Perspex.Diagnostics/Perspex.Diagnostics.csproj
  22. 10
      Perspex.Diagnostics/Properties/AssemblyInfo.cs
  23. 2
      Perspex.Diagnostics/ViewModels/VisualTreeNode.cs
  24. 1
      Perspex.Diagnostics/packages.config
  25. 16
      Windows/Perspex.Direct2D1/Direct2D1Platform.cs
  26. 4
      Windows/Perspex.Direct2D1/Media/DrawingContext.cs
  27. 2
      Windows/Perspex.Direct2D1/Media/Imaging/BitmapImpl.cs
  28. 2
      Windows/Perspex.Direct2D1/Media/StreamGeometryContextImpl.cs
  29. 8
      Windows/Perspex.Direct2D1/Media/StreamGeometryImpl.cs
  30. 4
      Windows/Perspex.Direct2D1/Perspex.Direct2D1.csproj
  31. 8
      Windows/Perspex.Direct2D1/TextService.cs
  32. 1
      Windows/Perspex.Direct2D1/packages.config

5
Cairo/Perspex.Cairo/CairoExtensions.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="CairoPlatform.cs" company="Steven Kirk">
// <copyright file="CairoExtensions.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
@ -25,5 +25,4 @@ namespace Perspex.Cairo
return new Cairo.Rectangle(rect.X, rect.Y, rect.Width, rect.Height);
}
}
}
}

14
Cairo/Perspex.Cairo/CairoPlatform.cs

@ -20,6 +20,11 @@ namespace Perspex.Cairo
private static TextService textService = new TextService();
public ITextService TextService
{
get { return textService; }
}
public static void Initialize()
{
var locator = Locator.CurrentMutable;
@ -27,22 +32,17 @@ namespace Perspex.Cairo
locator.Register(() => textService, typeof(ITextService));
}
public ITextService TextService
{
get { return textService; }
}
public IBitmapImpl CreateBitmap(int width, int height)
{
throw new NotImplementedException();
//return new BitmapImpl(imagingFactory, width, height);
////return new BitmapImpl(imagingFactory, width, height);
}
public IRenderer CreateRenderer(IPlatformHandle handle, double width, double height)
{
if (textService.Context == null)
{
textService.Context = GetPangoContext(handle);
textService.Context = this.GetPangoContext(handle);
}
return new Renderer(handle, width, height);

3
Cairo/Perspex.Cairo/Media/DrawingContext.cs

@ -3,12 +3,11 @@
// Copyright 2013 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
using Perspex.Cairo.Media.Imaging;
namespace Perspex.Cairo.Media
{
using System;
using System.Reactive.Disposables;
using Perspex.Cairo.Media.Imaging;
using Perspex.Media;
using Perspex.Platform;
using Splat;

1
Cairo/Perspex.Cairo/Media/Imaging/BitmapImpl.cs

@ -12,7 +12,6 @@ namespace Perspex.Cairo.Media.Imaging
public class BitmapImpl : IBitmapImpl
{
public BitmapImpl(Cairo.ImageSurface surface)
{
this.Surface = surface;

2
Cairo/Perspex.Cairo/Media/StreamGeometryContextImpl.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="Direct2D1StreamGeometryContext.cs" company="Steven Kirk">
// <copyright file="StreamGeometryContextImpl.cs" company="Steven Kirk">
// Copyright 2013 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

2
Cairo/Perspex.Cairo/Media/StreamGeometryImpl.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="Direct2DStreamGeometry.cs" company="Steven Kirk">
// <copyright file="StreamGeometryImpl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

8
Cairo/Perspex.Cairo/Perspex.Cairo.csproj

@ -11,6 +11,7 @@
<AssemblyName>Perspex.Cairo</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>b122e795</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -88,6 +89,13 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

2
Cairo/Perspex.Cairo/Renderer.cs

@ -52,7 +52,7 @@ namespace Perspex.Cairo
}
[DllImport("user32.dll")]
private static extern IntPtr GetDC(IntPtr hWnd);
private static extern IntPtr GetDC(IntPtr hwnd);
/// <summary>
/// Creates a cairo surface that targets a platform-specific resource.

1
Cairo/Perspex.Cairo/packages.config

@ -3,4 +3,5 @@
<package id="Rx-Core" version="2.2.5" targetFramework="net45" />
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net45" />
<package id="Splat" version="1.5.1" targetFramework="net45" />
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="net45" developmentDependency="true" />
</packages>

2
Gtk/Perspex.Gtk/GtkExtensions.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="Window.cs" company="Steven Kirk">
// <copyright file="GtkExtensions.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

77
Gtk/Perspex.Gtk/GtkPlatform.cs

@ -1,55 +1,56 @@
// -----------------------------------------------------------------------
// <copyright file="IDescription.cs" company="Steven Kirk">
// <copyright file="GtkPlatform.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Gtk
{
using System;
using System.Reactive.Disposables;
using System;
using System.Reactive.Disposables;
using Perspex.Input;
using Perspex.Platform;
using Splat;
using Gtk = global::Gtk;
public class GtkPlatform : IPlatformThreadingInterface
{
private static GtkPlatform instance = new GtkPlatform ();
public GtkPlatform ()
{
Gtk.Application.Init();
}
public static void Initialize()
{
var locator = Locator.CurrentMutable;
using Perspex.Platform;
using Splat;
using Gtk = global::Gtk;
public class GtkPlatform : IPlatformThreadingInterface
{
private static GtkPlatform instance = new GtkPlatform();
public GtkPlatform()
{
Gtk.Application.Init();
}
public static void Initialize()
{
var locator = Locator.CurrentMutable;
locator.Register(() => new WindowImpl(), typeof(IWindowImpl));
locator.Register(() => GtkKeyboardDevice.Instance, typeof(IKeyboardDevice));
locator.Register(() => instance, typeof(IPlatformThreadingInterface));
}
}
public void ProcessMessage ()
{
Gtk.Application.RunIteration();
}
public void ProcessMessage()
{
Gtk.Application.RunIteration();
}
public IDisposable StartTimer (TimeSpan interval, Action tick)
{
public IDisposable StartTimer(TimeSpan interval, Action tick)
{
var result = true;
var handle = GLib.Timeout.Add((uint)interval.TotalMilliseconds, () =>
{
tick();
return result;
});
var handle = GLib.Timeout.Add(
(uint)interval.TotalMilliseconds,
() =>
{
tick();
return result;
});
return Disposable.Create(() => result = false);
}
public void Wake ()
{
}
}
}
}
public void Wake()
{
}
}
}

3
Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs

@ -55,5 +55,4 @@ namespace Perspex.Gtk
}
}
}
}
}

3
Gtk/Perspex.Gtk/Input/GtkMouseDevice.cs

@ -37,5 +37,4 @@ namespace Perspex.Gtk
return this.clientPosition;
}
}
}
}

12
Gtk/Perspex.Gtk/Perspex.Gtk.csproj

@ -8,6 +8,7 @@
<RootNamespace>Perspex.Gtk</RootNamespace>
<AssemblyName>Perspex.Gtk</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>ad245ae8</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -96,7 +97,12 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Input\" />
</ItemGroup>
<ItemGroup />
<Import Project="..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
</Target>
</Project>

35
Gtk/Perspex.Gtk/Properties/AssemblyInfo.cs

@ -1,27 +1,24 @@
using System.Reflection;
// -----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("Perspex.Gtk")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("steven")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
[assembly: AssemblyTitle("Perspex.Gtk")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("steven")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
[assembly: AssemblyVersion("1.0.*")]

12
Gtk/Perspex.Gtk/WindowImpl.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="Window.cs" company="Steven Kirk">
// <copyright file="WindowImpl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
@ -13,16 +13,16 @@ namespace Perspex.Gtk
using Gtk = global::Gtk;
public class WindowImpl : Gtk.Window, IWindowImpl
{
{
private Window owner;
private IPlatformHandle windowHandle;
private Size clientSize;
public WindowImpl()
public WindowImpl()
: base(Gtk.WindowType.Toplevel)
{
{
this.DefaultSize = new Gdk.Size(640, 480);
this.Events = Gdk.EventMask.PointerMotionMask |
Gdk.EventMask.ButtonPressMask |
@ -94,7 +94,7 @@ namespace Perspex.Gtk
if (newSize != this.clientSize)
{
this.clientSize = newSize;
this.Resized(clientSize);
this.Resized(this.clientSize);
}
return true;
@ -118,7 +118,7 @@ namespace Perspex.Gtk
protected override bool OnExposeEvent(Gdk.EventExpose evnt)
{
this.Paint(evnt.Area.ToPerspex(), GetHandle(evnt.Window));
this.Paint(evnt.Area.ToPerspex(), this.GetHandle(evnt.Window));
return true;
}

1
Gtk/Perspex.Gtk/packages.config

@ -4,4 +4,5 @@
<package id="Rx-Interfaces" version="2.2.5" targetFramework="net45" />
<package id="Rx-Linq" version="2.2.5" targetFramework="net45" />
<package id="Splat" version="1.5.1" targetFramework="net45" />
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="net45" developmentDependency="true" />
</packages>

4
Perspex.Controls/Primitives/HeaderedContentControl.cs

@ -6,10 +6,6 @@
namespace Perspex.Controls.Primitives
{
using System;
using System.Collections.Generic;
using System.Linq;
public class HeaderedContentControl : ContentControl, IHeadered
{
public static readonly PerspexProperty<object> HeaderProperty =

2
Perspex.Diagnostics/Debug.cs

@ -65,7 +65,7 @@ namespace Perspex.Diagnostics
private static string Indent(int indent)
{
return string.Join("", Enumerable.Repeat(" ", Math.Max(indent, 0)));
return string.Join(string.Empty, Enumerable.Repeat(" ", Math.Max(indent, 0)));
}
}
}

4
Perspex.Diagnostics/LogManager.cs

@ -53,8 +53,8 @@ namespace Perspex.Diagnostics
public IFullLogger GetLogger(Type type)
{
if ((type == typeof(PerspexObject) && LogPropertyMessages) ||
(type == typeof(Layoutable) && LogLayoutMessages))
if ((type == typeof(PerspexObject) && this.LogPropertyMessages) ||
(type == typeof(Layoutable) && this.LogLayoutMessages))
{
return new WrappingFullLogger(this.Logger, type);
}

8
Perspex.Diagnostics/Perspex.Diagnostics.csproj

@ -15,6 +15,7 @@
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TargetFrameworkProfile>Profile7</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<NuGetPackageImportStamp>4c22110b</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -98,6 +99,13 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

10
Perspex.Diagnostics/Properties/AssemblyInfo.cs

@ -1,7 +1,11 @@
using System.Resources;
// -----------------------------------------------------------------------
// <copyright file="AssemblyInfo.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Resources;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information

2
Perspex.Diagnostics/ViewModels/VisualTreeNode.cs

@ -37,7 +37,7 @@ namespace Perspex.Diagnostics.ViewModels
}
else
{
this.Classes = "";
this.Classes = string.Empty;
}
});
}

1
Perspex.Diagnostics/packages.config

@ -8,4 +8,5 @@
<package id="Rx-Main" version="2.2.5" targetFramework="portable-net45+win" />
<package id="Rx-PlatformServices" version="2.2.5" targetFramework="portable-net45+win" />
<package id="Splat" version="1.5.1" targetFramework="portable-net45+win" />
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="portable-net45+win" developmentDependency="true" />
</packages>

16
Windows/Perspex.Direct2D1/Direct2D1Platform.cs

@ -18,11 +18,16 @@ namespace Perspex.Direct2D1
private static SharpDX.Direct2D1.Factory d2d1Factory = new SharpDX.Direct2D1.Factory();
private static SharpDX.DirectWrite.Factory dwFactory = new SharpDX.DirectWrite.Factory();
private static SharpDX.DirectWrite.Factory dwfactory = new SharpDX.DirectWrite.Factory();
private static SharpDX.WIC.ImagingFactory imagingFactory = new SharpDX.WIC.ImagingFactory();
private static TextService textService = new TextService(dwFactory);
private static TextService textService = new TextService(dwfactory);
public ITextService TextService
{
get { return textService; }
}
public static void Initialize()
{
@ -30,15 +35,10 @@ namespace Perspex.Direct2D1
locator.Register(() => instance, typeof(IPlatformRenderInterface));
locator.Register(() => textService, typeof(ITextService));
locator.Register(() => d2d1Factory, typeof(SharpDX.Direct2D1.Factory));
locator.Register(() => dwFactory, typeof(SharpDX.DirectWrite.Factory));
locator.Register(() => dwfactory, typeof(SharpDX.DirectWrite.Factory));
locator.Register(() => imagingFactory, typeof(SharpDX.WIC.ImagingFactory));
}
public ITextService TextService
{
get { return textService; }
}
public IBitmapImpl CreateBitmap(int width, int height)
{
return new BitmapImpl(imagingFactory, width, height);

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

@ -46,8 +46,8 @@ namespace Perspex.Direct2D1.Media
public Matrix CurrentTransform
{
get { return Convert(this.renderTarget.Transform); }
set { this.renderTarget.Transform = Convert(value); }
get { return this.Convert(this.renderTarget.Transform); }
set { this.renderTarget.Transform = this.Convert(value); }
}
/// <summary>

2
Windows/Perspex.Direct2D1/Media/Imaging/BitmapImpl.cs

@ -76,7 +76,7 @@ namespace Perspex.Direct2D1.Media
using (FileStream s = new FileStream(fileName, FileMode.Create))
{
PngBitmapEncoder encoder = new PngBitmapEncoder(factory);
PngBitmapEncoder encoder = new PngBitmapEncoder(this.factory);
encoder.Initialize(s);
BitmapFrameEncode frame = new BitmapFrameEncode(encoder);

2
Windows/Perspex.Direct2D1/Media/StreamGeometryContextImpl.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="Direct2D1StreamGeometryContext.cs" company="Steven Kirk">
// <copyright file="StreamGeometryContextImpl.cs" company="Steven Kirk">
// Copyright 2013 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------

8
Windows/Perspex.Direct2D1/Media/StreamGeometryImpl.cs

@ -1,5 +1,5 @@
// -----------------------------------------------------------------------
// <copyright file="Direct2DStreamGeometry.cs" company="Steven Kirk">
// <copyright file="StreamGeometryImpl.cs" company="Steven Kirk">
// Copyright 2014 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
@ -25,17 +25,17 @@ namespace Perspex.Direct2D1.Media
public override Rect Bounds
{
get { return geometry.GetBounds().ToPerspex(); }
get { return this.geometry.GetBounds().ToPerspex(); }
}
public override Rect GetRenderBounds(double strokeThickness)
{
return geometry.GetWidenedBounds((float)strokeThickness).ToPerspex();
return this.geometry.GetWidenedBounds((float)strokeThickness).ToPerspex();
}
public IStreamGeometryContextImpl Open()
{
return new StreamGeometryContextImpl(geometry.Open());
return new StreamGeometryContextImpl(this.geometry.Open());
}
}
}

4
Windows/Perspex.Direct2D1/Perspex.Direct2D1.csproj

@ -11,7 +11,7 @@
<AssemblyName>Perspex.Direct2D1</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>3a241101</NuGetPackageImportStamp>
<NuGetPackageImportStamp>48ceee32</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@ -99,7 +99,9 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\SharpDX.2.6.3\build\SharpDX.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\SharpDX.2.6.3\build\SharpDX.targets'))" />
<Error Condition="!Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
</Target>
<Import Project="..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">

8
Windows/Perspex.Direct2D1/TextService.cs

@ -43,7 +43,7 @@ namespace Perspex.Direct2D1
public int GetCaretIndex(FormattedText text, Point point, Size constraint)
{
using (TextLayout layout = GetTextLayout(this.factory, text, constraint))
using (TextLayout layout = this.GetTextLayout(this.factory, text, constraint))
{
SharpDX.Bool isTrailingHit;
SharpDX.Bool isInside;
@ -60,7 +60,7 @@ namespace Perspex.Direct2D1
public Point GetCaretPosition(FormattedText text, int caretIndex, Size constraint)
{
using (TextLayout layout = GetTextLayout(this.factory, text, constraint))
using (TextLayout layout = this.GetTextLayout(this.factory, text, constraint))
{
float x;
float y;
@ -71,7 +71,7 @@ namespace Perspex.Direct2D1
public double[] GetLineHeights(FormattedText text, Size constraint)
{
using (TextLayout layout = GetTextLayout(this.factory, text, constraint))
using (TextLayout layout = this.GetTextLayout(this.factory, text, constraint))
{
return layout.GetLineMetrics().Select(x => (double)x.Height).ToArray();
}
@ -79,7 +79,7 @@ namespace Perspex.Direct2D1
public Size Measure(FormattedText text, Size constraint)
{
using (TextLayout layout = GetTextLayout(this.factory, text, constraint))
using (TextLayout layout = this.GetTextLayout(this.factory, text, constraint))
{
return new Size(
layout.Metrics.WidthIncludingTrailingWhitespace,

1
Windows/Perspex.Direct2D1/packages.config

@ -7,4 +7,5 @@
<package id="SharpDX.Direct2D1" version="2.6.3" targetFramework="net45" />
<package id="SharpDX.DXGI" version="2.6.3" targetFramework="net45" />
<package id="Splat" version="1.5.1" targetFramework="net45" />
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="net45" developmentDependency="true" />
</packages>
Loading…
Cancel
Save