Browse Source

More documentation.

pull/72/merge
Steven Kirk 11 years ago
parent
commit
5fca1066da
  1. 18
      Perspex.Base/Collections/IPerspexList.cs
  2. 4
      Perspex.Base/Collections/IPerspexReadOnlyList.cs
  3. 20
      Perspex.Base/Platform/PlatformHandle.cs
  4. 13
      Perspex.Base/Reactive/PerspexObservable.cs

18
Perspex.Base/Collections/IPerspexList.cs

@ -6,15 +6,31 @@
namespace Perspex.Collections
{
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// A notiftying list.
/// </summary>
/// <typeparam name="T">The type of the items in the list.</typeparam>
public interface IPerspexList<T> : IList<T>, IPerspexReadOnlyList<T>
{
/// <summary>
/// Adds multiple items to the collection.
/// </summary>
/// <param name="items">The items.</param>
void AddRange(IEnumerable<T> items);
/// <summary>
/// Inserts multiple items at the specified index.
/// </summary>
/// <param name="index">The index.</param>
/// <param name="items">The items.</param>
void InsertRange(int index, IEnumerable<T> items);
/// <summary>
/// Removes multiple items from the collection.
/// </summary>
/// <param name="items">The items.</param>
void RemoveAll(IEnumerable<T> items);
}
}

4
Perspex.Base/Collections/IPerspexReadOnlyList.cs

@ -10,6 +10,10 @@ namespace Perspex.Collections
using System.Collections.Specialized;
using System.ComponentModel;
/// <summary>
/// A read-only notiftying list.
/// </summary>
/// <typeparam name="T">The type of the items in the list.</typeparam>
public interface IPerspexReadOnlyList<out T> : IReadOnlyList<T>, INotifyCollectionChanged, INotifyPropertyChanged
{
}

20
Perspex.Base/Platform/PlatformHandle.cs

@ -8,16 +8,32 @@ namespace Perspex.Platform
{
using System;
/// <summary>
/// Represents a platform-specific handle.
/// </summary>
public class PlatformHandle : IPlatformHandle
{
/// <summary>
/// Initializes a new instance of the <see cref="PlatformHandle"/> class.
/// </summary>
/// <param name="handle">The handle.</param>
/// <param name="descriptor">
/// An optional string that describes what <paramref name="handle"/> represents.
/// </param>
public PlatformHandle(IntPtr handle, string descriptor)
{
this.Handle = handle;
this.HandleDescriptor = descriptor;
}
public IntPtr Handle { get; private set; }
/// <summary>
/// Gets the handle.
/// </summary>
public IntPtr Handle { get; }
public string HandleDescriptor { get; private set; }
/// <summary>
/// Gets an optional string that describes what <see cref="Handle"/> represents.
/// </summary>
public string HandleDescriptor { get; }
}
}

13
Perspex.Base/Reactive/PerspexObservable.cs

@ -10,10 +10,19 @@ namespace Perspex.Reactive
using System.Reactive;
using System.Reactive.Disposables;
/// <summary>
/// An <see cref="IObservable{T}"/> with an additional description.
/// </summary>
/// <typeparam name="T">The type of the elements in the sequence.</typeparam>
public sealed class PerspexObservable<T> : ObservableBase<T>, IDescription
{
private readonly Func<IObserver<T>, IDisposable> subscribe;
/// <summary>
/// Initializes a new instance of the <see cref="PerspexObservable{T}"/> class.
/// </summary>
/// <param name="subscribe">The subscribe function.</param>
/// <param name="description">The description of the observable.</param>
public PerspexObservable(Func<IObserver<T>, IDisposable> subscribe, string description)
{
if (subscribe == null)
@ -25,8 +34,12 @@ namespace Perspex.Reactive
this.Description = description;
}
/// <summary>
/// Gets the description of the observable.
/// </summary>
public string Description { get; }
/// <inheritdoc/>
protected override IDisposable SubscribeCore(IObserver<T> observer)
{
return this.subscribe(observer) ?? Disposable.Empty;

Loading…
Cancel
Save