void CreateLanguageProperties(ISession session, Theme theme, Culture culture) { if (culture == null) { return; } Language language = session.QueryOver <Language>().Where(pr => pr.CultureIdentifier == culture.Id).SingleOrDefault() ?? new Language(culture); theme.AddLanguage(language); }
void ButtonAddLangClick(object sender, EventArgs e) { Culture culture = AvailableCultures.FirstOrDefault(); if (culture == null) { return; } Language language = languages.SingleOrDefault <Language>(x => x.CultureIdentifier == culture.Id) ?? new Language(culture); theme.AddLanguage(language); AddItem(language); RefreshLanguageProperty(language); }