예제 #1
0
        /// <summary>
        /// метод интерфейса ICloneable, осуществляющий глубокое копирование
        /// </summary>
        /// <returns>копия объекта Dictionary</returns>
        public override object Clone()
        {
            СategoryBook categoryBook = new СategoryBook(this.Type?.NameСategory ?? "не задано", this.Type?.IndexCategory ?? 0);

            return(new Dictionary
            {
                Name = this.Name, Author = this.Author, NumberPages = this.NumberPages,
                YearPubl = this.YearPubl, Local = this.Local, Type = categoryBook
            });
        }
예제 #2
0
 public Dictionary(string name, string author, int numberPages, int yearPubl, Location local, СategoryBook categoryBook)
     : base(name, author, numberPages, yearPubl, local)
 {
     Type = categoryBook ?? new СategoryBook("не задано", 0);
 }