SIL.FieldWorks.XWorks.DTMenuHandler.OnDisplayMoveDownObjectInSequence C# (CSharp) Method

OnDisplayMoveDownObjectInSequence() private method

private OnDisplayMoveDownObjectInSequence ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool
		public virtual bool OnDisplayMoveDownObjectInSequence(object commandObject,
			ref UIItemDisplayProperties display)
		{
			Slice slice = m_dataEntryForm.CurrentSlice;
			Debug.Assert(slice == null || !slice.IsDisposed, "The current slice is already disposed??");
			if (slice == null || slice.Object == null)
			{
				display.Enabled = false;
				display.Visible = false;
				return true;
			}
			FdoCache cache = m_dataEntryForm.Cache;
			IFwMetaDataCache mdc = cache.DomainDataByFlid.MetaDataCache;
			// FWR-2742 Handle a slice Object (like LexEntry) being unowned (and OwningFlid = 0)
			var type = CellarPropertyType.ReferenceAtomic;
			if (slice.Object.OwningFlid > 0)
				type = (CellarPropertyType)cache.DomainDataByFlid.MetaDataCache.GetFieldType(slice.Object.OwningFlid);
			if (type != CellarPropertyType.OwningSequence && type != CellarPropertyType.ReferenceSequence)
			{
				display.Enabled = false;
				display.Visible = false;
				return true;
			}
			int chvo = cache.DomainDataByFlid.get_VecSize(slice.Object.Owner.Hvo, (int)slice.Object.OwningFlid);
			if (chvo < 2)
			{
				display.Enabled = false;
			}
			else
			{
				int hvo = cache.DomainDataByFlid.get_VecItem(slice.Object.Owner.Hvo, (int)slice.Object.OwningFlid,
					chvo - 1);
				display.Enabled = slice.Object.Hvo != hvo;
			}
			display.Visible = true;
			return true; //we've handled this
		}