public static void ExtendedPhotoPrint(this PhotoPrinter photoPrinter, Photo[] photos) { foreach (Photo ph in photos) { photoPrinter.Print(ph); } }
public static void Multiprint(this PhotoPrinter pprinter, string[] messages, string image) { foreach (string message in messages) { pprinter.Print(message, image); } }
public static void Print(this PhotoPrinter photoPrinter, Bitmap[] images) { foreach (var image in images) { photoPrinter.Print(image); } }
public static void PrintArrayOfPhotos(this PhotoPrinter photoPrinter, Image[] images) { foreach (Image image in images) { photoPrinter.Print(image); } }
static void Main(string[] args) { Printer printer = new Printer(); ColourPrinter colourPrinter = new ColourPrinter(); PhotoPrinter photoPrinter = new PhotoPrinter(); string[] strings = { "Message1", "Message2", "Message3" }; Image[] images = { new Image() { Name = "picture1.jpeg" }, new Image() { Name = "picture2.jpeg" }, new Image() { Name = "picture2.jpeg" } }; Console.WriteLine("Сalling a extension method of Printer!"); printer.Print(strings); Console.WriteLine("\nСalling a extension method of ColourPrinter!"); colourPrinter.Print(strings, ConsoleColor.DarkGreen); Console.WriteLine("\nСalling a extension method of PhotoPrinter!"); photoPrinter.Print(images); Console.ReadLine(); }
public static void ExtendPrint(this PhotoPrinter printer, Photo[] photos) { foreach (var photo in photos) { printer.Print(photo); } }
public static void Multiprint(this PhotoPrinter photoPrinter, Image[] images) { foreach (Image image in images) { photoPrinter.Print(image); } }
public static void PrintPhotoArray(this PhotoPrinter photoPrinter, params object[] photos) { foreach (var photo in photos) { photoPrinter.Print(photo); } }
static void Main(string[] args) { Printer printer = new Printer(); ColourPrinter colourPrinter = new ColourPrinter(); PhotoPrinter photoPrinter = new PhotoPrinter(); printer.Print("My printer"); colourPrinter.Print("A1", Colour.Green); photoPrinter.Print("A1", Images.Sumssung); Printer[] prArr = new Printer[10]; prArr.HandleArrayPrinter(); ColourPrinter [] cprArr = new ColourPrinter[2]; cprArr.HandleArrayColourPrinter(); PhotoPrinter[] phprArr = new PhotoPrinter[7]; phprArr.HandleArrayPhotoPrinter(); Console.ReadKey(); }
static void Main(string[] args) { var stringsToDisplay = new [] { "Some information to display", "Another information to display" }; Console.WriteLine("The printer prints information..."); var printer = new Printer(); printer.Print(stringsToDisplay); Console.WriteLine(); var colorStrings = new ColorString[] { new ColorString("Some information to display", ConsoleColor.Yellow), new ColorString("Another information to display", ConsoleColor.Red) }; Console.WriteLine("The colour printer prints information..."); var colorPrinter = new ColourPrinter(); colorPrinter.Print(colorStrings); Console.WriteLine(); var images = new Bitmap[] { new Bitmap("C:\\Users\\eugen\\Documents\\ASPdotNET_logo.jpg"), new Bitmap("C:\\Users\\eugen\\Documents\\VeriSignLogo.jpg") }; Console.WriteLine("The photo printer prints information..."); var photoPrinter = new PhotoPrinter(); photoPrinter.Print(images); Console.WriteLine(); }
public static void Print(this PhotoPrinter photoPrinter, Photo[] photos) { foreach (Photo n in photos) { photoPrinter.Print(n); } }
public static void WorkingWithArrayOfImg(this PhotoPrinter photoPrinter, Img[] imgs) { foreach (var el in imgs) { Console.WriteLine("Img"); photoPrinter.Print(el); } }
public static void Print(this List <PhotoPrinterParams> photoPrinterParams) { var photoPrinter = new PhotoPrinter(); foreach (var photoPrinterParam in photoPrinterParams) { photoPrinter.Print(photoPrinterParam.Image); } }
static void Main(string[] args) { Printer p1 = new Printer(); string[] messages = new string[] { "one ", "two ", "three" }; p1.Print(messages); ColoredPrinter c = new ColoredPrinter(); ConsoleColor[] consoleColors = new ConsoleColor[] { ConsoleColor.Blue, ConsoleColor.Cyan, ConsoleColor.DarkRed }; c.Print(messages, consoleColors); PhotoPrinter p = new PhotoPrinter(); Photo[] photos = new Photo[] { Photo.First, Photo.Second, Photo.Third }; p.Print(photos); }
static void Main(string[] args) { Printer printer = new Printer(); ColourPrinter colourPrinter = new ColourPrinter(); PhotoPrinter photoPrinter = new PhotoPrinter(); string[] strings = { "string1", "string2", "string3", "string4", "string5" }; int[] colours = { 1, 2, 3, 4, 5 }; Photo[] photos = { new Photo { PhotoData = "photo string1" }, new Photo { PhotoData = "photo string2" }, new Photo { PhotoData = "photo string3" }, new Photo { PhotoData = "photo string4" }, new Photo { PhotoData = "photo string5" } }; Console.WriteLine("Print string array:"); printer.Print(strings); Console.WriteLine("\nPrint colored string array:"); colourPrinter.Print(strings, colours); Console.WriteLine("\nPrint photo array:"); photoPrinter.Print(photos); Console.ReadKey(); }
public static void PhotoPrinterExtention(this PhotoPrinter photoPrinter, Photo photo) { photoPrinter.Print("Printed from Photo printer extention! New Photo: " + photo.GetPhoto()); }