Exemplo n.º 1
0
 // 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;
 }
Exemplo n.º 2
0
 public SuperMegaPrinterMachine(
     IPrinter printer,
     IScan scanner,
     IStaple stapler,
     IFax fax,
     ICopy copier)
 {
     _printer = printer;
     _scanner = scanner;
     _stapler = stapler;
     _fax = fax;
     _copier = copier;
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 5
0
        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;
        }
Exemplo n.º 6
0
 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;
 }
Exemplo n.º 8
0
 public MultiFunctionMachine(IPrinter printer, IScanner scanner, IFax fax)
 {
     _printer = printer;
     _scanner = scanner;
     _fax     = fax;
 }
Exemplo n.º 9
0
 public void setIFax(IFax ifax)
 {
     this.ifax = ifax;
 }
 public MultiFunctionalDevice(IPrinter printer, IScanner scanner, IFax fax) : base(printer, scanner)
 {
     this._fax = fax;
 }
Exemplo n.º 11
0
 public void Fax(IFax printer)
 {
     printer.Fax(this);
 }