/// <summary> /// 试图绑定绳子 /// </summary> /// <param name="arg0"></param> protected override void OnRegistElement(ISupportElement arg0) { if (ropeItem == null && arg0 is RopeItem) { ropeItem = arg0 as RopeItem; if (Started && ropeItem.BindingTarget == null) { ropeItem.StepActive(); ropeItem.BindingTarget = this; } } }
/// <summary> /// 找到或创建绳索 /// </summary> private void TryFindAnRopeItem() { var ropes = elementCtrl.GetElements <RopeItem>(Name); if (ropes != null) { ropeItem = ropes.Find(x => x.BindingTarget == this || x.BindingTarget == null); } if (ropeItem != null) { ropeItem.BindingTarget = this; ropeItem.StepActive(); } }