示例#1
0
        static void Main()
        {
            Music music = new Music("Angel", "Colture", 10, 96);
            File  file  = new File("Angel", 10, 96);

            StreamProgressInfo stream = new StreamProgressInfo();


            Console.WriteLine(stream.CalculateCurrentPercent(music));
            Console.WriteLine(stream.CalculateCurrentPercent(file));
        }
示例#2
0
        static void Main()
        {
            Music song = new Music("Linkin Park", "Meteora", 3, 67);
            StreamProgressInfo progress = new StreamProgressInfo(song);

            Console.WriteLine(progress.CalculateCurrentPercent());
        }
示例#3
0
        static void Main()
        {
            Music music           = new Music("Skandau", "album", 300, 20);
            StreamProgressInfo si = new StreamProgressInfo(music);

            Console.WriteLine(si.CalculateCurrentPercent());
        }
示例#4
0
        static void Main()
        {
            StreamProgressInfo streamProgressInfo  = new StreamProgressInfo(new File("file", 100, 1000));
            StreamProgressInfo streamProgressInfo2 = new StreamProgressInfo(new Music("musician", "album", 10, 100));

            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());
            Console.WriteLine(streamProgressInfo2.CalculateCurrentPercent());
        }
示例#5
0
        static void Main()
        {
            IStreamable        myFile   = new Music("Dido", "Dido e pich", 4, 1);
            StreamProgressInfo myStream = new StreamProgressInfo(myFile);
            var percent = myStream.CalculateCurrentPercent();

            Console.WriteLine(percent);
        }
示例#6
0
        static void Main()
        {
            var newFile = new Movie();

            newFile.BytesSent = 0;
            newFile.Length    = 120;

            StreamProgressInfo stream = new StreamProgressInfo(newFile);

            while (stream.CalculateCurrentPercent() < 100)
            {
                newFile.BytesSent += 24;
                Console.WriteLine($"Sending: {stream.CalculateCurrentPercent()} %");

                Thread.Sleep(70);
            }
        }
示例#7
0
        public static void Main()
        {
            var musicStream = new StreamProgressInfo(new Music("Cardi B", "B", 342, 2000));
            var fileStream  = new StreamProgressInfo(new File("someFile.txt", 290, 3000));

            Console.WriteLine(musicStream.CalculateCurrentPercent());
            Console.WriteLine(fileStream.CalculateCurrentPercent());
        }
示例#8
0
        public static void Main()
        {
            var streamFile = new Movie("Going Postal", 100, 1000);

            var stream = new StreamProgressInfo(streamFile);

            Console.WriteLine(stream.CalculateCurrentPercent());
        }
示例#9
0
        private static void Main()
        {
            //File file = new File("fileName",10,10);
            Music music = new Music("artist", "album", 10, 10);
            StreamProgressInfo streamProgressInfo = new StreamProgressInfo(music);

            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());
        }
示例#10
0
        static void Main()
        {
            File  file  = new File("ss", 20, 1);
            Music music = new Music("Angel", "asdas", 10, 1);
            StreamProgressInfo stream = new StreamProgressInfo(music);

            Console.WriteLine(stream.CalculateCurrentPercent());
        }
        static void Main()
        {
            var progresInfo = new StreamProgressInfo(new Music("Pep", "Pop", 5, 4));

            Console.WriteLine(progresInfo.CalculateCurrentPercent());
            var progressInfo2 = new StreamProgressInfo(new File("Gog", 12, 3));

            Console.WriteLine(progressInfo2.CalculateCurrentPercent());
        }
示例#12
0
        static void Main()
        {
            Music music = new Music("Az", "Vecherq", 32, 10);
            File  file  = new File("Kenef", 12, 3);

            StreamProgressInfo stream = new StreamProgressInfo(file);

            Console.WriteLine(stream.CalculateCurrentPercent());
        }
示例#13
0
        static void Main()
        {
            var progressInfo  = new StreamProgressInfo(new File("test.txt", 100, 1000));
            var progressMusic = new StreamProgressInfo(new Music("dmx", "moneyTalk", 600, 700));
            var resultInfo    = progressInfo.CalculateCurrentPercent();
            var resultMusic   = progressMusic.CalculateCurrentPercent();

            Console.WriteLine(resultInfo);
            Console.WriteLine(resultMusic);
        }
示例#14
0
文件: Program.cs 项目: mila89/OOP
        static void Main()
        {
            Music music = new Music("Milena", "MyFirstSOLID", 20, 3000);
            File  file  = new File("SOLID", 20, 300);
            StreamProgressInfo musicStream = new StreamProgressInfo(music);
            StreamProgressInfo fileStream  = new StreamProgressInfo(file);

            Console.WriteLine(musicStream.CalculateCurrentPercent());
            Console.WriteLine(fileStream.CalculateCurrentPercent());
        }
示例#15
0
        static void Main()
        {
            IStream            song     = new Music("Arctic monkeys", "Flourescent adolescent", 500, 50);
            IStream            file     = new File("document", 200, 120);
            StreamProgressInfo songInfo = new StreamProgressInfo(song);
            StreamProgressInfo fileInfo = new StreamProgressInfo(file);

            Console.WriteLine(songInfo.CalculateCurrentPercent() + "%");
            Console.WriteLine(fileInfo.CalculateCurrentPercent() + "%");
        }
示例#16
0
        static void Main()
        {
            var file               = new File("Tonko", 30, 165);
            var music              = new Music("Lili Ivanova", "Vetrove", 100, 586);
            var streamProgresInfo  = new StreamProgressInfo(file);
            var streamProgresInfo1 = new StreamProgressInfo(music);

            Console.WriteLine(streamProgresInfo.CalculateCurrentPercent());
            Console.WriteLine(streamProgresInfo1.CalculateCurrentPercent());
        }
示例#17
0
        static void Main()
        {
            Music music = new Music("musicArtist", "musicAlbum", 42, 42);
            File  file  = new File("fileName", 42, 42);

            StreamProgressInfo musicStreamingInfo = new StreamProgressInfo(music);
            StreamProgressInfo fileStreamingInfo  = new StreamProgressInfo(file);

            musicStreamingInfo.CalculateCurrentPercent();
            fileStreamingInfo.CalculateCurrentPercent();
        }
示例#18
0
        static void Main()
        {
            var file            = new File("File name", 1234, 123);
            var fileProcessInfo = new StreamProgressInfo(file);

            Console.WriteLine(fileProcessInfo.CalculateCurrentPercent());

            var music            = new Music("Singer", "Album", 123456, 12349);
            var musicProcessInfo = new StreamProgressInfo(music);

            Console.WriteLine(musicProcessInfo.CalculateCurrentPercent());
        }
示例#19
0
        static void Main()
        {
            File file = new File("Programmer.txt", 50, 10);
            StreamProgressInfo spr = new StreamProgressInfo(file);

            Console.WriteLine(spr.CalculateCurrentPercent());

            Music music = new Music("Something", "Something", 100, 10);

            spr = new StreamProgressInfo(music);
            Console.WriteLine($"{spr.CalculateCurrentPercent()}% sent so far");
        }
        public static void Main()
        {
            var musicFile = new Music("Some_Artist", "Some_Album", 3, 512);
            var file      = new File("someFileName", 5, 128);

            var musicProgress = new StreamProgressInfo(musicFile);

            Console.WriteLine(musicProgress.CalculateCurrentPercent());

            var fileProgress = new StreamProgressInfo(file);

            Console.WriteLine(fileProgress.CalculateCurrentPercent());
        }
示例#21
0
        static void Main()
        {
            IStreamable music = new Music("Pesho", "Album", 10, 500);
            IStreamable file  = new File("My file", 12, 800);

            StreamProgressInfo musicProgress = new StreamProgressInfo(music);

            Console.WriteLine(musicProgress.CalculateCurrentPercent());

            StreamProgressInfo fileProgress = new StreamProgressInfo(file);

            Console.WriteLine(fileProgress.CalculateCurrentPercent());
        }
示例#22
0
        static void Main()
        {
            //1
            IStreamable        music = new Music("Lili", "vetrove", 10, 3);
            StreamProgressInfo abc   = new StreamProgressInfo(music);

            Console.WriteLine(abc.CalculateCurrentPercent());

            //2
            //IStreamable music = new Music("Lili", "vetrove", 10, 3);
            //StreamProgressInfo abc = new StreamProgressInfo();

            //Console.WriteLine(abc.CalculateCurrentPercent(music));
        }
示例#23
0
        static void Main()
        {
            IStreamable streamMusic = new Music("Artist", "Album", 1, 10);

            IStreamable streamVideo = new Video("Space", 30, 500);

            StreamProgressInfo streamProgressInfo = new StreamProgressInfo(streamMusic);

            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());

            streamProgressInfo = new StreamProgressInfo(streamVideo);

            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());
        }
        static void Main()
        {
            string name      = "Pesho";
            string album     = "Pesho's songs";
            int    lenght    = 15;
            int    bytesSent = 64;

            IStreamable music = new Music(name, album, lenght, bytesSent);
            IStreamable file  = new File(name, lenght, bytesSent);

            StreamProgressInfo streamCalc = new StreamProgressInfo(music);
            int result = streamCalc.CalculateCurrentPercent();

            Console.WriteLine(result);
        }
示例#25
0
        static void Main()
        {
            IStreamable        file         = new File("ivan", 100, 10);
            StreamProgressInfo proccessFile = new StreamProgressInfo(file);
            int progress = 0;

            Console.WriteLine("Download is at:");
            while (progress <= 90)
            {
                progress += proccessFile.CalculateCurrentPercent();
                Console.WriteLine($"{progress}%");
                Thread.Sleep(1000);
            }
            Console.WriteLine("Download finished!");
        }
示例#26
0
        static void Main()
        {
            IStreamable file  = new File("Anatoly", 50, 1000);
            IStreamable music = new Music("Veselin", "Hushove", 10, 500);



            StreamProgressInfo sPIFile = new StreamProgressInfo(file);

            Console.WriteLine(sPIFile.CalculateCurrentPercent());

            StreamProgressInfo sPIMusic = new StreamProgressInfo(music);

            Console.WriteLine(sPIMusic.CalculateCurrentPercent());
        }
示例#27
0
        static void Main()
        {
            IStreamable music = new Music("Eminem", "The 8 Mile", 45, 1000);
            IStreamable file  = new File("Invoice N10035", 3, 1000);

            StreamProgressInfo musicStream = new StreamProgressInfo(music);

            Console.WriteLine(musicStream.CalculateCurrentPercent());

            StreamProgressInfo fileStream = new StreamProgressInfo(file);

            Console.WriteLine(fileStream.CalculateCurrentPercent());

            Console.WriteLine(music);
            Console.WriteLine(file);
        }
示例#28
0
        static void Main()
        {
            IStream            file = new File("file", 12, 50);
            StreamProgressInfo streamProgressInfo = new StreamProgressInfo(file);

            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());

            IStream music = new Music("Ivan", "Silence", 12, 530);

            streamProgressInfo = new StreamProgressInfo(music);
            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());

            IStream video = new Movie("the walking dead", 132, 50);

            streamProgressInfo = new StreamProgressInfo(video);
            Console.WriteLine(streamProgressInfo.CalculateCurrentPercent());
        }
        static void Calculate(IStreamable streamable)
        {
            StreamProgressInfo stream = new StreamProgressInfo(streamable);

            Console.WriteLine(stream.CalculateCurrentPercent());
        }