/// <summary> /// 初始化基本信息 /// </summary> protected override void InitBaseInfo() { base.InitBaseInfo(); ///创建函数入口代码块 FunctionEnterBox = CreateXCodeBox("方法入口", CenterPoint, CodeBox.XAType.XFunctionEnter); FunctionEnterBox.OpenButton = 2; FunctionEnterBox.AddXExcXAribute(); FunctionEnterBox.XAributeChangeMessage = () => { XAributeChangeMessage(this); };///属性消息变更通知 ///创建函数出口代码块 CodeBox functionExc = CreateXCodeBox("方法出口", new Point(CenterPoint.X + 250, CenterPoint.Y), CodeBox.XAType.XFunctionExc); functionExc.OpenButton = 1; functionExc.AddXEnterXAribute(); functionExc.XAributeChangeMessage = () => { XAributeChangeMessage(this); };///属性消息变更通知 ///保存函数出口代码块的地址 FunctionExcBox = functionExc; ///添加初始连线 XAribute FirstXa = FunctionEnterBox.GetRightExc()[0]; XAribute SecondXa = functionExc.GetLeftEnter(); BezierLine MyBezierLine = new BezierLine(CreateBezierID(), FirstXa.BorderColor, FirstXa.GetWorldPosition(), FirstXa.SelectPositionStyle); AddBezierLine(MyBezierLine); FirstXa.AddBezierLine(MyBezierLine); MyBezierLine.StartPoint.LinkAribute = FirstXa; SecondXa.AddBezierLine(MyBezierLine); MyBezierLine.EndPoint.LinkAribute = SecondXa; MyBezierLine.SetBezierLine(SecondXa.GetWorldPosition(), SecondXa.SelectPositionStyle); }
/// <summary> /// 解析前的一些判断 /// </summary> /// <param name="bute">上一个代码块的出口节点</param> /// <returns></returns> protected string AnalyticalCenterTool(XAribute bute) { XAribute target = bute.GetOtherXAribute(); CodeBox targetBox = (CodeBox)target.ParentControl; ///代码块入口 XAribute targetBoxEnter = targetBox.GetLeftEnter(); if (target.SelectType == XAribute.XAttributeType.XBreak) { if (targetBoxEnter != null && targetBoxEnter.GetMyBeziers.Count > 0) { return("break;" + LineBreaks); } else { return(""); } } else if (target != null) { return(AnalyticalNormal(targetBox)); } return(""); }