Access Modifiers - C# Reference | Microsoft Docs
interface - C# Reference | Microsoft Docs
I am going to try to see if I can provide some insight based on my understanding, I am making some assumptions here. You mention interface having an affect on your internal constructor.
So here is my unsolicited input:
Interface - An interface has no bearing on how a class implements its constructor(s), it is just a contract for what the class should posses, that is, members, events, and/or the methods, not the constructors; this is different than an abstract class.
Internal - This is a modifier that sets the visibility of a class in an assembly to be instantiable only within that assembly
public delegate void SampleGpioPinValueChangedEventHandler(object sender, EventArgs e);
//Sample interface
public interface ISample
{
public string Property { get; }
public void Method();
public event SampleGpioPinValueChangedEventHandler SampleEvent; //Must be a delegate
}
//valid - default constructor (public)
public class SampleClass : ISample
{
public string Property => throw new NotImplementedException();
public event SampleGpioPinValueChangedEventHandler SampleEvent;
public void Method()
{
throw new NotImplementedException();
}
}
//Valid - internal constructor, class can only be instantiated within the same assembly
public class SampleClass : ISample
{
internal SampleClass(){
}
public string Property => throw new NotImplementedException();
public event SampleGpioPinValueChangedEventHandler SampleEvent;
public void Method()
{
throw new NotImplementedException();
}
}
//Valid - private constructor normally used when when creating a singleton
public class SampleClass : ISample
{
private SampleClass(){}
public string Property => throw new NotImplementedException();
public event SampleGpioPinValueChangedEventHandler SampleEvent;
public void Method()
{
throw new NotImplementedException();
}
}
What you submitted on Gitub is not a bug
```
public sealed class GpioPinValueChangedEventArgs : EventArgs
{
public GpioPinEdge Edge { get; }
public DateTime Timestamp { get; }
internal GpioPinValueChangedEventArgs(GpioPinEdge edge, DateTime timestamp)
{
this.Edge = edge;
this.Timestamp = timestamp;
}
}
```
Here, you are inheriting from a class and not an interface, in your case EventArgs. Inheritance is a topic too large to discuss in a forum.
Inheritance in C# | Microsoft Docs
Edited: The reason you had to set the constructor of your GpioPinValueChangedEventArgs class to public is because the EventArgs class has public constructor(s).
//EventArgs definition, not actual implementation
[ComVisible(true)]
public class EventArgs
{
...
public EventArgs();
}