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(); }
public static void Print(this PhotoPrinter photoPrinter, Photo[] photos) { foreach (Photo n in photos) { photoPrinter.Print(n); } }
public static void PrintArrayOfPhotos(this PhotoPrinter photoPrinter, Image[] images) { foreach (Image image in images) { photoPrinter.Print(image); } }
public static void Multiprint(this PhotoPrinter pprinter, string[] messages, string image) { foreach (string message in messages) { pprinter.Print(message, 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 Print(this PhotoPrinter photoPrinter, Bitmap[] images) { foreach (var image in images) { photoPrinter.Print(image); } }
public static void ExtendedPhotoPrint(this PhotoPrinter photoPrinter, Photo[] photos) { foreach (Photo ph in photos) { photoPrinter.Print(ph); } }
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 PrintPhotoArray(this PhotoPrinter photoPrinter, params object[] photos) { foreach (var photo in photos) { photoPrinter.Print(photo); } }
public static void Multiprint(this PhotoPrinter photoPrinter, Image[] images) { foreach (Image image in images) { photoPrinter.Print(image); } }
public static void ExtendPrint(this PhotoPrinter printer, Photo[] photos) { foreach (var photo in photos) { printer.Print(photo); } }
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); } }
public static void ExtPrint(this PhotoPrinter printer, string[] messages, string[] photos) { Console.WriteLine("Extention method for class Photo"); for (int i = 0; i < photos.Length; i++) { Console.WriteLine(photos[i]); } }
static void Main(string[] args) { var colorPrinter = new ColorPrinter(); colorPrinter.ExtendPrint(new string[] { "message1", "message2" }, ConsoleColor.Cyan); var photoPrinter = new PhotoPrinter(); photoPrinter.ExtendPrint(new Photo[] { new Photo(), new Photo() }); photoPrinter.ExtendPrint(new string[] { "text1", "text2", "text3" }); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); ColourPrinter cprinter = new ColourPrinter(); PhotoPrinter phprinter = new PhotoPrinter(); string[] texttoprint = new [] { "1", "2" }; string[] textandcolour = new[] { "1", "red" }; object[] photos = new[] { "1", "2" }; ExtensionMethods.PrintText(cprinter, texttoprint); ExtensionMethods.PrintTextAndColour(cprinter, textandcolour); ExtensionMethods.PrintPhoto(phprinter, photos); }
static void Main(string[] args) { Printer myPrinter = new Printer(); myPrinter.PrinterExtention(); ColorPrinter colorPrinter = new ColorPrinter(); colorPrinter.ColorPrinterExtention(ConsoleColor.Cyan); Photo myPhoto = new Photo("^-^"); PhotoPrinter photoPrinter = new PhotoPrinter(); photoPrinter.PhotoPrinterExtention(myPhoto); Console.ReadKey(); }
static void Main(string[] args) { Printer mainPrinter = new Printer(); PhotoPrinter photoPrinter = new PhotoPrinter(); ColourPrinter colourPrinter = new ColourPrinter(); string[] mainArguments = { "First main test print", "Second main test print", "Third main test print" }; Photo[] photos = { new Photo("100x100", true, 1), new Photo("200x200", false, 2), new Photo("300x300", true, 3) }; string[] colourArguments = { "First colour test print", "Second colour test print", "Third colour test print" }; ConsoleColor[] colors = { ConsoleColor.DarkGreen, ConsoleColor.DarkMagenta, ConsoleColor.DarkRed }; mainPrinter.ExtendedPrint(mainArguments); photoPrinter.ExtendedPhotoPrint(photos); colourPrinter.ExtendedColourPrint(colourArguments, colors); }
static void Main(string[] args) { var printer = new Printer.Printer(); printer.Multiprint(new string[] { "message one", "message two" }); var colourPrinter = new ColourPrinter(); colourPrinter.Multiprint(new string[] { "colour message one", "colour message two" }, ConsoleColor.DarkCyan); var photoPrinter = new PhotoPrinter(); photoPrinter.Multiprint(new Image[] { Image.FromFile("maidukov1.jpg"), Image.FromFile("capricorn.png") }); Console.ReadLine(); }
static void Main(string[] args) { var printer = new Printer(); printer.Multiprint(new string[] { "text1", "text2" }); var cprinter = new ColourPrinter(); cprinter.Multiprint(new string[] { "colortext1", "colortext2" }, ConsoleColor.DarkYellow); var pprinter = new PhotoPrinter(); pprinter.Multiprint(new string[] { "photo printer text 1", "photo printer text 2" }, "PHOTO"); Console.ReadLine(); }
static void Main(string[] args) { var printer = new Printer(); var colourPrinter = new ColourPrinter(); var photoPrinter = new PhotoPrinter(); printer.PrintArrayOfText(new string[] { "hello ", "world" }); colourPrinter.PrintArrayOfColouredText(new string[] { "colour ", "text", "example" }, new ConsoleColor[] { ConsoleColor.Blue, ConsoleColor.Red }); photoPrinter.PrintArrayOfPhotos(new Image[] { new Image("Image1"), new Image("Image2") }); Console.ReadLine(); }
static void Main(string[] args) { Printer.Printer printer = new Printer.Printer(); ColourPrinter colourPrinter = new ColourPrinter(); PhotoPrinter photoPrinter = new PhotoPrinter(); string[] message = { "message1", "message2", "message3" }; ConsoleColor[] color = { ConsoleColor.Blue, ConsoleColor.Yellow, ConsoleColor.Magenta }; string[] photo = { "photo1", "photo2", "photo3" }; printer.ExpansionToPrinter(message, 0); colourPrinter.ExpansionToColourPrinte(message, color, 1); colourPrinter.ExpansionToPrinter(message, 1); photoPrinter.ExpansionToPhotoPrinter(message, photo, 2); photoPrinter.ExpansionToPrinter(message, 2); Console.ReadKey(); }
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(); printer.PrintAll("This", "is", "a", "long", "message"); Console.WriteLine(); ColourPrinter colPrinter = new ColourPrinter(); colPrinter.PrintAll(new Tuple <string, ConsoleColor>("Colourful", ConsoleColor.DarkBlue), new Tuple <string, ConsoleColor>("message", ConsoleColor.Red)); Console.WriteLine(); PhotoPrinter photoPr = new PhotoPrinter(); photoPr.PrintAll(new Photo(), new Photo("Custom photo"), new Photo()); Console.ReadKey(); }
static void Main(string[] args) { string[] message = { "Message 1", " Message 2" }; ConsoleColor[] color = { ConsoleColor.DarkRed, ConsoleColor.Yellow }; string[] photos = { "Small dog", "Fat cat" }; var printer = new Printer(); printer.ExtPrint(message); Console.WriteLine(); var colourPrinter = new ColourPrinter(); colourPrinter.ExtPrint(message, color); Console.WriteLine(); var photoPrinter = new PhotoPrinter(); photoPrinter.ExtPrint(message, photos); Console.ReadLine(); }
static void Main(string[] args) { var list = new string[5]; for (var i = 0; i < 5; i++) { list[i] = $"Number {i}"; } var colors = new[] { ConsoleColor.Blue, ConsoleColor.Red, ConsoleColor.Magenta, ConsoleColor.DarkYellow }; var imgs = new Img[4]; var printer = new Printer(); printer.WorkingWithArrayOfString(list); var colorPrinter = new ColourPrinter(); colorPrinter.WorkingWithArrayOfStringAndColors(list, colors); var photoPrinter = new PhotoPrinter(); photoPrinter.WorkingWithArrayOfImg(imgs); Console.ReadKey(); }
static void Main(string[] args) { var p1 = new Printer(); string[] str = new string[5]; str[0] = "s0"; str[1] = "s1"; str[2] = "s2"; str[3] = "s3"; str[4] = "s4"; ExtensionMethods.Print(p1, str); p1 = new PhotoPrinter(); ExtensionMethods.Print(p1, str); string[] col = new string[5]; col[0] = "Green"; col[1] = "Yellow"; col[2] = "Cyan"; col[3] = "Red"; col[4] = "Mayonnaise"; var p2 = new ColourPrinter(); ExtensionMethods.Print(p2, str, col); }
static void Main(string[] args) { var printer = new Printer(); var colourPrinter = new ColourPrinter(); var photoPrinter = new PhotoPrinter(); object photo = "Photo2", photo1 = "Photo1"; Console.WriteLine("Printer"); printer.PrintSomeArray("Some Text", "Some Text2", "Some Text3"); Console.WriteLine("------------------"); Console.WriteLine("Coluor Printer"); colourPrinter.PrintColorArray(new string[] { "Some text", "Some Text1" }, new ConsoleColor[] { ConsoleColor.Red, ConsoleColor.DarkGreen }); Console.WriteLine("------------------"); Console.WriteLine("Photo Printer"); photoPrinter.PrintPhotoArray(photo, photo1); Console.ReadLine(); }
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 PrintPhoto(this PhotoPrinter value, object[] photos) { value.PhotoArray = photos; }