public void Write(string content, IWritingUtensil utensil)
 {
     if (LastContent.Text != string.Empty)
     {
         PaperContent.Add(LastContent);
     }
     LastContent = new PaperContent(content, (utensil is IErasable));
 }
예제 #2
0
        public void Write(IWritingUtensil pencil, string message)
        {
            var characters = message.ToCharArray();

            foreach (var character in characters)
            {
                _characters.Append(pencil.WriteCharacterIfCapable(character));
            }
        }
예제 #3
0
 public RunApplication(IStationary stationary, IWritingUtensil writingUtensil, Stack <IWritingUtensil> pencilDrawer, IEraseHelper eraseHelper,
                       IEditHelper editHelper, IWriteAndSharpenHelper writeAndSharpenHelper)
 {
     _stationary            = stationary;
     _writingUtensil        = writingUtensil;
     _pencilDrawer          = pencilDrawer;
     _eraseHelper           = eraseHelper;
     _editHelper            = editHelper;
     _writeAndSharpenHelper = writeAndSharpenHelper;
 }
예제 #4
0
 // write test for this
 public void BuildNewPencil()
 {
     if (_pencilDrawer.Count != 0)
     {
         _writingUtensil = _pencilDrawer.Pop();
         Console.WriteLine($"\nYou now have a new pencil. You have {_pencilDrawer.Count} pencil(s) left.");
         Console.ReadKey();
     }
     else
     {
         Console.WriteLine("\nYou've run out of extra pencils!");
         Console.ReadKey();
     }
 }
예제 #5
0
 public void Write(IWritingUtensil utensil)
 {
     Text = utensil.Write();
 }
예제 #6
0
 public EditHelper(IStationary stationary, IWritingUtensil writingUtensil)
 {
     _stationary     = stationary;
     _writingUtensil = writingUtensil;
 }
 public WriteAndSharpenHelper(IStationary stationary, IWritingUtensil writingUtensil)
 {
     _stationary     = stationary;
     _writingUtensil = writingUtensil;
 }