예제 #1
0
        public void Print(int pageNumber)
        {
            if (paper_count == 0)
            {
                Out_of_paper?.Invoke(this, new OutofpaperEventArgs(pageNumber));
            }
            else
            {
                foreach (var ink in inks_levels)
                {
                    if (ink.Level <= 0)
                    {
                        Out_of_Toner.Invoke(this, new OutOfInkEventArgs(ink.Color));
                        return;
                    }
                }

                Console.WriteLine("Print...");
                --paper_count;

                foreach (var ink in inks_levels)
                {
                    ink.Level -= 0.2;
                }
            }
        }
예제 #2
0
 public void Print(int n)
 {
     if (paper_count == 0)
     {
         Out_of_paper?.Invoke(this,
                              new OutOfPaperEventArgs(n));
         return;
     }
     else
     {
         paper_count--;
         Console.WriteLine("{0} Pages print...", n);
     }
 }
예제 #3
0
 public void print(int page_number)
 {
     Out_of_paper.Invoke(this, new OutofpaperEventArgs(page_number));
 }