private void setFirstNodeY(NodeY node, int type) { if (type == 3) { setNodeY(node.Number, getNodeY(node.PrecedenceWork) + DFY); if (node.PrecedenceWork == 1 || nodeList.Where(c => c.Number == node.PrecedenceWork).SingleOrDefault().Precedence == "1") { tightAll = new List <string>(); findAllTight(Convert.ToString(node.PrecedenceWork)); } string keys = node.PrecedenceWork.ToString() + "." + type.ToString(); for (int i = node.Number - 1; i > 0; i--) { if (!tightAll.Contains(i.ToString()) && getNodeY(node.Number) <= getNodeY(i)) { setNodeY(i, getNodeY(i) + DFY); } } setCalcNode(node.PrecedenceWork, type); } else if (type == 1) { setNodeY(node.Number, getNodeY(node.PrecedenceWork)); for (int i = node.Number - 1; i > 0; i--) { setNodeY(i, getNodeY(i) + DFY); } setCalcNode(node.PrecedenceWork, type); } }
private void setNodeList(int number, string precedence, string tight, int precedenceWork, Double Y) { nodeList.Remove(nodeList.Where(c => c.Number == number).SingleOrDefault()); NodeY node = new NodeY(); node.Number = number; node.Precedence = precedence; node.Tight = tight; node.PrecedenceWork = precedenceWork; node.Y = Y; nodeList.Add(node); }