From dbeb0344f8f616c5e3554743face8d83996b131f Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Tue, 8 Sep 2015 22:47:45 +0300 Subject: [PATCH] static readonly rename --- src/Gtk/Perspex.Gtk/CursorFactory.cs | 10 +++++----- src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs | 8 ++++---- src/Gtk/Perspex.Gtk/WindowImpl.cs | 4 ++-- src/Perspex.Animation/Animate.cs | 4 ++-- src/Perspex.Base/Utilities/TypeUtilities.cs | 4 ++-- src/Perspex.Controls/Deck.cs | 4 ++-- src/Perspex.Controls/ItemsControl.cs | 4 ++-- src/Perspex.Controls/Menu.cs | 4 ++-- src/Perspex.Controls/MenuItem.cs | 4 ++-- src/Perspex.Controls/TreeViewItem.cs | 4 ++-- src/Perspex.Diagnostics/Views/ControlDetailsView.cs | 6 +++--- src/Perspex.Diagnostics/Views/LogicalTreeView.cs | 6 +++--- src/Perspex.Diagnostics/Views/VisualTreeView.cs | 6 +++--- src/Perspex.SceneGraph/Media/PathMarkupParser.cs | 4 ++-- src/Perspex.Themes.Default/MenuItemStyle.cs | 6 +++--- src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs | 6 +++--- src/Windows/Perspex.Win32/CursorFactory.cs | 10 +++++----- .../Perspex.Win32/Embedding/EmbeddedWindowImpl.cs | 4 ++-- src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs | 1 + src/Windows/Perspex.Win32/WindowImpl.cs | 10 +++++----- .../Controls/Shapes/PathTests.cs | 6 +++--- .../Perspex.Direct2D1.UnitTests/Media/GeometryTests.cs | 6 +++--- 22 files changed, 61 insertions(+), 60 deletions(-) diff --git a/src/Gtk/Perspex.Gtk/CursorFactory.cs b/src/Gtk/Perspex.Gtk/CursorFactory.cs index 00b433b6b8..80e6b7b1e6 100644 --- a/src/Gtk/Perspex.Gtk/CursorFactory.cs +++ b/src/Gtk/Perspex.Gtk/CursorFactory.cs @@ -18,7 +18,7 @@ namespace Perspex.Gtk { } - private static readonly Dictionary s_cursorTypeMapping = new Dictionary + private static readonly Dictionary CursorTypeMapping = new Dictionary { { StandardCursorType.AppStarting, CursorType.Watch }, @@ -37,7 +37,7 @@ namespace Perspex.Gtk { StandardCursorType.Help, Gtk.Stock.Help } }; - private static readonly Dictionary s_cache = + private static readonly Dictionary Cache = new Dictionary(); private Gdk.Cursor GetCursor(object desc) @@ -62,12 +62,12 @@ namespace Perspex.Gtk public IPlatformHandle GetCursor(StandardCursorType cursorType) { IPlatformHandle rv; - if (!s_cache.TryGetValue(cursorType, out rv)) + if (!Cache.TryGetValue(cursorType, out rv)) { - s_cache[cursorType] = + Cache[cursorType] = rv = new PlatformHandle( - GetCursor(s_cursorTypeMapping[cursorType]).Handle, + GetCursor(CursorTypeMapping[cursorType]).Handle, "GTKCURSOR"); } diff --git a/src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs b/src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs index fb56e1ae2b..5dcf4af138 100644 --- a/src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs +++ b/src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs @@ -11,7 +11,7 @@ namespace Perspex.Gtk public class GtkKeyboardDevice : KeyboardDevice { private static GtkKeyboardDevice s_instance; - private static readonly Dictionary s_nameDic = new Dictionary(); + private static readonly Dictionary NameDic = new Dictionary(); static GtkKeyboardDevice() { @@ -19,9 +19,9 @@ namespace Perspex.Gtk foreach (var f in typeof(Gdk.Key).GetFields(BindingFlags.Public | BindingFlags.Static)) { var key = (Gdk.Key)f.GetValue(null); - if (s_nameDic.ContainsKey(key)) + if (NameDic.ContainsKey(key)) continue; - s_nameDic[key] = f.Name; + NameDic[key] = f.Name; } } @@ -41,7 +41,7 @@ namespace Perspex.Gtk else { string s; - if (!s_nameDic.TryGetValue(key, out s)) + if (!NameDic.TryGetValue(key, out s)) s = "Unknown"; Key result; diff --git a/src/Gtk/Perspex.Gtk/WindowImpl.cs b/src/Gtk/Perspex.Gtk/WindowImpl.cs index 9d8140fec0..4247a3d853 100644 --- a/src/Gtk/Perspex.Gtk/WindowImpl.cs +++ b/src/Gtk/Perspex.Gtk/WindowImpl.cs @@ -26,7 +26,7 @@ namespace Perspex.Gtk private uint _lastKeyEventTimestamp; - private static readonly Gdk.Cursor s_defaultCursor = new Gdk.Cursor(CursorType.LeftPtr); + private static readonly Gdk.Cursor DefaultCursor = new Gdk.Cursor(CursorType.LeftPtr); public WindowImpl() : base(Gtk.WindowType.Toplevel) @@ -104,7 +104,7 @@ namespace Perspex.Gtk public void SetCursor(IPlatformHandle cursor) { - GdkWindow.Cursor = cursor != null ? new Gdk.Cursor(cursor.Handle) : s_defaultCursor; + GdkWindow.Cursor = cursor != null ? new Gdk.Cursor(cursor.Handle) : DefaultCursor; } public IDisposable ShowDialog() diff --git a/src/Perspex.Animation/Animate.cs b/src/Perspex.Animation/Animate.cs index d649eab642..85db3e71b7 100644 --- a/src/Perspex.Animation/Animate.cs +++ b/src/Perspex.Animation/Animate.cs @@ -22,7 +22,7 @@ namespace Perspex.Animation /// /// The time span of each frame. /// - private static readonly TimeSpan s_tick = TimeSpan.FromSeconds(1.0 / FramesPerSecond); + private static readonly TimeSpan Tick = TimeSpan.FromSeconds(1.0 / FramesPerSecond); /// /// Initializes static members of the class. @@ -31,7 +31,7 @@ namespace Perspex.Animation { Stopwatch = new Stopwatch(); Stopwatch.Start(); - Timer = Observable.Interval(s_tick, PerspexScheduler.Instance) + Timer = Observable.Interval(Tick, PerspexScheduler.Instance) .Select(_ => Stopwatch.Elapsed) .Publish() .RefCount(); diff --git a/src/Perspex.Base/Utilities/TypeUtilities.cs b/src/Perspex.Base/Utilities/TypeUtilities.cs index 376496eb3b..81bd5ad250 100644 --- a/src/Perspex.Base/Utilities/TypeUtilities.cs +++ b/src/Perspex.Base/Utilities/TypeUtilities.cs @@ -13,7 +13,7 @@ namespace Perspex.Utilities /// internal static class TypeUtilities { - private static readonly Dictionary> s_conversions = new Dictionary>() + private static readonly Dictionary> Conversions = new Dictionary>() { { typeof(decimal), new List { typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(char) } }, { typeof(double), new List { typeof(sbyte), typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), typeof(long), typeof(ulong), typeof(char), typeof(float) } }, @@ -56,7 +56,7 @@ namespace Perspex.Utilities result = value; return true; } - else if (s_conversions.ContainsKey(to) && s_conversions[to].Contains(from)) + else if (Conversions.ContainsKey(to) && Conversions[to].Contains(from)) { result = Convert.ChangeType(value, to); return true; diff --git a/src/Perspex.Controls/Deck.cs b/src/Perspex.Controls/Deck.cs index 6a912bc380..dc4ba99301 100644 --- a/src/Perspex.Controls/Deck.cs +++ b/src/Perspex.Controls/Deck.cs @@ -23,7 +23,7 @@ namespace Perspex.Controls /// /// The default value of for . /// - private static readonly ITemplate s_panelTemplate = + private static readonly ITemplate PanelTemplate = new FuncTemplate(() => new Panel()); /// @@ -32,7 +32,7 @@ namespace Perspex.Controls static Deck() { AutoSelectProperty.OverrideDefaultValue(true); - ItemsPanelProperty.OverrideDefaultValue(s_panelTemplate); + ItemsPanelProperty.OverrideDefaultValue(PanelTemplate); } /// diff --git a/src/Perspex.Controls/ItemsControl.cs b/src/Perspex.Controls/ItemsControl.cs index 7df0ad3433..83f86eba78 100644 --- a/src/Perspex.Controls/ItemsControl.cs +++ b/src/Perspex.Controls/ItemsControl.cs @@ -26,7 +26,7 @@ namespace Perspex.Controls /// The default value for the property. /// [SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1202:ElementsMustBeOrderedByAccess", Justification = "Needs to be before or a NullReferenceException is thrown.")] - private static readonly FuncTemplate s_defaultPanel = + private static readonly FuncTemplate DefaultPanel = new FuncTemplate(() => new StackPanel()); /// @@ -39,7 +39,7 @@ namespace Perspex.Controls /// Defines the property. /// public static readonly PerspexProperty> ItemsPanelProperty = - PerspexProperty.Register>("ItemsPanel", defaultValue: s_defaultPanel); + PerspexProperty.Register>("ItemsPanel", defaultValue: DefaultPanel); private IItemContainerGenerator _itemContainerGenerator; diff --git a/src/Perspex.Controls/Menu.cs b/src/Perspex.Controls/Menu.cs index 4f8cc2913e..db424ddcf8 100644 --- a/src/Perspex.Controls/Menu.cs +++ b/src/Perspex.Controls/Menu.cs @@ -21,7 +21,7 @@ namespace Perspex.Controls /// /// Defines the default items panel used by a . /// - private static readonly ITemplate s_defaultPanel = + private static readonly ITemplate DefaultPanel = new FuncTemplate(() => new StackPanel { Orientation = Orientation.Horizontal }); /// @@ -40,7 +40,7 @@ namespace Perspex.Controls /// static Menu() { - ItemsPanelProperty.OverrideDefaultValue(typeof(Menu), s_defaultPanel); + ItemsPanelProperty.OverrideDefaultValue(typeof(Menu), DefaultPanel); MenuItem.ClickEvent.AddClassHandler(x => x.OnMenuClick); MenuItem.SubmenuOpenedEvent.AddClassHandler(x => x.OnSubmenuOpened); } diff --git a/src/Perspex.Controls/MenuItem.cs b/src/Perspex.Controls/MenuItem.cs index 1b374367e0..2c9b7eaaba 100644 --- a/src/Perspex.Controls/MenuItem.cs +++ b/src/Perspex.Controls/MenuItem.cs @@ -74,7 +74,7 @@ namespace Perspex.Controls /// /// The default value for the property. /// - private static readonly ITemplate s_defaultPanel = + private static readonly ITemplate DefaultPanel = new FuncTemplate(() => new StackPanel { [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Cycle, @@ -97,7 +97,7 @@ namespace Perspex.Controls { SelectableMixin.Attach(IsSelectedProperty); FocusableProperty.OverrideDefaultValue(true); - ItemsPanelProperty.OverrideDefaultValue(s_defaultPanel); + ItemsPanelProperty.OverrideDefaultValue(DefaultPanel); ClickEvent.AddClassHandler(x => x.OnClick); SubmenuOpenedEvent.AddClassHandler(x => x.OnSubmenuOpened); IsSubMenuOpenProperty.Changed.AddClassHandler(x => x.SubMenuOpenChanged); diff --git a/src/Perspex.Controls/TreeViewItem.cs b/src/Perspex.Controls/TreeViewItem.cs index 80e306478d..19bbdb1e7b 100644 --- a/src/Perspex.Controls/TreeViewItem.cs +++ b/src/Perspex.Controls/TreeViewItem.cs @@ -30,7 +30,7 @@ namespace Perspex.Controls public static readonly PerspexProperty IsSelectedProperty = ListBoxItem.IsSelectedProperty.AddOwner(); - private static readonly ITemplate s_defaultPanel = + private static readonly ITemplate DefaultPanel = new FuncTemplate(() => new StackPanel { [KeyboardNavigation.DirectionalNavigationProperty] = KeyboardNavigationMode.Continue, @@ -45,7 +45,7 @@ namespace Perspex.Controls { SelectableMixin.Attach(IsSelectedProperty); FocusableProperty.OverrideDefaultValue(true); - ItemsPanelProperty.OverrideDefaultValue(s_defaultPanel); + ItemsPanelProperty.OverrideDefaultValue(DefaultPanel); } /// diff --git a/src/Perspex.Diagnostics/Views/ControlDetailsView.cs b/src/Perspex.Diagnostics/Views/ControlDetailsView.cs index bb74a0523e..199ece2122 100644 --- a/src/Perspex.Diagnostics/Views/ControlDetailsView.cs +++ b/src/Perspex.Diagnostics/Views/ControlDetailsView.cs @@ -13,7 +13,7 @@ namespace Perspex.Diagnostics.Views { internal class ControlDetailsView : UserControl { - private static readonly PerspexProperty s_viewModelProperty = + private static readonly PerspexProperty ViewModelProperty = PerspexProperty.Register("ViewModel"); public ControlDetailsView() @@ -25,8 +25,8 @@ namespace Perspex.Diagnostics.Views public ControlDetailsViewModel ViewModel { - get { return GetValue(s_viewModelProperty); } - private set { SetValue(s_viewModelProperty, value); } + get { return GetValue(ViewModelProperty); } + private set { SetValue(ViewModelProperty, value); } } private void InitializeComponent() diff --git a/src/Perspex.Diagnostics/Views/LogicalTreeView.cs b/src/Perspex.Diagnostics/Views/LogicalTreeView.cs index a107e5eba4..d68bc71fee 100644 --- a/src/Perspex.Diagnostics/Views/LogicalTreeView.cs +++ b/src/Perspex.Diagnostics/Views/LogicalTreeView.cs @@ -14,7 +14,7 @@ namespace Perspex.Diagnostics.Views internal class LogicalTreeView : TreePage { - private static readonly PerspexProperty s_viewModelProperty = + private static readonly PerspexProperty ViewModelProperty = PerspexProperty.Register("ViewModel"); public LogicalTreeView() @@ -26,8 +26,8 @@ namespace Perspex.Diagnostics.Views public LogicalTreeViewModel ViewModel { - get { return GetValue(s_viewModelProperty); } - private set { SetValue(s_viewModelProperty, value); } + get { return GetValue(ViewModelProperty); } + private set { SetValue(ViewModelProperty, value); } } private void InitializeComponent() diff --git a/src/Perspex.Diagnostics/Views/VisualTreeView.cs b/src/Perspex.Diagnostics/Views/VisualTreeView.cs index 501f73fdf4..485ed264aa 100644 --- a/src/Perspex.Diagnostics/Views/VisualTreeView.cs +++ b/src/Perspex.Diagnostics/Views/VisualTreeView.cs @@ -15,7 +15,7 @@ namespace Perspex.Diagnostics.Views internal class VisualTreeView : TreePage { - private static readonly PerspexProperty s_viewModelProperty = + private static readonly PerspexProperty ViewModelProperty = PerspexProperty.Register("ViewModel"); public VisualTreeView() @@ -27,8 +27,8 @@ namespace Perspex.Diagnostics.Views public VisualTreeViewModel ViewModel { - get { return GetValue(s_viewModelProperty); } - private set { SetValue(s_viewModelProperty, value); } + get { return GetValue(ViewModelProperty); } + private set { SetValue(ViewModelProperty, value); } } private void InitializeComponent() diff --git a/src/Perspex.SceneGraph/Media/PathMarkupParser.cs b/src/Perspex.SceneGraph/Media/PathMarkupParser.cs index 90a3067b87..ed0f2be4ea 100644 --- a/src/Perspex.SceneGraph/Media/PathMarkupParser.cs +++ b/src/Perspex.SceneGraph/Media/PathMarkupParser.cs @@ -14,7 +14,7 @@ namespace Perspex.Media /// public class PathMarkupParser { - private static readonly Dictionary s_commands = new Dictionary + private static readonly Dictionary Commands = new Dictionary { { 'F', Command.FillRule }, { 'f', Command.FillRule }, @@ -184,7 +184,7 @@ namespace Perspex.Media char c = (char)i; Command command = Command.None; - if (!s_commands.TryGetValue(c, out command)) + if (!Commands.TryGetValue(c, out command)) { if ((char.IsDigit(c) || c == '.' || c == '+' || c == '-') && (lastCommand != Command.None)) diff --git a/src/Perspex.Themes.Default/MenuItemStyle.cs b/src/Perspex.Themes.Default/MenuItemStyle.cs index 11abd6ae75..a53b0e865c 100644 --- a/src/Perspex.Themes.Default/MenuItemStyle.cs +++ b/src/Perspex.Themes.Default/MenuItemStyle.cs @@ -21,7 +21,7 @@ namespace Perspex.Themes.Default /// public class MenuItemStyle : Styles { - private static readonly DataTemplate s_accessKeyDataTemplate = + private static readonly DataTemplate AccessKeyDataTemplate = new DataTemplate(x => new AccessText { Text = x }); /// @@ -96,7 +96,7 @@ namespace Perspex.Themes.Default { DataTemplates = new DataTemplates { - s_accessKeyDataTemplate, + AccessKeyDataTemplate, }, [~ContentPresenter.ContentProperty] = control[~MenuItem.HeaderProperty], [~Layoutable.MarginProperty] = control[~TemplatedControl.PaddingProperty], @@ -197,7 +197,7 @@ namespace Perspex.Themes.Default { DataTemplates = new DataTemplates { - s_accessKeyDataTemplate, + AccessKeyDataTemplate, }, VerticalAlignment = VerticalAlignment.Center, [~ContentPresenter.ContentProperty] = control[~MenuItem.HeaderProperty], diff --git a/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs b/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs index 25c007fabc..69e5fa99de 100644 --- a/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs +++ b/src/Windows/Perspex.Direct2D1/Direct2D1Platform.cs @@ -13,7 +13,7 @@ namespace Perspex.Direct2D1 { private static Direct2D1Platform s_instance = new Direct2D1Platform(); - private static SharpDX.Direct2D1.Factory s_d2d1Factory = new SharpDX.Direct2D1.Factory(); + private static SharpDX.Direct2D1.Factory s_d2D1Factory = new SharpDX.Direct2D1.Factory(); private static SharpDX.DirectWrite.Factory s_dwfactory = new SharpDX.DirectWrite.Factory(); @@ -23,7 +23,7 @@ namespace Perspex.Direct2D1 { var locator = Locator.CurrentMutable; locator.Register(() => s_instance, typeof(IPlatformRenderInterface)); - locator.Register(() => s_d2d1Factory, typeof(SharpDX.Direct2D1.Factory)); + locator.Register(() => s_d2D1Factory, typeof(SharpDX.Direct2D1.Factory)); locator.Register(() => s_dwfactory, typeof(SharpDX.DirectWrite.Factory)); locator.Register(() => s_imagingFactory, typeof(SharpDX.WIC.ImagingFactory)); } @@ -60,7 +60,7 @@ namespace Perspex.Direct2D1 public IRenderTargetBitmapImpl CreateRenderTargetBitmap(int width, int height) { - return new RenderTargetBitmapImpl(s_imagingFactory, s_d2d1Factory, width, height); + return new RenderTargetBitmapImpl(s_imagingFactory, s_d2D1Factory, width, height); } public IStreamGeometryImpl CreateStreamGeometry() diff --git a/src/Windows/Perspex.Win32/CursorFactory.cs b/src/Windows/Perspex.Win32/CursorFactory.cs index ed4212e19e..ad2defac35 100644 --- a/src/Windows/Perspex.Win32/CursorFactory.cs +++ b/src/Windows/Perspex.Win32/CursorFactory.cs @@ -20,7 +20,7 @@ namespace Perspex.Win32 { } - private static readonly Dictionary s_cursorTypeMapping = new Dictionary + private static readonly Dictionary CursorTypeMapping = new Dictionary { { StandardCursorType.AppStarting, 32650 }, @@ -41,18 +41,18 @@ namespace Perspex.Win32 { StandardCursorType.Wait, 32514 } }; - private static readonly Dictionary s_cache = + private static readonly Dictionary Cache = new Dictionary(); public IPlatformHandle GetCursor(StandardCursorType cursorType) { IPlatformHandle rv; - if (!s_cache.TryGetValue(cursorType, out rv)) + if (!Cache.TryGetValue(cursorType, out rv)) { - s_cache[cursorType] = + Cache[cursorType] = rv = new PlatformHandle( - UnmanagedMethods.LoadCursor(IntPtr.Zero, new IntPtr(s_cursorTypeMapping[cursorType])), + UnmanagedMethods.LoadCursor(IntPtr.Zero, new IntPtr(CursorTypeMapping[cursorType])), PlatformConstants.CursorHandleType); } diff --git a/src/Windows/Perspex.Win32/Embedding/EmbeddedWindowImpl.cs b/src/Windows/Perspex.Win32/Embedding/EmbeddedWindowImpl.cs index 6d2be4ce13..a4e6bec9e4 100644 --- a/src/Windows/Perspex.Win32/Embedding/EmbeddedWindowImpl.cs +++ b/src/Windows/Perspex.Win32/Embedding/EmbeddedWindowImpl.cs @@ -8,7 +8,7 @@ namespace Perspex.Win32 { public class EmbeddedWindowImpl : WindowImpl { - private static readonly System.Windows.Forms.UserControl s_winFormsControl = new System.Windows.Forms.UserControl(); + private static readonly System.Windows.Forms.UserControl WinFormsControl = new System.Windows.Forms.UserControl(); public IntPtr Handle { get; private set; } @@ -23,7 +23,7 @@ namespace Perspex.Win32 UnmanagedMethods.CW_USEDEFAULT, UnmanagedMethods.CW_USEDEFAULT, UnmanagedMethods.CW_USEDEFAULT, - s_winFormsControl.Handle, + WinFormsControl.Handle, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); diff --git a/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs b/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs index 0cbcd707ca..feb033005d 100644 --- a/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs +++ b/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.Text; +// ReSharper disable InconsistentNaming namespace Perspex.Win32.Interop { diff --git a/src/Windows/Perspex.Win32/WindowImpl.cs b/src/Windows/Perspex.Win32/WindowImpl.cs index ca46e3c90c..84982e08ac 100644 --- a/src/Windows/Perspex.Win32/WindowImpl.cs +++ b/src/Windows/Perspex.Win32/WindowImpl.cs @@ -22,7 +22,7 @@ namespace Perspex.Win32 { private static List s_instances = new List(); - private static readonly IntPtr s_defaultCursor = UnmanagedMethods.LoadCursor( + private static readonly IntPtr DefaultCursor = UnmanagedMethods.LoadCursor( IntPtr.Zero, new IntPtr((int)UnmanagedMethods.Cursor.IDC_ARROW)); private UnmanagedMethods.WndProc _wndProcDelegate; @@ -187,7 +187,7 @@ namespace Perspex.Win32 public void SetCursor(IPlatformHandle cursor) { UnmanagedMethods.SetClassLong(_hwnd, UnmanagedMethods.ClassLongIndex.GCL_HCURSOR, - cursor?.Handle ?? s_defaultCursor); + cursor?.Handle ?? DefaultCursor); } protected virtual IntPtr CreateWindowOverride(ushort atom) @@ -212,7 +212,7 @@ namespace Perspex.Win32 { bool unicode = UnmanagedMethods.IsWindowUnicode(hWnd); - const double WheelDelta = 120.0; + const double wheelDelta = 120.0; uint timestamp = unchecked((uint)UnmanagedMethods.GetMessageTime()); RawInputEventArgs e = null; @@ -327,7 +327,7 @@ namespace Perspex.Win32 timestamp, _owner, ScreenToClient((uint)lParam & 0xffff, (uint)lParam >> 16), - new Vector(0, ((int)wParam >> 16) / WheelDelta), WindowsKeyboardDevice.Instance.Modifiers); + new Vector(0, ((int)wParam >> 16) / wheelDelta), WindowsKeyboardDevice.Instance.Modifiers); break; case UnmanagedMethods.WindowsMessage.WM_MOUSELEAVE: @@ -388,7 +388,7 @@ namespace Perspex.Win32 style = 0, lpfnWndProc = _wndProcDelegate, hInstance = Marshal.GetHINSTANCE(GetType().Module), - hCursor = s_defaultCursor, + hCursor = DefaultCursor, hbrBackground = (IntPtr)5, lpszClassName = _className, }; diff --git a/tests/Perspex.Direct2D1.UnitTests/Controls/Shapes/PathTests.cs b/tests/Perspex.Direct2D1.UnitTests/Controls/Shapes/PathTests.cs index 7ba098966b..cd5d318117 100644 --- a/tests/Perspex.Direct2D1.UnitTests/Controls/Shapes/PathTests.cs +++ b/tests/Perspex.Direct2D1.UnitTests/Controls/Shapes/PathTests.cs @@ -11,7 +11,7 @@ namespace Perspex.Direct2D1.UnitTests.Controls.Shapes { public class PathTests { - private static readonly RectComparer s_compare = new RectComparer(); + private static readonly RectComparer Compare = new RectComparer(); [Fact] public void Should_Measure_Expander_Triangle_Correctly() @@ -32,7 +32,7 @@ namespace Perspex.Direct2D1.UnitTests.Controls.Shapes target.Measure(new Size(100, 100)); target.Arrange(new Rect(0, 0, 100, 100)); - Assert.Equal(new Rect(0, 0, 4, 10), target.Bounds, s_compare); + Assert.Equal(new Rect(0, 0, 4, 10), target.Bounds, Compare); } } @@ -66,7 +66,7 @@ namespace Perspex.Direct2D1.UnitTests.Controls.Shapes // // However Path.Measure doesn't correctly handle strokes currently, so testing for // the (incorrect) current output for now... - Assert.Equal(new Rect(0, 0, 4, 10), target.Bounds, s_compare); + Assert.Equal(new Rect(0, 0, 4, 10), target.Bounds, Compare); } } } diff --git a/tests/Perspex.Direct2D1.UnitTests/Media/GeometryTests.cs b/tests/Perspex.Direct2D1.UnitTests/Media/GeometryTests.cs index c2aa6506c7..de46378d00 100644 --- a/tests/Perspex.Direct2D1.UnitTests/Media/GeometryTests.cs +++ b/tests/Perspex.Direct2D1.UnitTests/Media/GeometryTests.cs @@ -9,7 +9,7 @@ namespace Perspex.Direct2D1.UnitTests.Media { public class GeometryTests { - private static readonly RectComparer s_compare = new RectComparer(); + private static readonly RectComparer Compare = new RectComparer(); [Fact] public void Should_Measure_Expander_Triangle_Correctly() @@ -20,7 +20,7 @@ namespace Perspex.Direct2D1.UnitTests.Media var target = StreamGeometry.Parse("M 0 2 L 4 6 L 0 10 Z"); - Assert.Equal(new Rect(0, 2, 4, 8), target.Bounds, s_compare); + Assert.Equal(new Rect(0, 2, 4, 8), target.Bounds, Compare); } } @@ -33,7 +33,7 @@ namespace Perspex.Direct2D1.UnitTests.Media var target = StreamGeometry.Parse("M 0 2 L 4 6 L 0 10 Z"); - Assert.Equal(new Rect(-1, -0.414, 6.414, 12.828), target.GetRenderBounds(2), s_compare); + Assert.Equal(new Rect(-1, -0.414, 6.414, 12.828), target.GetRenderBounds(2), Compare); } } }