/// <summary> /// Saves a <see cref="ILanguage"/> object /// </summary> /// <param name="language"><see cref="ILanguage"/> to save</param> /// <param name="userId">Optional id of the user saving the language</param> public void Save(ILanguage language, int userId = 0) { if (SavingLanguage.IsRaisedEventCancelled(new SaveEventArgs <ILanguage>(language), this)) { return; } var uow = _uowProvider.GetUnitOfWork(); using (var repository = _repositoryFactory.CreateLanguageRepository(uow)) { repository.AddOrUpdate(language); uow.Commit(); SavedLanguage.RaiseEvent(new SaveEventArgs <ILanguage>(language, false), this); } Audit.Add(AuditTypes.Save, "Save Language performed by user", userId, language.Id); }
public void ChangeLanguage([ArgDescription("Language")] Language language) { Service.Get <Localizer>().ChangeLanguage(language); SavedLanguage.SetValue(language); }