public IEnumerator SelectOnly(IEnumerable <VisualPayload> payloads) { IEnumerator iterator; UnSelectedList.AddRange(SelectedList); SelectedList.Clear(); foreach (var payload in payloads) { UnSelectedList.Remove(payload); SelectedList.Add(payload); payload.VisualData.Bound.ClearBounds(); iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } iterator = SendUnselected(); while (iterator.MoveNext()) { yield return(null); } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
public IEnumerator Select(VisualPayload payload) { bool sendNormal = !SelectedList.Any(); UnSelectedList.Remove(payload); SelectedList.Add(payload); payload.VisualData.Bound.ClearBounds(); var iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } if (sendNormal) { iterator = SendUnselected(); while (iterator.MoveNext()) { yield return(null); } } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
public IEnumerator Select(IEnumerable <VisualPayload> payloads) { if (!payloads.Any()) { yield return(null); yield break; } bool sendNormal = !SelectedList.Any(); IEnumerator iterator; foreach (var payload in payloads) { if (SelectedList.Contains(payload)) { continue; } UnSelectedList.Remove(payload); SelectedList.Add(payload); payload.VisualData.Bound.ClearBounds(); iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } if (sendNormal) { iterator = SendUnselected(); while (iterator.MoveNext()) { yield return(null); } } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }