private bool SetEnabledIfFindSlotInSequence(IFdoReferenceSequence<IMoInflAffixSlot> slots, out bool fEnabled, bool bIsLeft) { var index = slots.IndexOf(m_obj as IMoInflAffixSlot); if (index >= 0) { // it was found bool bAtEdge; if (bIsLeft) bAtEdge = (index == 0); else bAtEdge = (index == slots.Count - 1); if (bAtEdge || slots.Count == 1) fEnabled = false; // Cannot move it left when it's at the left edge or there's only one else fEnabled = true; return true; } else { fEnabled = false; return false; } }