Ejemplo n.º 1
0
 /// <summary>
 /// Register a PropChanged for the SubrecordOf property of all your subrecords (after and including
 /// the one at indexOfFirstChildToNote) and their children
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="indexOfFirstChildToNote"></param>
 void NoteSubrecordOfChanges(RnGenericRec parent, int indexOfFirstChildToNote)
 {
     for (int i = indexOfFirstChildToNote; i < parent.SubRecordsOS.Count; i++)
     {
         var child = (RnGenericRec)parent.SubRecordsOS[i];
         InternalServices.UnitOfWorkService.RegisterVirtualAsModified(child, "SubrecordOf", child.SubrecordOf);
         NoteSubrecordOfChanges(child, 0);
     }
 }
Ejemplo n.º 2
0
		private IRnGenericRec Create(ICollection<IRnGenericRec> owningCollection, ITsString title, ICmPossibility type)
		{
			var newRecord = new RnGenericRec();
			owningCollection.Add(newRecord);
			newRecord.TypeRA = type;
			newRecord.Title = title;
			newRecord.ParticipantsOC.Add(m_cache.ServiceLocator.GetInstance<IRnRoledParticFactory>().Create());
			var textFactory = m_cache.ServiceLocator.GetInstance<IStTextFactory>();
			newRecord.ConclusionsOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.ConclusionsOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.DescriptionOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.DescriptionOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.DiscussionOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.DiscussionOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.ExternalMaterialsOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.ExternalMaterialsOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.FurtherQuestionsOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.FurtherQuestionsOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.HypothesisOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.HypothesisOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.PersonalNotesOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.PersonalNotesOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.ResearchPlanOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.ResearchPlanOA, "Normal", m_cache.DefaultAnalWs);
			newRecord.VersionHistoryOA = textFactory.Create();
			StTxtParaBldr.CreateEmptyPara(m_cache, newRecord.VersionHistoryOA, "Normal", m_cache.DefaultAnalWs);
			return newRecord;
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Register a PropChanged for the SubrecordOf property of all your subrecords (after and including
		/// the one at indexOfFirstChildToNote) and their children
		/// </summary>
		/// <param name="parent"></param>
		/// <param name="indexOfFirstChildToNote"></param>
		void NoteSubrecordOfChanges(RnGenericRec parent, int indexOfFirstChildToNote)
		{
			for (int i = indexOfFirstChildToNote; i < parent.SubRecordsOS.Count; i++)
			{
				var child = (RnGenericRec)parent.SubRecordsOS[i];
				InternalServices.UnitOfWorkService.RegisterVirtualAsModified(child, "SubrecordOf", child.SubrecordOf);
				NoteSubrecordOfChanges(child, 0);
			}
		}