Browse Source

Use consistent naming in base collections.

pull/39/head
Steven Kirk 11 years ago
parent
commit
f013760ce5
  1. 2
      Perspex.Base/Collections/IPerspexList.cs
  2. 2
      Perspex.Base/Collections/IPerspexReadOnlyList.cs
  3. 4
      Perspex.Base/Collections/PerspexListExtensions.cs
  4. 16
      Perspex.Base/Collections/PerspexReadOnlyListView.cs
  5. 10
      Perspex.Base/Collections/PerspexSingleItemList.cs
  6. 4
      Perspex.Base/Perspex.Base.csproj
  7. 2
      Perspex.Controls/ContentControl.cs
  8. 4
      Perspex.Controls/Control.cs
  9. 4
      Perspex.Controls/Decorator.cs
  10. 2
      Perspex.Controls/DropDown.cs
  11. 2
      Perspex.Controls/ItemsControl.cs
  12. 2
      Perspex.Controls/Panel.cs
  13. 4
      Perspex.Controls/Presenters/ContentPresenter.cs
  14. 2
      Perspex.Controls/TabControl.cs
  15. 2
      Perspex.SceneGraph/ILogical.cs
  16. 2
      Perspex.SceneGraph/IVisual.cs
  17. 2
      Perspex.SceneGraph/Visual.cs
  18. 2
      Tests/Perspex.Styling.UnitTests/SelectorTests_Descendent.cs

2
Perspex.Base/Collections/IPerspexList.cs

@ -9,7 +9,7 @@ namespace Perspex.Collections
using System.Collections;
using System.Collections.Generic;
public interface IPerspexList<T> : IList<T>, IList, IReadOnlyPerspexList<T>
public interface IPerspexList<T> : IList<T>, IList, IPerspexReadOnlyList<T>
{
}
}

2
Perspex.Base/Collections/IReadOnlyPerspexList.cs → Perspex.Base/Collections/IPerspexReadOnlyList.cs

@ -10,7 +10,7 @@ namespace Perspex.Collections
using System.Collections.Specialized;
using System.ComponentModel;
public interface IReadOnlyPerspexList<out T> : IReadOnlyList<T>, INotifyCollectionChanged, INotifyPropertyChanged
public interface IPerspexReadOnlyList<out T> : IReadOnlyList<T>, INotifyCollectionChanged, INotifyPropertyChanged
{
}
}

4
Perspex.Base/Collections/PerspexListExtensions.cs

@ -15,7 +15,7 @@ namespace Perspex.Collections
public static class PerspexListExtensions
{
public static IDisposable ForEachItem<T>(
this IReadOnlyPerspexList<T> collection,
this IPerspexReadOnlyList<T> collection,
Action<T> added,
Action<T> removed)
{
@ -65,7 +65,7 @@ namespace Perspex.Collections
}
public static IDisposable TrackItemPropertyChanged<T>(
this IReadOnlyPerspexList<T> collection,
this IPerspexReadOnlyList<T> collection,
Action<Tuple<object, PropertyChangedEventArgs>> callback)
{
List<INotifyPropertyChanged> tracked = new List<INotifyPropertyChanged>();

16
Perspex.Base/Collections/PerspexReadOnlyListView.cs

@ -13,16 +13,16 @@ namespace Perspex.Collections
using System.ComponentModel;
using System.Linq;
public class PerspexReadOnlyListView<T> : IReadOnlyPerspexList<T>, IDisposable
public class PerspexReadOnlyListView<T> : IPerspexReadOnlyList<T>, IDisposable
{
private IReadOnlyPerspexList<T> source;
private IPerspexReadOnlyList<T> source;
public PerspexReadOnlyListView()
: this(null)
{
}
public PerspexReadOnlyListView(IReadOnlyPerspexList<T> source)
public PerspexReadOnlyListView(IPerspexReadOnlyList<T> source)
{
this.source = source;
@ -42,7 +42,7 @@ namespace Perspex.Collections
get { return this.source.Count; }
}
public IReadOnlyPerspexList<T> Source
public IPerspexReadOnlyList<T> Source
{
get
{
@ -141,9 +141,9 @@ namespace Perspex.Collections
}
}
public class PerspexReadOnlyListView<TIn, TOut> : IReadOnlyPerspexList<TOut>, IDisposable
public class PerspexReadOnlyListView<TIn, TOut> : IPerspexReadOnlyList<TOut>, IDisposable
{
private IReadOnlyPerspexList<TIn> source;
private IPerspexReadOnlyList<TIn> source;
private Func<TIn, TOut> convert;
@ -152,7 +152,7 @@ namespace Perspex.Collections
{
}
public PerspexReadOnlyListView(IReadOnlyPerspexList<TIn> source, Func<TIn, TOut> convert)
public PerspexReadOnlyListView(IPerspexReadOnlyList<TIn> source, Func<TIn, TOut> convert)
{
this.source = source;
this.convert = convert;
@ -178,7 +178,7 @@ namespace Perspex.Collections
get { return this.source.Count; }
}
public IReadOnlyPerspexList<TIn> Source
public IPerspexReadOnlyList<TIn> Source
{
get
{

10
Perspex.Base/Collections/SingleItemPerspexList.cs → Perspex.Base/Collections/PerspexSingleItemList.cs

@ -14,24 +14,24 @@ namespace Perspex.Collections
using System.Linq;
/// <summary>
/// Implements the <see cref="IReadOnlyPerspexList{T}"/> interface for single items.
/// Implements the <see cref="IPerspexReadOnlyList{T}"/> interface for single items.
/// </summary>
/// <typeparam name="T">The type of the single item.</typeparam>
/// <remarks>
/// Classes such as Border can only ever have a single logical child, but they need to
/// implement a list of logical children in their ILogical.LogicalChildren property using the
/// <see cref="IReadOnlyPerspexList{T}"/> interface. This class facilitates that
/// <see cref="IPerspexReadOnlyList{T}"/> interface. This class facilitates that
/// without creating an actual <see cref="PerspexList{T}"/>.
/// </remarks>
public class SingleItemPerspexList<T> : IReadOnlyPerspexList<T> where T : class
public class PerspexSingleItemList<T> : IPerspexReadOnlyList<T> where T : class
{
private T item;
public SingleItemPerspexList()
public PerspexSingleItemList()
{
}
public SingleItemPerspexList(T item)
public PerspexSingleItemList(T item)
{
this.item = item;
}

4
Perspex.Base/Perspex.Base.csproj

@ -38,13 +38,13 @@
<Compile Include="Collections\IPerspexList.cs" />
<Compile Include="Collections\PerspexReadOnlyListView.cs" />
<Compile Include="Collections\PerspexList.cs" />
<Compile Include="Collections\SingleItemPerspexList.cs" />
<Compile Include="Collections\PerspexSingleItemList.cs" />
<Compile Include="Contract.cs" />
<Compile Include="Diagnostics\PerspexPropertyValue.cs" />
<Compile Include="IDescription.cs" />
<Compile Include="Collections\PerspexListExtensions.cs" />
<Compile Include="IObservableDescription.cs" />
<Compile Include="Collections\IReadOnlyPerspexList.cs" />
<Compile Include="Collections\IPerspexReadOnlyList.cs" />
<Compile Include="PerspexObject.cs" />
<Compile Include="PerspexProperty.cs" />
<Compile Include="PerspexPropertyChangedEventArgs.cs" />

2
Perspex.Controls/ContentControl.cs

@ -49,7 +49,7 @@ namespace Perspex.Controls
set { this.SetValue(VerticalContentAlignmentProperty, value); }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return this.logicalChildren; }
}

4
Perspex.Controls/Control.cs

@ -32,7 +32,7 @@ namespace Perspex.Controls
public static readonly RoutedEvent<RequestBringIntoViewEventArgs> RequestBringIntoViewEvent =
RoutedEvent.Register<Control, RequestBringIntoViewEventArgs>("RequestBringIntoView", RoutingStrategy.Bubble);
private static readonly IReadOnlyPerspexList<ILogical> EmptyChildren = new SingleItemPerspexList<ILogical>();
private static readonly IPerspexReadOnlyList<ILogical> EmptyChildren = new PerspexSingleItemList<ILogical>();
private Classes classes = new Classes();
@ -149,7 +149,7 @@ namespace Perspex.Controls
get { return this.Parent; }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return EmptyChildren; }
}

4
Perspex.Controls/Decorator.cs

@ -21,7 +21,7 @@ namespace Perspex.Controls
public static readonly PerspexProperty<Thickness> PaddingProperty =
PerspexProperty.Register<Decorator, Thickness>("Padding");
private SingleItemPerspexList<ILogical> logicalChild = new SingleItemPerspexList<ILogical>();
private PerspexSingleItemList<ILogical> logicalChild = new PerspexSingleItemList<ILogical>();
public Decorator()
{
@ -55,7 +55,7 @@ namespace Perspex.Controls
set { this.SetValue(PaddingProperty, value); }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return this.logicalChild; }
}

2
Perspex.Controls/DropDown.cs

@ -59,7 +59,7 @@ namespace Perspex.Controls
set { this.SetValue(IsDropDownOpenProperty, value); }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return this.logicalChildren; }
}

2
Perspex.Controls/ItemsControl.cs

@ -67,7 +67,7 @@ namespace Perspex.Controls
set { this.SetValue(ItemsPanelProperty, value); }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get
{

2
Perspex.Controls/Panel.cs

@ -65,7 +65,7 @@ namespace Perspex.Controls
}
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return this.children; }
}

4
Perspex.Controls/Presenters/ContentPresenter.cs

@ -21,7 +21,7 @@ namespace Perspex.Controls.Presenters
private bool createdChild;
private SingleItemPerspexList<ILogical> logicalChild = new SingleItemPerspexList<ILogical>();
private PerspexSingleItemList<ILogical> logicalChild = new PerspexSingleItemList<ILogical>();
public ContentPresenter()
{
@ -39,7 +39,7 @@ namespace Perspex.Controls.Presenters
set { this.SetValue(ContentProperty, value); }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return this.logicalChild; }
}

2
Perspex.Controls/TabControl.cs

@ -50,7 +50,7 @@ namespace Perspex.Controls
set { this.SetValue(SelectedTabProperty, value); }
}
IReadOnlyPerspexList<ILogical> ILogical.LogicalChildren
IPerspexReadOnlyList<ILogical> ILogical.LogicalChildren
{
get { return this.logicalChildren; }
}

2
Perspex.SceneGraph/ILogical.cs

@ -21,6 +21,6 @@ namespace Perspex
/// <summary>
/// Gets the logical children.
/// </summary>
IReadOnlyPerspexList<ILogical> LogicalChildren { get; }
IPerspexReadOnlyList<ILogical> LogicalChildren { get; }
}
}

2
Perspex.SceneGraph/IVisual.cs

@ -56,7 +56,7 @@ namespace Perspex
/// <summary>
/// Gets the scene graph node's child nodes.
/// </summary>
IReadOnlyPerspexList<IVisual> VisualChildren { get; }
IPerspexReadOnlyList<IVisual> VisualChildren { get; }
/// <summary>
/// Gets the scene graph node's parent node.

2
Perspex.SceneGraph/Visual.cs

@ -89,7 +89,7 @@ namespace Perspex
get { return this.bounds; }
}
IReadOnlyPerspexList<IVisual> IVisual.VisualChildren
IPerspexReadOnlyList<IVisual> IVisual.VisualChildren
{
get { return this.visualChildren; }
}

2
Tests/Perspex.Styling.UnitTests/SelectorTests_Descendent.cs

@ -88,7 +88,7 @@ namespace Perspex.Styling.UnitTests
{
public abstract Classes Classes { get; }
public abstract string Id { get; }
public abstract IReadOnlyPerspexList<ILogical> LogicalChildren { get; }
public abstract IPerspexReadOnlyList<ILogical> LogicalChildren { get; }
public abstract ILogical LogicalParent { get; }
public abstract ITemplatedControl TemplatedParent { get; }
public abstract IDisposable Bind(PerspexProperty property, IObservable<object> source, BindingPriority priority = BindingPriority.LocalValue);

Loading…
Cancel
Save