Example #1
0
        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);
        }
Example #2
0
 public void UsePointer(LinePointer pointer)
 {
     if (pointer == null)
     {
         return;
     }
     pointers.Push(pointer);
 }
Example #3
0
        public void UnUsePointer(LinePointer pointer)
        {
            if (pointer == null)
            {
                return;
            }

            if (pointers.Peek() == pointer)
            {
                pointers.Pop();
            }
        }
Example #4
0
 public LP(LinePointer _pointer)
 {
     writer  = CS.Writer;
     pointer = _pointer;
     writer.UsePointer(pointer);
 }