Ejemplo n.º 1
0
 public Section(string name, string logoName, DataBase.Repository repository)//это же функция - конструктор
 {
     Name        = name;
     PageAddress = "/" + name;
     LogoAddress = "/images/" + logoName;
     Items       = repository.GetSectionItems(name); // тут делаем запрос в базу данных
 }
Ejemplo n.º 2
0
 public Sections(DataBase.Repository repository)
 {
     All = new[]                                                 // All is Section Collection, constructor invocation
     {
         new Section("Culture", "culture.svg", repository),      //а это объект
         new Section("History", "history_48px.svg", repository), //как называется то, что в скобках и кавычках
         //это просто аргументы вызова конструктора
         new Section("Places", "places.svg", repository),
         new Section("Nature", "nature.svg", repository),
         new Section("Sports", "sports.svg", repository),
         new Section("Technology", "technology.svg", repository),
         new Section("Food", "food.svg", repository)
     };
 }