Browse Source
Ported from ideas branch. Also includes beginnings of INameScope support, though nothing implements this interface yet.pull/63/head
12 changed files with 161 additions and 16 deletions
@ -0,0 +1,40 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="INameScope.cs" company="Steven Kirk">
|
|||
// Copyright 2015 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Defines the interface for object which define a name scope.
|
|||
/// </summary>
|
|||
public interface INameScope |
|||
{ |
|||
/// <summary>
|
|||
/// Returns an object tha thas the requested name.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the object.</param>
|
|||
/// <returns>The named object or null if the named object was not found.</returns>
|
|||
object FindName(string name); |
|||
|
|||
/// <summary>
|
|||
/// Registers an object with the specified name in the name scope.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the object.</param>
|
|||
/// <param name="o">The object.</param>
|
|||
/// <exception cref="ArgumentException">
|
|||
/// An object with the same name has already been registered.
|
|||
/// </exception>
|
|||
void RegisterName(string name, object o); |
|||
|
|||
/// <summary>
|
|||
/// Unregisters the specified name in the name scope.
|
|||
/// </summary>
|
|||
/// <param name="name">The name of the object.</param>
|
|||
/// <exception cref="ArgumentException">
|
|||
/// The name does not exist in the name scope.
|
|||
/// </exception>
|
|||
void UnregisterName(string name); |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
// -----------------------------------------------------------------------
|
|||
// <copyright file="ISetLogicalParent.cs" company="Steven Kirk">
|
|||
// Copyright 2015 MIT Licence. See licence.md for more information.
|
|||
// </copyright>
|
|||
// -----------------------------------------------------------------------
|
|||
|
|||
namespace Perspex.Controls |
|||
{ |
|||
/// <summary>
|
|||
/// Defines an interface through which a <see cref="Control"/>'s logical parent can be set.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// You should not usually need to use this interface - it is for advanced scenarios only.
|
|||
/// </remarks>
|
|||
public interface ISetLogicalParent |
|||
{ |
|||
/// <summary>
|
|||
/// Sets the control's parent.
|
|||
/// </summary>
|
|||
/// <param name="parent">The parent.</param>
|
|||
void SetParent(IControl parent); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue