SIL.FieldWorks.Common.Framework.DetailControls.Slice.Slice.HandleDeleteReferenceCommand C# (CSharp) Méthode

HandleDeleteReferenceCommand() public méthode

Handle a "Delete Reference" command. Currently implemented only for the VariantEntryBackRefs / LexEntry/EntryRefs/ComponentLexemes references.
public HandleDeleteReferenceCommand ( Command cmd ) : void
cmd Command
Résultat void
		public virtual void HandleDeleteReferenceCommand(Command cmd)
		{
			CheckDisposed();
			if (NextSlice != null && NextSlice.Object != null)
			{
				var ler = NextSlice.Object as ILexEntryRef;
				if (ler != null)
				{
					UndoableUnitOfWorkHelper.Do(DetailControlsStrings.ksUndoDeleteRef, DetailControlsStrings.ksRedoDeleteRef, ler, () =>
					{
						ler.ComponentLexemesRS.Remove(ContainingDataTree.Root);
						// probably not needed, but safe...
						if (ler.PrimaryLexemesRS.Contains(ContainingDataTree.Root))
							ler.PrimaryLexemesRS.Remove(ContainingDataTree.Root);
					});
				}
			}
		}