protected IEnumerable <BindThumb> GetBindThumbs(BindOptions option) { switch (option) { case BindOptions.Input: return(InputThumbs); case BindOptions.Output: return(OutputThumbs); case BindOptions.Parameter: return(ParameterThumbs); case BindOptions.Return: return(ReturnThumbs); case BindOptions.Output | BindOptions.Return: return(OutputThumbs.Concat(ReturnThumbs)); case BindOptions.Input | BindOptions.Parameter: return(InputThumbs.Concat(ParameterThumbs)); } return(Enumerable.Empty <BindThumb>()); }
private void EnsureRemoveThumb(IBinder binder) { if (binder is PBinder binderModel) { var thumb = binderModel.GetView <BindThumb>(); if (thumb != null) { switch (binder.BindOption) { case BindOptions.Input: InputThumbs.Remove(thumb); break; case BindOptions.Output: OutputThumbs.Remove(thumb); break; case BindOptions.Parameter: ParameterThumbs.Remove(thumb); break; case BindOptions.Return: ReturnThumbs.Remove(thumb); break; } } } }
// Trigger In / Out Thumb private void AddTriggerThumb(PBinder binder) { var thumb = new BindThumb(binder); if (binder.BindOption == BindOptions.Input) { InputThumbs.Add(thumb); } else { OutputThumbs.Add(thumb); } AddThumbCore(thumb); }