Esempio n. 1
0
		private ILexReference CreateSeqRefToSense(IActionHandler stack, ILexSense ls, bool createReferringObjInSameUow)
		{
			ILexReference lr = null;
			UndoableUnitOfWorkHelper.Do("Undo create referring item on new stack", "Redo",
				stack,
				() =>
				{
					var list = Cache.LangProject.LexDbOA.ReferencesOA;
					if (list == null)
					{
						list = Cache.ServiceLocator.GetInstance<ICmPossibilityListFactory>().Create();
						Cache.LangProject.LexDbOA.ReferencesOA = list;
					}
					var lrt = Cache.ServiceLocator.GetInstance<ILexRefTypeFactory>().Create();
					list.PossibilitiesOS.Add(lrt);
					lr = Cache.ServiceLocator.GetInstance<ILexReferenceFactory>().Create();
					lrt.MembersOC.Add(lr);
					if (!createReferringObjInSameUow)
						stack.BreakUndoTask("undo setting ref", "redo setting ref");
					lr.TargetsRS.Add(ls);
				});
			return lr;
		}
Esempio n. 2
0
		private IWfiMorphBundle CreateAtomicRefToSense(IActionHandler stack, ILexSense ls, bool createReferringObjInSameUow)
		{
			IWfiMorphBundle mb = null;
			UndoableUnitOfWorkHelper.Do("Undo create referring item on new stack", "Redo",
				stack,
				() =>
					{
						var wf = Cache.ServiceLocator.GetInstance<IWfiWordformFactory>().Create();
						var wa = Cache.ServiceLocator.GetInstance<IWfiAnalysisFactory>().Create();
						wf.AnalysesOC.Add(wa);
						mb = Cache.ServiceLocator.GetInstance<IWfiMorphBundleFactory>().Create();
						wa.MorphBundlesOS.Add(mb);
						if (!createReferringObjInSameUow)
							stack.BreakUndoTask("undo setting ref", "redo setting ref");
						mb.SenseRA = ls;
					});
			return mb;
		}