Files
linux-packaging-mono/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/IForeignData.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

36 lines
888 B
C#

using System;
using System.Reflection;
namespace MonoTests.SystemWeb.Framework {
/// <summary>
/// This interface is used to add foreign data to the implementing class
/// instances (similar to Python common practice) or AOP field injection.
/// </summary>
/// <remarks>
/// This is achieved by convention that every class <b>using</b> this interface
/// passes it's own type to the indexer property.
/// </remarks>
/// <example>
/// class IForeignDataUsingClass
/// {
/// public string getData (IForeignData fd)
/// {
/// return fd[this.GetType ()] as string;
/// }
/// }
/// </example>
public interface IForeignData
{
/// <summary>
/// Gets or sets the foreign data hold by the given instance.
/// </summary>
/// <param name="type">Type that wishes to inject a field.</param>
/// <returns></returns>
object this [Type type]
{
get;
set;
}
}
}