Example #1
0
		protected int InsertContextInto(IPhSimpleContext ctxt, int fsFlid, int fsHvo, SelectionHelper sel,
			FdoOwningSequence<IPhSimpleContext> seq)
		{
			int[] hvos = seq.HvoArray;
			int index = GetInsertionIndex(hvos, sel);
			// if the current selection is a range remove the items we are overwriting
			if (sel.IsRange)
			{
				int[] indices = GetIndicesToRemove(hvos, sel);
				foreach (int idx in indices)
				{
					if (seq.Contains(hvos[idx]))
					{
						IPhSimpleContext removeCtxt = PhSimpleContext.CreateFromDBObject(m_cache, hvos[idx]);
						removeCtxt.DeleteUnderlyingObject();
					}
				}
			}
			seq.InsertAt(ctxt, index);
			m_cache.SetObjProperty(ctxt.Hvo, fsFlid, fsHvo);
			ctxt.NotifyNew();
			return index;
		}