From 55a11d8dfdf10e9b844b553951e06e6d0cf10239 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 5 Dec 2014 22:32:08 +0100 Subject: [PATCH] More stylecop fixes. --- .../Perspex.Cairo/Properties/AssemblyInfo.cs | 8 +- Perspex.Base/Binding.cs | 2 +- Perspex.Base/PerspexList.cs | 60 ++++---- Perspex.Base/PerspexListExtensions.cs | 21 ++- Perspex.Base/PerspexObject.cs | 13 +- Perspex.Base/PerspexProperty.cs | 3 +- Perspex.Base/Platform/IPlatformHandle.cs | 2 +- .../Platform/IPlatformThreadingInterface.cs | 6 +- Perspex.Base/Properties/AssemblyInfo.cs | 10 +- .../Presenters/ScrollContentPresenter.cs | 2 +- Perspex.Controls/Window.cs | 2 +- Perspex.Input/FocusManager.cs | 2 +- Perspex.Input/InputElement.cs | 2 +- Perspex.Input/KeyEventArgs.cs | 2 +- Perspex.Input/KeyboardDevice.cs | 4 +- Perspex.Input/Properties/AssemblyInfo.cs | 10 +- Perspex.Input/Raw/RawMouseEventArgs.cs | 2 +- Perspex.Input/Raw/RawMouseWheelEventArgs.cs | 2 +- Perspex.Input/Raw/RawSizeEventArgs.cs | 2 +- .../Properties/AssemblyInfo.cs | 10 +- Perspex.Layout/LayoutManager.cs | 4 - Perspex.Layout/Layoutable.cs | 39 ++--- Perspex.Layout/Properties/AssemblyInfo.cs | 10 +- Perspex.SceneGraph/Media/Brushes.cs | 140 ++++++++++++++++++ Perspex.SceneGraph/Media/ITransform.cs | 2 +- Perspex.SceneGraph/Origin.cs | 4 +- .../Platform/IPlatformRenderInterface.cs | 2 +- Perspex.SceneGraph/Properties/AssemblyInfo.cs | 10 +- Perspex.SceneGraph/Rect.cs | 8 +- Perspex.SceneGraph/Rendering/IRenderRoot.cs | 2 +- Perspex.SceneGraph/Visual.cs | 4 +- Perspex.Styling/Properties/AssemblyInfo.cs | 10 +- .../Properties/AssemblyInfo.cs | 8 +- 33 files changed, 289 insertions(+), 119 deletions(-) diff --git a/Cairo/Perspex.Cairo/Properties/AssemblyInfo.cs b/Cairo/Perspex.Cairo/Properties/AssemblyInfo.cs index c143e5e311..95f67d51cb 100644 --- a/Cairo/Perspex.Cairo/Properties/AssemblyInfo.cs +++ b/Cairo/Perspex.Cairo/Properties/AssemblyInfo.cs @@ -1,4 +1,10 @@ -using System.Reflection; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/Perspex.Base/Binding.cs b/Perspex.Base/Binding.cs index 6ad04a90cd..88e2d96b65 100644 --- a/Perspex.Base/Binding.cs +++ b/Perspex.Base/Binding.cs @@ -56,7 +56,7 @@ namespace Perspex public IDisposable Subscribe(IObserver observer) { - return this.Source.GetObservable(Property).Subscribe(observer); + return this.Source.GetObservable(this.Property).Subscribe(observer); } public Binding WithMode(BindingMode mode) diff --git a/Perspex.Base/PerspexList.cs b/Perspex.Base/PerspexList.cs index d0e975427c..13fa97801c 100644 --- a/Perspex.Base/PerspexList.cs +++ b/Perspex.Base/PerspexList.cs @@ -31,29 +31,6 @@ namespace Perspex public event PropertyChangedEventHandler PropertyChanged; - public T this[int index] - { - get - { - return this.inner[index]; - } - - set - { - T old = this.inner[index]; - this.inner[index] = value; - - if (this.CollectionChanged != null) - { - var e = new NotifyCollectionChangedEventArgs( - NotifyCollectionChangedAction.Replace, - value, - old); - this.CollectionChanged(this, e); - } - } - } - public int Count { get { return this.inner.Count; } @@ -74,13 +51,6 @@ namespace Perspex get { return false; } } - object IList.this[int index] - { - get { return this[index]; } - - set { this[index] = (T)value; } - } - int ICollection.Count { get { return this.inner.Count; } @@ -96,6 +66,36 @@ namespace Perspex get { return null; } } + public T this[int index] + { + get + { + return this.inner[index]; + } + + set + { + T old = this.inner[index]; + this.inner[index] = value; + + if (this.CollectionChanged != null) + { + var e = new NotifyCollectionChangedEventArgs( + NotifyCollectionChangedAction.Replace, + value, + old); + this.CollectionChanged(this, e); + } + } + } + + object IList.this[int index] + { + get { return this[index]; } + + set { this[index] = (T)value; } + } + public void Add(T item) { int index = this.inner.Count; diff --git a/Perspex.Base/PerspexListExtensions.cs b/Perspex.Base/PerspexListExtensions.cs index 6fefb12cc8..13ee014d49 100644 --- a/Perspex.Base/PerspexListExtensions.cs +++ b/Perspex.Base/PerspexListExtensions.cs @@ -1,14 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Linq; -using System.Reactive.Disposables; -using System.Text; -using System.Threading.Tasks; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- namespace Perspex { + using System; + using System.Collections.Generic; + using System.Collections.Specialized; + using System.ComponentModel; + using System.Reactive.Disposables; + public static class PerspexListExtensions { public static IDisposable ForEachItem( @@ -25,6 +28,7 @@ namespace Perspex { added(i); } + break; case NotifyCollectionChangedAction.Replace: @@ -45,6 +49,7 @@ namespace Perspex { removed(i); } + break; } }; diff --git a/Perspex.Base/PerspexObject.cs b/Perspex.Base/PerspexObject.cs index cfe572c925..b0980cf687 100644 --- a/Perspex.Base/PerspexObject.cs +++ b/Perspex.Base/PerspexObject.cs @@ -77,6 +77,11 @@ namespace Perspex private Dictionary values = new Dictionary(); + /// + /// Event handler for implementation. + /// + private PropertyChangedEventHandler inpcChanged; + /// /// Initializes a new instance of the class. /// @@ -94,11 +99,6 @@ namespace Perspex } } - /// - /// Event handler for implementation. - /// - private PropertyChangedEventHandler inpcChanged; - /// /// Raised when a value changes on this object. /// @@ -161,7 +161,6 @@ namespace Perspex } } - /// /// Gets or sets the value of a . /// @@ -465,7 +464,7 @@ namespace Perspex /// /// The property. /// True if the property is registered, otherwise false. - private bool IsRegistered(PerspexProperty property) + public bool IsRegistered(PerspexProperty property) { Type type = this.GetType(); diff --git a/Perspex.Base/PerspexProperty.cs b/Perspex.Base/PerspexProperty.cs index 4b23e2599b..a5cd7bdb1f 100644 --- a/Perspex.Base/PerspexProperty.cs +++ b/Perspex.Base/PerspexProperty.cs @@ -187,7 +187,7 @@ namespace Perspex /// /// The property. /// A describing the binding. - public static Binding operator!(PerspexProperty property) + public static Binding operator !(PerspexProperty property) { return new Binding { @@ -276,7 +276,6 @@ namespace Perspex Contract.Requires(type != null); // TODO: Ensure correct type. - if (this.defaultValues.ContainsKey(type)) { throw new InvalidOperationException("Default value is already set for this property."); diff --git a/Perspex.Base/Platform/IPlatformHandle.cs b/Perspex.Base/Platform/IPlatformHandle.cs index f0144dc990..c4c0f3994e 100644 --- a/Perspex.Base/Platform/IPlatformHandle.cs +++ b/Perspex.Base/Platform/IPlatformHandle.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.Base/Platform/IPlatformThreadingInterface.cs b/Perspex.Base/Platform/IPlatformThreadingInterface.cs index 8b72ee6a8e..8f7282e0ad 100644 --- a/Perspex.Base/Platform/IPlatformThreadingInterface.cs +++ b/Perspex.Base/Platform/IPlatformThreadingInterface.cs @@ -11,9 +11,9 @@ namespace Perspex.Platform using System.Threading.Tasks; using Perspex.Threading; - /// - /// Provides platform-specific services relating to threading. - /// + /// + /// Provides platform-specific services relating to threading. + /// public interface IPlatformThreadingInterface { /// diff --git a/Perspex.Base/Properties/AssemblyInfo.cs b/Perspex.Base/Properties/AssemblyInfo.cs index 79615c23a0..847139f979 100644 --- a/Perspex.Base/Properties/AssemblyInfo.cs +++ b/Perspex.Base/Properties/AssemblyInfo.cs @@ -1,7 +1,11 @@ -using System.Resources; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + 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 diff --git a/Perspex.Controls/Presenters/ScrollContentPresenter.cs b/Perspex.Controls/Presenters/ScrollContentPresenter.cs index 857c8753fb..16d47d9904 100644 --- a/Perspex.Controls/Presenters/ScrollContentPresenter.cs +++ b/Perspex.Controls/Presenters/ScrollContentPresenter.cs @@ -83,7 +83,7 @@ namespace Perspex.Controls.Presenters { var y = this.Offset.Y + (-e.Delta.Y * 50); y = Math.Max(y, 0); - y = Math.Min(y, Extent.Height - Viewport.Height); + y = Math.Min(y, this.Extent.Height - this.Viewport.Height); this.Offset = new Vector(this.Offset.X, y); e.Handled = true; } diff --git a/Perspex.Controls/Window.cs b/Perspex.Controls/Window.cs index 8c250de062..1c8b4eb33c 100644 --- a/Perspex.Controls/Window.cs +++ b/Perspex.Controls/Window.cs @@ -37,7 +37,7 @@ namespace Perspex.Controls static Window() { BackgroundProperty.OverrideDefaultValue(typeof(Window), Brushes.White); - AffectsMeasure(Window.ClientSizeProperty); + Window.AffectsMeasure(Window.ClientSizeProperty); } public Window() diff --git a/Perspex.Input/FocusManager.cs b/Perspex.Input/FocusManager.cs index 95a88402e7..ffd0ab7d46 100644 --- a/Perspex.Input/FocusManager.cs +++ b/Perspex.Input/FocusManager.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.Input/InputElement.cs b/Perspex.Input/InputElement.cs index f83dfe8202..e42ee69894 100644 --- a/Perspex.Input/InputElement.cs +++ b/Perspex.Input/InputElement.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.Input/KeyEventArgs.cs b/Perspex.Input/KeyEventArgs.cs index b8dcd8df4c..7ae86d4777 100644 --- a/Perspex.Input/KeyEventArgs.cs +++ b/Perspex.Input/KeyEventArgs.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.Input/KeyboardDevice.cs b/Perspex.Input/KeyboardDevice.cs index d7559b1351..199189c72c 100644 --- a/Perspex.Input/KeyboardDevice.cs +++ b/Perspex.Input/KeyboardDevice.cs @@ -59,9 +59,9 @@ namespace Perspex.Input OriginalSource = element, }; - element.RaiseEvent(ev); ; + element.RaiseEvent(ev); ev.RoutedEvent = InputElement.KeyDownEvent; - element.RaiseEvent(ev); ; + element.RaiseEvent(ev); break; } } diff --git a/Perspex.Input/Properties/AssemblyInfo.cs b/Perspex.Input/Properties/AssemblyInfo.cs index cd5f1f96e8..e14d648741 100644 --- a/Perspex.Input/Properties/AssemblyInfo.cs +++ b/Perspex.Input/Properties/AssemblyInfo.cs @@ -1,7 +1,11 @@ -using System.Resources; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + 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 diff --git a/Perspex.Input/Raw/RawMouseEventArgs.cs b/Perspex.Input/Raw/RawMouseEventArgs.cs index 5b0283c626..6c1b92323a 100644 --- a/Perspex.Input/Raw/RawMouseEventArgs.cs +++ b/Perspex.Input/Raw/RawMouseEventArgs.cs @@ -34,7 +34,7 @@ namespace Perspex.Input.Raw this.Type = type; } - //TODO: This should probably be IInputRoot or something. + // TODO: This should probably be IInputRoot or something. public ILayoutRoot Root { get; private set; } public Point Position { get; private set; } diff --git a/Perspex.Input/Raw/RawMouseWheelEventArgs.cs b/Perspex.Input/Raw/RawMouseWheelEventArgs.cs index fa04240905..a516160a73 100644 --- a/Perspex.Input/Raw/RawMouseWheelEventArgs.cs +++ b/Perspex.Input/Raw/RawMouseWheelEventArgs.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.Input/Raw/RawSizeEventArgs.cs b/Perspex.Input/Raw/RawSizeEventArgs.cs index 69f06c6964..0eea6b0dad 100644 --- a/Perspex.Input/Raw/RawSizeEventArgs.cs +++ b/Perspex.Input/Raw/RawSizeEventArgs.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.Interactivity/Properties/AssemblyInfo.cs b/Perspex.Interactivity/Properties/AssemblyInfo.cs index 52b2807242..8b86f5d47e 100644 --- a/Perspex.Interactivity/Properties/AssemblyInfo.cs +++ b/Perspex.Interactivity/Properties/AssemblyInfo.cs @@ -1,7 +1,11 @@ -using System.Resources; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + 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 diff --git a/Perspex.Layout/LayoutManager.cs b/Perspex.Layout/LayoutManager.cs index d89f1ab282..92f0adc14e 100644 --- a/Perspex.Layout/LayoutManager.cs +++ b/Perspex.Layout/LayoutManager.cs @@ -95,8 +95,6 @@ namespace Perspex.Layout { this.LayoutQueued = false; - Layoutable.DebugMeasureCount = Layoutable.DebugArrangeCount = 0; - if (this.measureNeeded) { this.ExecuteMeasure(); @@ -104,8 +102,6 @@ namespace Perspex.Layout } this.ExecuteArrange(); - - System.Diagnostics.Debug.WriteLine(Environment.TickCount + " " + Layoutable.DebugMeasureCount + " " + Layoutable.DebugArrangeCount); } /// diff --git a/Perspex.Layout/Layoutable.cs b/Perspex.Layout/Layoutable.cs index b19b88f8a7..d1d0b1d57c 100644 --- a/Perspex.Layout/Layoutable.cs +++ b/Perspex.Layout/Layoutable.cs @@ -64,16 +64,16 @@ namespace Perspex.Layout static Layoutable() { - Layoutable.AffectsMeasure(IsVisibleProperty); - Layoutable.AffectsMeasure(WidthProperty); - Layoutable.AffectsMeasure(HeightProperty); - Layoutable.AffectsMeasure(MinWidthProperty); - Layoutable.AffectsMeasure(MaxWidthProperty); - Layoutable.AffectsMeasure(MinHeightProperty); - Layoutable.AffectsMeasure(MaxHeightProperty); - Layoutable.AffectsMeasure(MarginProperty); - Layoutable.AffectsMeasure(HorizontalAlignmentProperty); - Layoutable.AffectsMeasure(VerticalAlignmentProperty); + Layoutable.AffectsMeasure(Visual.IsVisibleProperty); + Layoutable.AffectsMeasure(Layoutable.WidthProperty); + Layoutable.AffectsMeasure(Layoutable.HeightProperty); + Layoutable.AffectsMeasure(Layoutable.MinWidthProperty); + Layoutable.AffectsMeasure(Layoutable.MaxWidthProperty); + Layoutable.AffectsMeasure(Layoutable.MinHeightProperty); + Layoutable.AffectsMeasure(Layoutable.MaxHeightProperty); + Layoutable.AffectsMeasure(Layoutable.MarginProperty); + Layoutable.AffectsMeasure(Layoutable.HorizontalAlignmentProperty); + Layoutable.AffectsMeasure(Layoutable.VerticalAlignmentProperty); } public double Width @@ -163,9 +163,6 @@ namespace Perspex.Layout get { return this.previousArrange; } } - public static int DebugMeasureCount { get; set; } - public static int DebugArrangeCount { get; set; } - public void Measure(Size availableSize, bool force = false) { if (double.IsNaN(availableSize.Width) || double.IsNaN(availableSize.Height)) @@ -175,8 +172,6 @@ namespace Perspex.Layout if (force || !this.IsMeasureValid || this.previousMeasure != availableSize) { - ++DebugMeasureCount; - this.IsMeasureValid = true; this.DesiredSize = this.MeasureCore(availableSize).Constrain(availableSize); this.previousMeasure = availableSize; @@ -205,8 +200,6 @@ namespace Perspex.Layout if (force || !this.IsArrangeValid || this.previousArrange != rect) { - ++DebugArrangeCount; - this.Log().Debug( "Arrange of {0} (#{1:x8}) gave {2} ", this.GetType().Name, @@ -376,7 +369,7 @@ namespace Perspex.Layout { child.Measure(availableSize); width = Math.Max(width, child.DesiredSize.Value.Width); - height= Math.Max(height, child.DesiredSize.Value.Height); + height = Math.Max(height, child.DesiredSize.Value.Height); } return new Size(width, height); @@ -402,6 +395,11 @@ namespace Perspex.Layout } } + private static bool IsResizable(ILayoutable control) + { + return double.IsNaN(control.Width) || double.IsNaN(control.Height); + } + private Tuple GetLayoutRoot() { var control = (IVisual)this; @@ -415,10 +413,5 @@ namespace Perspex.Layout return control != null ? Tuple.Create((ILayoutRoot)control, distance) : null; } - - private static bool IsResizable(ILayoutable control) - { - return double.IsNaN(control.Width) || double.IsNaN(control.Height); - } } } diff --git a/Perspex.Layout/Properties/AssemblyInfo.cs b/Perspex.Layout/Properties/AssemblyInfo.cs index c157837301..e7c7262ed9 100644 --- a/Perspex.Layout/Properties/AssemblyInfo.cs +++ b/Perspex.Layout/Properties/AssemblyInfo.cs @@ -1,7 +1,11 @@ -using System.Resources; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + 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 diff --git a/Perspex.SceneGraph/Media/Brushes.cs b/Perspex.SceneGraph/Media/Brushes.cs index 998a5f97d5..f7c2bd0eb5 100644 --- a/Perspex.SceneGraph/Media/Brushes.cs +++ b/Perspex.SceneGraph/Media/Brushes.cs @@ -157,145 +157,285 @@ namespace Perspex.Media } public static SolidColorBrush AliceBlue { get; private set; } + public static SolidColorBrush AntiqueWhite { get; private set; } + public static SolidColorBrush Aqua { get; private set; } + public static SolidColorBrush Aquamarine { get; private set; } + public static SolidColorBrush Azure { get; private set; } + public static SolidColorBrush Beige { get; private set; } + public static SolidColorBrush Bisque { get; private set; } + public static SolidColorBrush Black { get; private set; } + public static SolidColorBrush BlanchedAlmond { get; private set; } + public static SolidColorBrush Blue { get; private set; } + public static SolidColorBrush BlueViolet { get; private set; } + public static SolidColorBrush Brown { get; private set; } + public static SolidColorBrush BurlyWood { get; private set; } + public static SolidColorBrush CadetBlue { get; private set; } + public static SolidColorBrush Chartreuse { get; private set; } + public static SolidColorBrush Chocolate { get; private set; } + public static SolidColorBrush Coral { get; private set; } + public static SolidColorBrush CornflowerBlue { get; private set; } + public static SolidColorBrush Cornsilk { get; private set; } + public static SolidColorBrush Crimson { get; private set; } + public static SolidColorBrush Cyan { get; private set; } + public static SolidColorBrush DarkBlue { get; private set; } + public static SolidColorBrush DarkCyan { get; private set; } + public static SolidColorBrush DarkGoldenrod { get; private set; } + public static SolidColorBrush DarkGray { get; private set; } + public static SolidColorBrush DarkGreen { get; private set; } + public static SolidColorBrush DarkKhaki { get; private set; } + public static SolidColorBrush DarkMagenta { get; private set; } + public static SolidColorBrush DarkOliveGreen { get; private set; } + public static SolidColorBrush DarkOrange { get; private set; } + public static SolidColorBrush DarkOrchid { get; private set; } + public static SolidColorBrush DarkRed { get; private set; } + public static SolidColorBrush DarkSalmon { get; private set; } + public static SolidColorBrush DarkSeaGreen { get; private set; } + public static SolidColorBrush DarkSlateBlue { get; private set; } + public static SolidColorBrush DarkSlateGray { get; private set; } + public static SolidColorBrush DarkTurquoise { get; private set; } + public static SolidColorBrush DarkViolet { get; private set; } + public static SolidColorBrush DeepPink { get; private set; } + public static SolidColorBrush DeepSkyBlue { get; private set; } + public static SolidColorBrush DimGray { get; private set; } + public static SolidColorBrush DodgerBlue { get; private set; } + public static SolidColorBrush Firebrick { get; private set; } + public static SolidColorBrush FloralWhite { get; private set; } + public static SolidColorBrush ForestGreen { get; private set; } + public static SolidColorBrush Fuchsia { get; private set; } + public static SolidColorBrush Gainsboro { get; private set; } + public static SolidColorBrush GhostWhite { get; private set; } + public static SolidColorBrush Gold { get; private set; } + public static SolidColorBrush Goldenrod { get; private set; } + public static SolidColorBrush Gray { get; private set; } + public static SolidColorBrush Green { get; private set; } + public static SolidColorBrush GreenYellow { get; private set; } + public static SolidColorBrush Honeydew { get; private set; } + public static SolidColorBrush HotPink { get; private set; } + public static SolidColorBrush IndianRed { get; private set; } + public static SolidColorBrush Indigo { get; private set; } + public static SolidColorBrush Ivory { get; private set; } + public static SolidColorBrush Khaki { get; private set; } + public static SolidColorBrush Lavender { get; private set; } + public static SolidColorBrush LavenderBlush { get; private set; } + public static SolidColorBrush LawnGreen { get; private set; } + public static SolidColorBrush LemonChiffon { get; private set; } + public static SolidColorBrush LightBlue { get; private set; } + public static SolidColorBrush LightCoral { get; private set; } + public static SolidColorBrush LightCyan { get; private set; } + public static SolidColorBrush LightGoldenrodYellow { get; private set; } + public static SolidColorBrush LightGray { get; private set; } + public static SolidColorBrush LightGreen { get; private set; } + public static SolidColorBrush LightPink { get; private set; } + public static SolidColorBrush LightSalmon { get; private set; } + public static SolidColorBrush LightSeaGreen { get; private set; } + public static SolidColorBrush LightSkyBlue { get; private set; } + public static SolidColorBrush LightSlateGray { get; private set; } + public static SolidColorBrush LightSteelBlue { get; private set; } + public static SolidColorBrush LightYellow { get; private set; } + public static SolidColorBrush Lime { get; private set; } + public static SolidColorBrush LimeGreen { get; private set; } + public static SolidColorBrush Linen { get; private set; } + public static SolidColorBrush Magenta { get; private set; } + public static SolidColorBrush Maroon { get; private set; } + public static SolidColorBrush MediumAquamarine { get; private set; } + public static SolidColorBrush MediumBlue { get; private set; } + public static SolidColorBrush MediumOrchid { get; private set; } + public static SolidColorBrush MediumPurple { get; private set; } + public static SolidColorBrush MediumSeaGreen { get; private set; } + public static SolidColorBrush MediumSlateBlue { get; private set; } + public static SolidColorBrush MediumSpringGreen { get; private set; } + public static SolidColorBrush MediumTurquoise { get; private set; } + public static SolidColorBrush MediumVioletRed { get; private set; } + public static SolidColorBrush MidnightBlue { get; private set; } + public static SolidColorBrush MintCream { get; private set; } + public static SolidColorBrush MistyRose { get; private set; } + public static SolidColorBrush Moccasin { get; private set; } + public static SolidColorBrush NavajoWhite { get; private set; } + public static SolidColorBrush Navy { get; private set; } + public static SolidColorBrush OldLace { get; private set; } + public static SolidColorBrush Olive { get; private set; } + public static SolidColorBrush OliveDrab { get; private set; } + public static SolidColorBrush Orange { get; private set; } + public static SolidColorBrush OrangeRed { get; private set; } + public static SolidColorBrush Orchid { get; private set; } + public static SolidColorBrush PaleGoldenrod { get; private set; } + public static SolidColorBrush PaleGreen { get; private set; } + public static SolidColorBrush PaleTurquoise { get; private set; } + public static SolidColorBrush PaleVioletRed { get; private set; } + public static SolidColorBrush PapayaWhip { get; private set; } + public static SolidColorBrush PeachPuff { get; private set; } + public static SolidColorBrush Peru { get; private set; } + public static SolidColorBrush Pink { get; private set; } + public static SolidColorBrush Plum { get; private set; } + public static SolidColorBrush PowderBlue { get; private set; } + public static SolidColorBrush Purple { get; private set; } + public static SolidColorBrush Red { get; private set; } + public static SolidColorBrush RosyBrown { get; private set; } + public static SolidColorBrush RoyalBlue { get; private set; } + public static SolidColorBrush SaddleBrown { get; private set; } + public static SolidColorBrush Salmon { get; private set; } + public static SolidColorBrush SandyBrown { get; private set; } + public static SolidColorBrush SeaGreen { get; private set; } + public static SolidColorBrush SeaShell { get; private set; } + public static SolidColorBrush Sienna { get; private set; } + public static SolidColorBrush Silver { get; private set; } + public static SolidColorBrush SkyBlue { get; private set; } + public static SolidColorBrush SlateBlue { get; private set; } + public static SolidColorBrush SlateGray { get; private set; } + public static SolidColorBrush Snow { get; private set; } + public static SolidColorBrush SpringGreen { get; private set; } + public static SolidColorBrush SteelBlue { get; private set; } + public static SolidColorBrush Tan { get; private set; } + public static SolidColorBrush Teal { get; private set; } + public static SolidColorBrush Thistle { get; private set; } + public static SolidColorBrush Tomato { get; private set; } + public static SolidColorBrush Transparent { get; private set; } + public static SolidColorBrush Turquoise { get; private set; } + public static SolidColorBrush Violet { get; private set; } + public static SolidColorBrush Wheat { get; private set; } + public static SolidColorBrush White { get; private set; } + public static SolidColorBrush WhiteSmoke { get; private set; } + public static SolidColorBrush Yellow { get; private set; } + public static SolidColorBrush YellowGreen { get; private set; } } } diff --git a/Perspex.SceneGraph/Media/ITransform.cs b/Perspex.SceneGraph/Media/ITransform.cs index 9d6e89967b..198c0c1392 100644 --- a/Perspex.SceneGraph/Media/ITransform.cs +++ b/Perspex.SceneGraph/Media/ITransform.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.SceneGraph/Origin.cs b/Perspex.SceneGraph/Origin.cs index b4de4562fb..b1614d725f 100644 --- a/Perspex.SceneGraph/Origin.cs +++ b/Perspex.SceneGraph/Origin.cs @@ -47,8 +47,8 @@ namespace Perspex public Point ToPixels(Size size) { return this.unit == OriginUnit.Pixels ? - point : - new Point(point.X * size.Width, point.Y * size.Height); + this.point : + new Point(this.point.X * size.Width, this.point.Y * size.Height); } } } diff --git a/Perspex.SceneGraph/Platform/IPlatformRenderInterface.cs b/Perspex.SceneGraph/Platform/IPlatformRenderInterface.cs index b5ade8f65e..30b7c82d0e 100644 --- a/Perspex.SceneGraph/Platform/IPlatformRenderInterface.cs +++ b/Perspex.SceneGraph/Platform/IPlatformRenderInterface.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.SceneGraph/Properties/AssemblyInfo.cs b/Perspex.SceneGraph/Properties/AssemblyInfo.cs index 166873c93d..7f7c0cd8e6 100644 --- a/Perspex.SceneGraph/Properties/AssemblyInfo.cs +++ b/Perspex.SceneGraph/Properties/AssemblyInfo.cs @@ -1,7 +1,11 @@ -using System.Resources; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + 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 diff --git a/Perspex.SceneGraph/Rect.cs b/Perspex.SceneGraph/Rect.cs index 3ab160bace..3c4b07875c 100644 --- a/Perspex.SceneGraph/Rect.cs +++ b/Perspex.SceneGraph/Rect.cs @@ -215,8 +215,8 @@ namespace Perspex public static Rect operator *(Rect rect, Vector scale) { - double centerX = rect.x + rect.width / 2; - double centerY = rect.y + rect.height / 2; + double centerX = rect.x + (rect.width / 2); + double centerY = rect.y + (rect.height / 2); double width = rect.width * scale.X; double height = rect.height * scale.Y; return new Rect( @@ -228,8 +228,8 @@ namespace Perspex public static Rect operator /(Rect rect, Vector scale) { - double centerX = rect.x + rect.width / 2; - double centerY = rect.y + rect.height / 2; + double centerX = rect.x + (rect.width / 2); + double centerY = rect.y + (rect.height / 2); double width = rect.width / scale.X; double height = rect.height / scale.Y; return new Rect( diff --git a/Perspex.SceneGraph/Rendering/IRenderRoot.cs b/Perspex.SceneGraph/Rendering/IRenderRoot.cs index 154e8d0b3c..647b3afc1c 100644 --- a/Perspex.SceneGraph/Rendering/IRenderRoot.cs +++ b/Perspex.SceneGraph/Rendering/IRenderRoot.cs @@ -1,5 +1,5 @@ // ----------------------------------------------------------------------- -// +// // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- diff --git a/Perspex.SceneGraph/Visual.cs b/Perspex.SceneGraph/Visual.cs index 18d8ec4ff6..cad7f46381 100644 --- a/Perspex.SceneGraph/Visual.cs +++ b/Perspex.SceneGraph/Visual.cs @@ -42,7 +42,7 @@ namespace Perspex public Visual() { this.visualChildren = new PerspexList(); - this.visualChildren.CollectionChanged += VisualChildrenChanged; + this.visualChildren.CollectionChanged += this.VisualChildrenChanged; } public bool IsVisible @@ -215,6 +215,7 @@ namespace Perspex v.InheritanceParent = this; v.SetVisualParent(this); } + break; case NotifyCollectionChangedAction.Remove: @@ -223,6 +224,7 @@ namespace Perspex v.InheritanceParent = null; v.SetVisualParent(null); } + break; } } diff --git a/Perspex.Styling/Properties/AssemblyInfo.cs b/Perspex.Styling/Properties/AssemblyInfo.cs index 32d016e868..dac22c3495 100644 --- a/Perspex.Styling/Properties/AssemblyInfo.cs +++ b/Perspex.Styling/Properties/AssemblyInfo.cs @@ -1,7 +1,11 @@ -using System.Resources; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + 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 diff --git a/Windows/Perspex.Direct2D1/Properties/AssemblyInfo.cs b/Windows/Perspex.Direct2D1/Properties/AssemblyInfo.cs index 76d8cce9ff..b06e061b65 100644 --- a/Windows/Perspex.Direct2D1/Properties/AssemblyInfo.cs +++ b/Windows/Perspex.Direct2D1/Properties/AssemblyInfo.cs @@ -1,4 +1,10 @@ -using System.Reflection; +// ----------------------------------------------------------------------- +// +// Copyright 2014 MIT Licence. See licence.md for more information. +// +// ----------------------------------------------------------------------- + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices;