In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.
isMapAdded
:)var isMapAdded = false;
$(window).scroll(function () {
var el = $('.map');
if ($(this).scrollTop() > el.offset().top - 800) {
if(isMapAdded) return;
isMapAdded = true;
var script = document.createElement('script');
script.src = "https://api-maps.yandex.ru/services/constructor/1....";
el.append(script);
};
});
let data = {};
let name = document.getElementById('name');
let email = document.getElementById('email');
let phone = document.getElementById('phone');
let msg = document.getElementById('message');
let btn = document.getElementById('btn');
btn.addEventListener('click',()=>{
data = {
uName : name.value,
uEmail : email.value,
uPhone : phone.value,
uMsg : msg.value
};
alert(data.uMsg);
});
Могу ли я создать список в списке?
List<List<int>>
Что бы у элемента списка мог быть свой еще список.
class Foo{
public List<int> Digits = new List<int>();
}
var bar = new List<Foo>();
bar[0].Digits[0] = 5;
_userList.Add(new UserModel() {
FirstName = "Jack",
LastName = "The Sparrow",
Accounts = new List().Add(new AccountModel()
{
//А вот здесь сама проблема. Не могу заполнить список.
})
});
var user_accounts = new List<AccountModel>();
user_accounts.Add(new AccountModel()
{
AccountType = "Yandex",
Email = "ram@ram.ru",
Password = "12312312",
});
user_accounts.Add(new AccountModel()
{
AccountType = "Yandex",
Email = "ram2@ram.ru",
Password = "12312312",
});
user_accounts.Add(new AccountModel()
{
AccountType = "Yandex",
Email = "ram3@ram.ru",
Password = "12312312",
});
var new_user = new UserModel() {
FirstName = "Jack",
LastName = "The Sparrow"}
new_user.Accounts = user_accounts;
_userList.Add(new_user);
В общем у меня уйдёт на это 2 - 2.5 месяца. Только на основы!