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

AddObjVecItems() public method

public AddObjVecItems ( int tag, IVwViewConstructor vc, int frag ) : void
tag int
vc IVwViewConstructor
frag int
return void
		public virtual void AddObjVecItems(int tag, IVwViewConstructor vc, int frag)
		{
			if (Finished)
				return;
			OpenProp(tag);
			int[] items = null;
			var managedSda = m_sda as ISilDataAccessManaged;
			int cobj;
			if (managedSda != null)
			{
				// If the vector should be virtual, we have to compute it only once.
				// Note: we COULD do this with the VecProp method of the regular ISilDataAccess.
				// But in practice the SDA will (almost?) always be a managed one, and using the
				// COM VecProp involves marshalling that is messy and slow on both sides.
				items = managedSda.VecProp(m_hvoCurr, tag);
				cobj = items.Length;
			}
			else
			{
				cobj = m_sda.get_VecSize(m_hvoCurr, tag);
			}

			for (int i = 0; i < cobj; i++)
			{
				int hvoItem;
				if (items == null)
					hvoItem = m_sda.get_VecItem(m_hvoCurr, tag, i);
				else
					hvoItem = items[i];
				if (DisplayThisObject(hvoItem, tag))
				{
					OpenTheObject(hvoItem, i);
					vc.Display(this, hvoItem, frag);
					CloseTheObject();
				}
				if (Finished)
					break;
			}

			CloseProp();
		}