Example #1
0
		internal override void RegisterVirtualsModifiedForObjectDeletion(IUnitOfWorkService uow)
		{
			var cache = Cache; // need to make the Func use this local variable, because on Redo, Cache may return null.
			uow.RegisterVirtualCollectionAsModified(Cache.LangProject,
				Cache.ServiceLocator.GetInstance<Virtuals>().LangProjectAllWordforms,
				() => cache.ServiceLocator.GetInstance<IWfiWordformRepository>().AllInstances(),
				new IWfiWordform[0], new[] { this });
			base.RegisterVirtualsModifiedForObjectDeletion(uow);
		}
Example #2
0
		/// <summary>
		/// This registers LangProjTexts for undo/redo propchanges during creation
		/// so InterestingTexts.PropChanged gets called to add the text to the record list.
		/// </summary>
		/// <param name="uow"></param>
		internal override void RegisterVirtualsModifiedForObjectCreation(IUnitOfWorkService uow)
		{
			base.RegisterVirtualsModifiedForObjectCreation(uow);
			var cache = Cache; // need to make the Func use this local variable, because on Undo, Cache may return null.
			uow.RegisterVirtualCollectionAsModified(Cache.LangProject,
				Cache.ServiceLocator.GetInstance<Virtuals>().LangProjTexts,
				() => cache.ServiceLocator.GetInstance<ITextRepository>().AllInstances(),
				new[] { this }, new IText[0]);
		}