See code below. When a class has multiple partial definitions, the developer needs to declare the interfaces implemented by the class only once, not in every partial definition.

Makes sense.


using System;

namespace DemoPartialAndInterfaces
{
class Program
{
static void Main(string[] args)
{
}
}

interface IPowerPointAddin
{
void OperationA();
void OperationB();
}

partial class Addin
{
private void InternalOperationA()
{
return;
}
}

partial class Addin : IPowerPointAddin
{
#region Implementation of IPowerPointAddin

public void OperationA()
{
throw new NotImplementedException();
}

public void OperationB()
{
throw new NotImplementedException();
}

#endregion
}

}

Advertisements