Declaring a Generic Interface, Implementing a Generic Interface : Generic Interface « Generic « C# / CSharp Tutorial






interface IPair<T>
{
    T First
    {
        get;
        set;
    }

    T Second
    {
        get;
        set;
    }
}
public struct Pair<T>: IPair<T>
{
    public T First
    {
        get
        {
            return _First;
        }
        set
        {
            _First = value;
        }
    }
    private T _First;

    public T Second
    {
        get
        {
            return _Second;
        }
        set
        {
            _Second = value;
        }
    }
    private T _Second;
}








18.17.Generic Interface
18.17.1.Generic Interface
18.17.2.Implement multiple generic interfaces by a non-generic class
18.17.3.Generic IEquatable
18.17.4.Declaring a Generic Interface, Implementing a Generic Interface
18.17.5.Declaring a Generic with Multiple Type Parameters
18.17.6.Generic Interface for binary operation