Skip to main content

Create Implementer (Explicit) (C#)

Creates a class explicitly implementing a current interface. Selects the contents of the last generated implementor member and drops the marker onto the interface declaration.

#Notes

  • This code provider is similar to Create Implementer (Implicit) (C#). The difference is that Create Implementer (Explicit) (C#) includes interface references in declarations of implementer class members.

#Availability

From the context menus or via shortcuts:

  • when the edit cursor or caret is on an interface name within an interface declaration.

#Example

interface IMyInterface
{
    int TestMethod1(int a);
    string TestMethod2(string a);
}

Result:

private class IMyInterfaceImplementer : IMyInterface
{
    public IMyInterfaceImplementer()
    {
        throw new NotImplementedException();
    }
    public int IMyInterface.TestMethod1(int a)
    {
        throw new NotImplementedException();
    }
    public string IMyInterface.TestMethod2(string a)
    {throw new NotImplementedException();
    }
}
interface IMyInterface
{
    int TestMethod1(int a);
    string TestMethod2(string a);
}