public static void Main() { var progresInfo = new StreamProgressInfo(new File("File name", 100, 1000)); var progresInfo2 = new StreamProgressInfo(new Music("Lili Ivanova", "Vetrove", 100, 1000)); Console.WriteLine(progresInfo.CalculateCurrentPercent()); Console.WriteLine(progresInfo2.CalculateCurrentPercent()); }
public static void Main() { IStreamable txtFile = new File("report.txt", 240, 16); IStreamable mp3File = new Music("Elvis", "Promised land", 3800, 48); StreamProgressInfo txtFileInfo = new StreamProgressInfo(txtFile); StreamProgressInfo musicFileInfo = new StreamProgressInfo(mp3File); Console.WriteLine(txtFileInfo.CalculateCurrentPercent()); Console.WriteLine(musicFileInfo.CalculateCurrentPercent()); }