2012-11-07 13:56:52 -01:00
|
|
|
using System;
|
2012-10-24 12:22:52 -02:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2012-12-10 14:53:36 -01:00
|
|
|
using Umbraco.Core.Auditing;
|
2015-01-09 18:53:08 +11:00
|
|
|
using Umbraco.Core.Configuration;
|
2012-12-15 10:43:03 +05:00
|
|
|
using Umbraco.Core.Events;
|
2015-01-09 18:53:08 +11:00
|
|
|
using Umbraco.Core.Logging;
|
2012-10-24 12:22:52 -02:00
|
|
|
using Umbraco.Core.Models;
|
|
|
|
|
using Umbraco.Core.Persistence;
|
|
|
|
|
using Umbraco.Core.Persistence.Querying;
|
|
|
|
|
using Umbraco.Core.Persistence.UnitOfWork;
|
|
|
|
|
|
2012-11-12 07:40:11 -01:00
|
|
|
namespace Umbraco.Core.Services
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents the Localization Service, which is an easy access to operations involving <see cref="Language"/> and <see cref="DictionaryItem"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class LocalizationService : ILocalizationService
|
|
|
|
|
{
|
2012-12-14 08:22:42 +05:00
|
|
|
private readonly RepositoryFactory _repositoryFactory;
|
2012-12-14 13:06:58 -01:00
|
|
|
private readonly IDatabaseUnitOfWorkProvider _uowProvider;
|
2015-01-12 18:52:30 +11:00
|
|
|
private static readonly Guid RootParentId = new Guid(Constants.Conventions.Localization.DictionaryItemRootId);
|
2012-12-14 13:06:58 -01:00
|
|
|
|
2015-01-09 18:53:08 +11:00
|
|
|
[Obsolete("Use the constructors that specify all dependencies instead")]
|
2012-12-14 13:27:10 -01:00
|
|
|
public LocalizationService()
|
2015-01-09 18:53:08 +11:00
|
|
|
: this(new RepositoryFactory(false, LoggerResolver.Current.Logger, UmbracoConfig.For.UmbracoSettings()))
|
2012-12-14 13:27:10 -01:00
|
|
|
{}
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2015-01-09 18:53:08 +11:00
|
|
|
[Obsolete("Use the constructors that specify all dependencies instead")]
|
2012-12-14 08:22:42 +05:00
|
|
|
public LocalizationService(RepositoryFactory repositoryFactory)
|
2015-01-09 18:53:08 +11:00
|
|
|
: this(new PetaPocoUnitOfWorkProvider(LoggerResolver.Current.Logger), repositoryFactory)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-14 13:27:10 -01:00
|
|
|
}
|
|
|
|
|
|
2015-01-09 18:53:08 +11:00
|
|
|
[Obsolete("Use the constructors that specify all dependencies instead")]
|
2012-12-14 13:27:10 -01:00
|
|
|
public LocalizationService(IDatabaseUnitOfWorkProvider provider)
|
2015-01-09 18:53:08 +11:00
|
|
|
: this(provider, new RepositoryFactory(false, LoggerResolver.Current.Logger, UmbracoConfig.For.UmbracoSettings()))
|
2012-12-14 13:27:10 -01:00
|
|
|
{
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
2012-12-14 08:22:42 +05:00
|
|
|
public LocalizationService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-14 08:22:42 +05:00
|
|
|
_repositoryFactory = repositoryFactory;
|
2012-12-14 13:06:58 -01:00
|
|
|
_uowProvider = provider;
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
2015-01-12 18:52:30 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// Creates and saves a new dictionary item and assigns a value to all languages if defaultValue is specified.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="key"></param>
|
|
|
|
|
/// <param name="parentId"></param>
|
|
|
|
|
/// <param name="defaultValue"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public IDictionaryItem CreateDictionaryItemWithIdentity(string key, Guid? parentId, string defaultValue = null)
|
|
|
|
|
{
|
|
|
|
|
var uow = _uowProvider.GetUnitOfWork();
|
|
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(uow))
|
|
|
|
|
{
|
|
|
|
|
//validate the parent
|
|
|
|
|
if (parentId.HasValue && parentId.Value != Guid.Empty)
|
|
|
|
|
{
|
|
|
|
|
var parent = GetDictionaryItemById(parentId.Value);
|
|
|
|
|
if (parent == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException("No parent dictionary item was found with id " + parentId.Value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var item = new DictionaryItem(parentId.HasValue ? parentId.Value : RootParentId, key);
|
|
|
|
|
|
|
|
|
|
if (defaultValue.IsNullOrWhiteSpace() == false)
|
|
|
|
|
{
|
|
|
|
|
var langs = GetAllLanguages();
|
|
|
|
|
var translations = langs.Select(language => new DictionaryTranslation(language, defaultValue))
|
|
|
|
|
.Cast<IDictionaryTranslation>()
|
|
|
|
|
.ToList();
|
|
|
|
|
|
|
|
|
|
item.Translations = translations;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (SavingDictionaryItem.IsRaisedEventCancelled(new SaveEventArgs<IDictionaryItem>(item), this))
|
|
|
|
|
return item;
|
|
|
|
|
|
|
|
|
|
repository.AddOrUpdate(item);
|
|
|
|
|
uow.Commit();
|
|
|
|
|
|
|
|
|
|
SavedDictionaryItem.RaiseEvent(new SaveEventArgs<IDictionaryItem>(item), this);
|
|
|
|
|
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-10-24 12:22:52 -02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a <see cref="IDictionaryItem"/> by its <see cref="Int32"/> id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Id of the <see cref="IDictionaryItem"/></param>
|
|
|
|
|
/// <returns><see cref="IDictionaryItem"/></returns>
|
|
|
|
|
public IDictionaryItem GetDictionaryItemById(int id)
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
return repository.Get(id);
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a <see cref="IDictionaryItem"/> by its <see cref="Guid"/> id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Id of the <see cref="IDictionaryItem"/></param>
|
|
|
|
|
/// <returns><see cref="DictionaryItem"/></returns>
|
|
|
|
|
public IDictionaryItem GetDictionaryItemById(Guid id)
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var query = Query<IDictionaryItem>.Builder.Where(x => x.Key == id);
|
|
|
|
|
var items = repository.GetByQuery(query);
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2012-12-14 13:06:58 -01:00
|
|
|
return items.FirstOrDefault();
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a <see cref="IDictionaryItem"/> by its key
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="key">Key of the <see cref="IDictionaryItem"/></param>
|
|
|
|
|
/// <returns><see cref="IDictionaryItem"/></returns>
|
|
|
|
|
public IDictionaryItem GetDictionaryItemByKey(string key)
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var query = Query<IDictionaryItem>.Builder.Where(x => x.ItemKey == key);
|
|
|
|
|
var items = repository.GetByQuery(query);
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2012-12-14 13:06:58 -01:00
|
|
|
return items.FirstOrDefault();
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a list of children for a <see cref="IDictionaryItem"/>
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="parentId">Id of the parent</param>
|
|
|
|
|
/// <returns>An enumerable list of <see cref="IDictionaryItem"/> objects</returns>
|
|
|
|
|
public IEnumerable<IDictionaryItem> GetDictionaryItemChildren(Guid parentId)
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var query = Query<IDictionaryItem>.Builder.Where(x => x.ParentId == parentId);
|
|
|
|
|
var items = repository.GetByQuery(query);
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2012-12-14 13:06:58 -01:00
|
|
|
return items;
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the root/top <see cref="IDictionaryItem"/> objects
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>An enumerable list of <see cref="IDictionaryItem"/> objects</returns>
|
|
|
|
|
public IEnumerable<IDictionaryItem> GetRootDictionaryItems()
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var query = Query<IDictionaryItem>.Builder.Where(x => x.ParentId == RootParentId);
|
|
|
|
|
var items = repository.GetByQuery(query);
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2012-12-14 13:06:58 -01:00
|
|
|
return items;
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Checks if a <see cref="IDictionaryItem"/> with given key exists
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="key">Key of the <see cref="IDictionaryItem"/></param>
|
|
|
|
|
/// <returns>True if a <see cref="IDictionaryItem"/> exists, otherwise false</returns>
|
|
|
|
|
public bool DictionaryItemExists(string key)
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var query = Query<IDictionaryItem>.Builder.Where(x => x.ItemKey == key);
|
|
|
|
|
var items = repository.GetByQuery(query);
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2012-12-14 13:06:58 -01:00
|
|
|
return items.Any();
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves a <see cref="IDictionaryItem"/> object
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to save</param>
|
2012-12-10 14:53:36 -01:00
|
|
|
/// <param name="userId">Optional id of the user saving the dictionary item</param>
|
2013-01-25 08:58:21 -01:00
|
|
|
public void Save(IDictionaryItem dictionaryItem, int userId = 0)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-15 21:04:17 +05:00
|
|
|
if (SavingDictionaryItem.IsRaisedEventCancelled(new SaveEventArgs<IDictionaryItem>(dictionaryItem), this))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var uow = _uowProvider.GetUnitOfWork();
|
|
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(uow))
|
|
|
|
|
{
|
|
|
|
|
repository.AddOrUpdate(dictionaryItem);
|
|
|
|
|
uow.Commit();
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-10 14:48:31 +01:00
|
|
|
SavedDictionaryItem.RaiseEvent(new SaveEventArgs<IDictionaryItem>(dictionaryItem, false), this);
|
|
|
|
|
|
2013-01-25 08:58:21 -01:00
|
|
|
Audit.Add(AuditTypes.Save, "Save DictionaryItem performed by user", userId, dictionaryItem.Id);
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes a <see cref="IDictionaryItem"/> object and its related translations
|
|
|
|
|
/// as well as its children.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to delete</param>
|
2012-12-10 14:53:36 -01:00
|
|
|
/// <param name="userId">Optional id of the user deleting the dictionary item</param>
|
2013-01-25 08:58:21 -01:00
|
|
|
public void Delete(IDictionaryItem dictionaryItem, int userId = 0)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-16 07:43:03 +05:00
|
|
|
if (DeletingDictionaryItem.IsRaisedEventCancelled(new DeleteEventArgs<IDictionaryItem>(dictionaryItem), this))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var uow = _uowProvider.GetUnitOfWork();
|
|
|
|
|
using (var repository = _repositoryFactory.CreateDictionaryRepository(uow))
|
|
|
|
|
{
|
|
|
|
|
//NOTE: The recursive delete is done in the repository
|
|
|
|
|
repository.Delete(dictionaryItem);
|
|
|
|
|
uow.Commit();
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-10 14:48:31 +01:00
|
|
|
DeletedDictionaryItem.RaiseEvent(new DeleteEventArgs<IDictionaryItem>(dictionaryItem, false), this);
|
|
|
|
|
|
2013-01-25 08:58:21 -01:00
|
|
|
Audit.Add(AuditTypes.Delete, "Delete DictionaryItem performed by user", userId, dictionaryItem.Id);
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a <see cref="Language"/> by its id
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id">Id of the <see cref="Language"/></param>
|
|
|
|
|
/// <returns><see cref="Language"/></returns>
|
|
|
|
|
public ILanguage GetLanguageById(int id)
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateLanguageRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
return repository.Get(id);
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a <see cref="Language"/> by its culture code
|
|
|
|
|
/// </summary>
|
2014-01-10 14:48:31 +01:00
|
|
|
/// <param name="cultureName">Culture Name - also refered to as the Friendly name</param>
|
|
|
|
|
/// <returns><see cref="Language"/></returns>
|
|
|
|
|
public ILanguage GetLanguageByCultureCode(string cultureName)
|
|
|
|
|
{
|
|
|
|
|
using (var repository = _repositoryFactory.CreateLanguageRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var query = Query<ILanguage>.Builder.Where(x => x.CultureName == cultureName);
|
|
|
|
|
var items = repository.GetByQuery(query);
|
|
|
|
|
|
|
|
|
|
return items.FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a <see cref="Language"/> by its iso code
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="isoCode">Iso Code of the language (ie. en-US)</param>
|
2012-10-24 12:22:52 -02:00
|
|
|
/// <returns><see cref="Language"/></returns>
|
2014-01-10 14:48:31 +01:00
|
|
|
public ILanguage GetLanguageByIsoCode(string isoCode)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateLanguageRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
2014-01-10 14:48:31 +01:00
|
|
|
var query = Query<ILanguage>.Builder.Where(x => x.IsoCode == isoCode);
|
2012-12-14 13:06:58 -01:00
|
|
|
var items = repository.GetByQuery(query);
|
2012-10-24 12:22:52 -02:00
|
|
|
|
2012-12-14 13:06:58 -01:00
|
|
|
return items.FirstOrDefault();
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets all available languages
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>An enumerable list of <see cref="ILanguage"/> objects</returns>
|
|
|
|
|
public IEnumerable<ILanguage> GetAllLanguages()
|
|
|
|
|
{
|
2012-12-14 13:06:58 -01:00
|
|
|
using (var repository = _repositoryFactory.CreateLanguageRepository(_uowProvider.GetUnitOfWork()))
|
|
|
|
|
{
|
|
|
|
|
var languages = repository.GetAll();
|
|
|
|
|
return languages;
|
|
|
|
|
}
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Saves a <see cref="ILanguage"/> object
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="language"><see cref="ILanguage"/> to save</param>
|
2012-12-10 14:53:36 -01:00
|
|
|
/// <param name="userId">Optional id of the user saving the language</param>
|
2013-01-25 08:58:21 -01:00
|
|
|
public void Save(ILanguage language, int userId = 0)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-15 21:04:17 +05:00
|
|
|
if (SavingLanguage.IsRaisedEventCancelled(new SaveEventArgs<ILanguage>(language), this))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var uow = _uowProvider.GetUnitOfWork();
|
|
|
|
|
using (var repository = _repositoryFactory.CreateLanguageRepository(uow))
|
|
|
|
|
{
|
|
|
|
|
repository.AddOrUpdate(language);
|
|
|
|
|
uow.Commit();
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-10 14:48:31 +01:00
|
|
|
SavedLanguage.RaiseEvent(new SaveEventArgs<ILanguage>(language, false), this);
|
|
|
|
|
|
2013-01-25 08:58:21 -01:00
|
|
|
Audit.Add(AuditTypes.Save, "Save Language performed by user", userId, language.Id);
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Deletes a <see cref="ILanguage"/> by removing it (but not its usages) from the db
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="language"><see cref="ILanguage"/> to delete</param>
|
2012-12-10 14:53:36 -01:00
|
|
|
/// <param name="userId">Optional id of the user deleting the language</param>
|
2013-01-25 08:58:21 -01:00
|
|
|
public void Delete(ILanguage language, int userId = 0)
|
2012-10-24 12:22:52 -02:00
|
|
|
{
|
2012-12-16 07:43:03 +05:00
|
|
|
if (DeletingLanguage.IsRaisedEventCancelled(new DeleteEventArgs<ILanguage>(language), this))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
var uow = _uowProvider.GetUnitOfWork();
|
|
|
|
|
using (var repository = _repositoryFactory.CreateLanguageRepository(uow))
|
|
|
|
|
{
|
|
|
|
|
//NOTE: There isn't any constraints in the db, so possible references aren't deleted
|
|
|
|
|
repository.Delete(language);
|
|
|
|
|
uow.Commit();
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-10 14:48:31 +01:00
|
|
|
DeletedLanguage.RaiseEvent(new DeleteEventArgs<ILanguage>(language, false), this);
|
|
|
|
|
|
2013-01-25 08:58:21 -01:00
|
|
|
Audit.Add(AuditTypes.Delete, "Delete Language performed by user", userId, language.Id);
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
2012-12-10 14:53:36 -01:00
|
|
|
|
|
|
|
|
#region Event Handlers
|
2012-12-16 07:43:03 +05:00
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs before Delete
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static event TypedEventHandler<ILocalizationService, DeleteEventArgs<ILanguage>> DeletingLanguage;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs after Delete
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static event TypedEventHandler<ILocalizationService, DeleteEventArgs<ILanguage>> DeletedLanguage;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-12-10 14:53:36 -01:00
|
|
|
/// Occurs before Delete
|
|
|
|
|
/// </summary>
|
2012-12-16 07:43:03 +05:00
|
|
|
public static event TypedEventHandler<ILocalizationService, DeleteEventArgs<IDictionaryItem>> DeletingDictionaryItem;
|
2012-12-10 14:53:36 -01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs after Delete
|
|
|
|
|
/// </summary>
|
2012-12-16 07:43:03 +05:00
|
|
|
public static event TypedEventHandler<ILocalizationService, DeleteEventArgs<IDictionaryItem>> DeletedDictionaryItem;
|
2012-12-10 14:53:36 -01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs before Save
|
|
|
|
|
/// </summary>
|
2012-12-15 21:04:17 +05:00
|
|
|
public static event TypedEventHandler<ILocalizationService, SaveEventArgs<IDictionaryItem>> SavingDictionaryItem;
|
2012-12-10 14:53:36 -01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs after Save
|
|
|
|
|
/// </summary>
|
2012-12-15 21:04:17 +05:00
|
|
|
public static event TypedEventHandler<ILocalizationService, SaveEventArgs<IDictionaryItem>> SavedDictionaryItem;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs before Save
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static event TypedEventHandler<ILocalizationService, SaveEventArgs<ILanguage>> SavingLanguage;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Occurs after Save
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static event TypedEventHandler<ILocalizationService, SaveEventArgs<ILanguage>> SavedLanguage;
|
2012-12-10 14:53:36 -01:00
|
|
|
#endregion
|
2012-10-24 12:22:52 -02:00
|
|
|
}
|
|
|
|
|
}
|