public LinePointer CreateLinePoint(string name, bool previous = false) { var line = new Line("", deeps); LinkedListNode <Line> node; if (previous) { node = lines.AddBefore(pointer.Last(), line); } else if (pointers.Count > 0) { node = lines.AddAfter(pointer.Last(), line); } else { node = lines.AddLast(line); } if (pointers.Count > 0) { pointer.Move(node); } var newPointer = new LinePointer(name, node); pointerDic[name] = newPointer; return(newPointer); }
public void UsePointer(LinePointer pointer) { if (pointer == null) { return; } pointers.Push(pointer); }
public void UnUsePointer(LinePointer pointer) { if (pointer == null) { return; } if (pointers.Peek() == pointer) { pointers.Pop(); } }
public LP(LinePointer _pointer) { writer = CS.Writer; pointer = _pointer; writer.UsePointer(pointer); }