public DifferentConstructors(IFirstInterface firstInterface, ISecondInterface secondInterface) { if(firstInterface == null) throw new ArgumentNullException("firstInterface"); if(secondInterface == null) throw new ArgumentNullException("secondInterface"); this._firstInterface = firstInterface; this._secondInterface = secondInterface; }
public void Handle(ISecondInterface message) { SecondMessageHandled = true; PossiblyRaiseEvent(); }
public DifferentConstructors(ISecondInterface secondInterface) : this(FirstClass.Instance, secondInterface) { }
public MoreComplicatedClassThatCantBeFullySatisfied(ISecondInterface paramOne, IFourthInterfaceActuallyDoesntHaveAnyDerivedClasses two) { ParamOne = paramOne; Two = two; }
/// <summary> /// Initializes a new instance of the <see cref="ParentWithMultiInterfaceClass"/> class. /// </summary> /// <param name="firstInterface">The first interface.</param> /// <param name="secondInterface">The second interface.</param> public ParentWithMultiInterfaceClass(IFirstInterface firstInterface, ISecondInterface secondInterface) { this.FirstInterface = firstInterface; this.SecondInterface = secondInterface; }
static void Bar(ISecondInterface secondInterface) // Передаём параметром обьект типа данных ISecondInterface { secondInterface.Action(); // Вызываем метод Action() у обьекта типа ISecondInterface }