public void Add(LibItem libItem)
        {
            if (libItem == null)
            {
                throw new System.ArgumentException("LibItem cannot be null.");
            }

            if (libItem.GetType() == typeof(Book))
            {
                Books.Add((Book)libItem);
            }
            else if (libItem.GetType() == typeof(Article))
            {
                Articles.Add((Article)libItem);
            }
            else if (libItem.GetType() == typeof(Movie))
            {
                Movies.Add((Movie)libItem);
            }
            else if (libItem.GetType() == typeof(NewsPaper))
            {
                NewsPapers.Add((NewsPaper)libItem);
            }
            else if (libItem.GetType() == typeof(Journal))
            {
                Journals.Add((Journal)libItem);
            }
            else
            {
                throw new System.ArgumentException("Unknown type of library item");
            }
        }
示例#2
0
 public void Return(LibItem libItem)
 {
 }
 public void AddToCatalogue(LibItem libItem)
 {
 }
示例#4
0
 public void CheckOut(LibItem libItem)
 {
 }