SIL.FieldWorks.Common.RootSites.CollectorEnv.AddObj C# (CSharp) Method

AddObj() public method

Adds the obj.
public AddObj ( int hvoItem, IVwViewConstructor vc, int frag ) : void
hvoItem int The hvo item.
vc IVwViewConstructor The vc.
frag int The frag.
return void
		public virtual void AddObj(int hvoItem, IVwViewConstructor vc, int frag)
		{
			if (Finished)
				return;
			bool wasPropOpen = m_fIsPropOpen;
			if (!m_fIsPropOpen)
			{
				// AddObj in the middle of an arbitrary object is treated as the phony property NotAnAttr.
				// If a property is already open (AddObjVec), we treat it as one of the objects in
				// that property.
				OpenProp((int) VwSpecialAttrTags.ktagNotAnAttr);
			}

			int ihvo;
			if (m_vectorItemIndex.TryGetValue(m_tagCurrent, out ihvo))
				m_vectorItemIndex[m_tagCurrent] = ++ihvo;
			else
				ihvo = 0; // not a vector item.
			OpenTheObject(hvoItem, ihvo);
			vc.Display(this, hvoItem, frag);
			CloseTheObject();
			if (!wasPropOpen)
				CloseProp();
		}