// Notice how the dependencies are injected through constructor (constructor dependency injection) public Machine(IPrinter printer, IFax fax, IScan scan, IPhotoCopy photocopy, IStaple staple) { this.Printer = printer; this.Faxer = fax; this.Scanner = scan; this.Photocopy = photocopy; this.Stapler = staple; }
public SuperMegaPrinterMachine( IPrinter printer, IScan scanner, IStaple stapler, IFax fax, ICopy copier) { _printer = printer; _scanner = scanner; _stapler = stapler; _fax = fax; _copier = copier; }
public SuperMegaPrinterMachine( IPrinter printer, IScan scanner, IStaple stapler, IFax fax, ICopy copier) { _printer = printer; _scanner = scanner; _stapler = stapler; _fax = fax; _copier = copier; }
public MultiFunctionPrinter(IPrinter printer, IScanner scanner, IFax fax) { if (printer == null) { throw new ArgumentNullException(nameof(printer)); } _printer = printer; if (scanner == null) { throw new ArgumentNullException(nameof(scanner)); } _scanner = scanner; if (fax == null) { throw new ArgumentNullException(nameof(fax)); } _fax = fax; }
public MultiFunctionMachine(IPrinter printer, IScanner scanner, IFax fax) { if (printer == null) { throw new ArgumentNullException(paramName: nameof(printer)); } if (scanner == null) { throw new ArgumentNullException(paramName: nameof(scanner)); } if (fax == null) { throw new ArgumentNullException(paramName: nameof(fax)); } this.printer = printer; this.scanner = scanner; this.fax = fax; }
public MultifunctionPrinter(IPrinter printer, IScanner scanner, IFax fax) { this.printer = printer ?? throw new ArgumentNullException(paramName: nameof(printer)); this.scanner = scanner ?? throw new ArgumentNullException(paramName: nameof(scanner)); this.fax = fax ?? throw new ArgumentNullException(paramName: nameof(fax)); }
public MultiFunctionMachine(IPrinter printer, IScanner scanner, IFax fax) { this.printer = printer; this.scanner = scanner; this.fax = fax; }
public MultiFunctionMachine(IPrinter printer, IScanner scanner, IFax fax) { _printer = printer; _scanner = scanner; _fax = fax; }
public void setIFax(IFax ifax) { this.ifax = ifax; }
public MultiFunctionalDevice(IPrinter printer, IScanner scanner, IFax fax) : base(printer, scanner) { this._fax = fax; }
public void Fax(IFax printer) { printer.Fax(this); }