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

OnDisplayDataTreeDeleteReference() private method

private OnDisplayDataTreeDeleteReference ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
return bool
		public virtual bool OnDisplayDataTreeDeleteReference(object commandObject,
			ref UIItemDisplayProperties display)
		{
			Slice current = m_dataEntryForm.CurrentSlice;
			if (current == null || current.Object == null || current.IsGhostSlice)
			{
				display.Enabled = false;
				display.Visible = false;
				return true;
			}
			Command command = (Command)commandObject;
			display.Enabled = current != null && current.CanDeleteReferenceNow(command);
			if (!display.Enabled)
				display.Text += StringTbl.GetString("(cannot delete this)");
			return true;//we handled this, no need to ask anyone else.
		}