From dca0494a5e2149a7b31f301099306cdd16ccbb33 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 19 Dec 2014 15:03:30 +0100 Subject: [PATCH 1/2] Moved collections to their own namespace. --- Perspex.Animation/PropertyTransitions.cs | 2 ++ Perspex.Base/{ => Collections}/IReadOnlyPerspexList.cs | 2 +- Perspex.Base/{ => Collections}/PerspexList.cs | 2 +- Perspex.Base/{ => Collections}/PerspexListExtensions.cs | 2 +- Perspex.Base/Perspex.Base.csproj | 6 +++--- Perspex.Controls/ColumnDefinitions.cs | 2 ++ Perspex.Controls/Controls.cs | 1 + Perspex.Controls/DataTemplates.cs | 8 +------- Perspex.Controls/Grid.cs | 1 + Perspex.Controls/RowDefinitions.cs | 2 ++ Perspex.SceneGraph/IVisual.cs | 2 +- Perspex.SceneGraph/Visual.cs | 1 + Perspex.Styling/Styles.cs | 2 ++ TestApplication/Program.cs | 1 + 14 files changed, 20 insertions(+), 14 deletions(-) rename Perspex.Base/{ => Collections}/IReadOnlyPerspexList.cs (94%) rename Perspex.Base/{ => Collections}/PerspexList.cs (99%) rename Perspex.Base/{ => Collections}/PerspexListExtensions.cs (99%) diff --git a/Perspex.Animation/PropertyTransitions.cs b/Perspex.Animation/PropertyTransitions.cs index 9b578fc942..ff902d816d 100644 --- a/Perspex.Animation/PropertyTransitions.cs +++ b/Perspex.Animation/PropertyTransitions.cs @@ -6,6 +6,8 @@ namespace Perspex.Animation { + using Perspex.Collections; + public class PropertyTransitions : PerspexList { } diff --git a/Perspex.Base/IReadOnlyPerspexList.cs b/Perspex.Base/Collections/IReadOnlyPerspexList.cs similarity index 94% rename from Perspex.Base/IReadOnlyPerspexList.cs rename to Perspex.Base/Collections/IReadOnlyPerspexList.cs index 87b7074bd2..78b7e7392e 100644 --- a/Perspex.Base/IReadOnlyPerspexList.cs +++ b/Perspex.Base/Collections/IReadOnlyPerspexList.cs @@ -4,7 +4,7 @@ // // ----------------------------------------------------------------------- -namespace Perspex +namespace Perspex.Collections { using System.Collections.Generic; using System.Collections.Specialized; diff --git a/Perspex.Base/PerspexList.cs b/Perspex.Base/Collections/PerspexList.cs similarity index 99% rename from Perspex.Base/PerspexList.cs rename to Perspex.Base/Collections/PerspexList.cs index 13fa97801c..8107202560 100644 --- a/Perspex.Base/PerspexList.cs +++ b/Perspex.Base/Collections/PerspexList.cs @@ -4,7 +4,7 @@ // // ----------------------------------------------------------------------- -namespace Perspex +namespace Perspex.Collections { using System; using System.Collections; diff --git a/Perspex.Base/PerspexListExtensions.cs b/Perspex.Base/Collections/PerspexListExtensions.cs similarity index 99% rename from Perspex.Base/PerspexListExtensions.cs rename to Perspex.Base/Collections/PerspexListExtensions.cs index 13ee014d49..62c754f2b3 100644 --- a/Perspex.Base/PerspexListExtensions.cs +++ b/Perspex.Base/Collections/PerspexListExtensions.cs @@ -4,7 +4,7 @@ // // ----------------------------------------------------------------------- -namespace Perspex +namespace Perspex.Collections { using System; using System.Collections.Generic; diff --git a/Perspex.Base/Perspex.Base.csproj b/Perspex.Base/Perspex.Base.csproj index 715391fbfa..1f1414e13d 100644 --- a/Perspex.Base/Perspex.Base.csproj +++ b/Perspex.Base/Perspex.Base.csproj @@ -38,10 +38,10 @@ - + - - + + diff --git a/Perspex.Controls/ColumnDefinitions.cs b/Perspex.Controls/ColumnDefinitions.cs index 73656b8854..f8c9928eb8 100644 --- a/Perspex.Controls/ColumnDefinitions.cs +++ b/Perspex.Controls/ColumnDefinitions.cs @@ -6,6 +6,8 @@ namespace Perspex.Controls { + using Perspex.Collections; + public class ColumnDefinitions : PerspexList { } diff --git a/Perspex.Controls/Controls.cs b/Perspex.Controls/Controls.cs index 5214e59ade..353ecf03db 100644 --- a/Perspex.Controls/Controls.cs +++ b/Perspex.Controls/Controls.cs @@ -7,6 +7,7 @@ namespace Perspex.Controls { using System.Collections.Generic; + using Perspex.Collections; public class Controls : PerspexList { diff --git a/Perspex.Controls/DataTemplates.cs b/Perspex.Controls/DataTemplates.cs index 1f81fde90f..7de64339ed 100644 --- a/Perspex.Controls/DataTemplates.cs +++ b/Perspex.Controls/DataTemplates.cs @@ -6,13 +6,7 @@ namespace Perspex.Controls { - using System; - using System.Collections; - using System.Collections.Generic; - using System.Collections.Specialized; - using System.Linq; - using System.Reactive; - using System.Reactive.Subjects; + using Perspex.Collections; public class DataTemplates : PerspexList { diff --git a/Perspex.Controls/Grid.cs b/Perspex.Controls/Grid.cs index 789c4e06c7..b5e57cc178 100644 --- a/Perspex.Controls/Grid.cs +++ b/Perspex.Controls/Grid.cs @@ -9,6 +9,7 @@ namespace Perspex.Controls using System; using System.Collections.Generic; using System.Linq; + using Perspex.Collections; public class Grid : Panel { diff --git a/Perspex.Controls/RowDefinitions.cs b/Perspex.Controls/RowDefinitions.cs index 60ea0da556..7affaa019f 100644 --- a/Perspex.Controls/RowDefinitions.cs +++ b/Perspex.Controls/RowDefinitions.cs @@ -6,6 +6,8 @@ namespace Perspex.Controls { + using Perspex.Collections; + public class RowDefinitions : PerspexList { } diff --git a/Perspex.SceneGraph/IVisual.cs b/Perspex.SceneGraph/IVisual.cs index 12a1104864..72a38d1703 100644 --- a/Perspex.SceneGraph/IVisual.cs +++ b/Perspex.SceneGraph/IVisual.cs @@ -6,7 +6,7 @@ namespace Perspex { - using System.Collections.Generic; + using Perspex.Collections; using Perspex.Media; /// diff --git a/Perspex.SceneGraph/Visual.cs b/Perspex.SceneGraph/Visual.cs index 28eed3521f..2f9351fc12 100644 --- a/Perspex.SceneGraph/Visual.cs +++ b/Perspex.SceneGraph/Visual.cs @@ -12,6 +12,7 @@ namespace Perspex using System.Linq; using System.Reactive.Linq; using Perspex.Animation; + using Perspex.Collections; using Perspex.Media; using Perspex.Rendering; using Splat; diff --git a/Perspex.Styling/Styles.cs b/Perspex.Styling/Styles.cs index b6e1111b54..5e95978abe 100644 --- a/Perspex.Styling/Styles.cs +++ b/Perspex.Styling/Styles.cs @@ -6,6 +6,8 @@ namespace Perspex.Styling { + using Perspex.Collections; + public class Styles : PerspexList, IStyle { public void Attach(IStyleable control) diff --git a/TestApplication/Program.cs b/TestApplication/Program.cs index 297e244473..f3543bff94 100644 --- a/TestApplication/Program.cs +++ b/TestApplication/Program.cs @@ -2,6 +2,7 @@ using System.Reactive.Linq; using Perspex; using Perspex.Animation; +using Perspex.Collections; using Perspex.Controls; using Perspex.Controls.Primitives; using Perspex.Controls.Shapes; From 057d10823c94a31c96ba45fe5b01ff5cc96f6092 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Fri, 19 Dec 2014 15:03:50 +0100 Subject: [PATCH 2/2] Make IReadOnlyPerspexList covariant. --- Perspex.Base/Collections/IReadOnlyPerspexList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Perspex.Base/Collections/IReadOnlyPerspexList.cs b/Perspex.Base/Collections/IReadOnlyPerspexList.cs index 78b7e7392e..7329082f9f 100644 --- a/Perspex.Base/Collections/IReadOnlyPerspexList.cs +++ b/Perspex.Base/Collections/IReadOnlyPerspexList.cs @@ -10,7 +10,7 @@ namespace Perspex.Collections using System.Collections.Specialized; using System.ComponentModel; - public interface IReadOnlyPerspexList : IReadOnlyList, INotifyCollectionChanged, INotifyPropertyChanged + public interface IReadOnlyPerspexList : IReadOnlyList, INotifyCollectionChanged, INotifyPropertyChanged { } } \ No newline at end of file