Esempio n. 1
0
 public LineBoxesContext(CustomRenderBox owner)
 {
     //set owner element if we want to preserver linebox ***
     _owner   = owner;
     _context = LayoutTools.BorrowList(out _lineboxes);
     _sharedLineBoxContextListContext = LayoutTools.BorrowList(out _sharedLineBoxContexts);
 }
Esempio n. 2
0
        public void Dispose()
        {
            if (_tool != null)
            {
                MayBeEmptyTempContext <T> .Release(_tool);

                _tool = default;
            }
        }
Esempio n. 3
0
 public static MayBeEmptyTempContext <List <T> > BorrowList <T>(out List <T> linkedlist)
 {
     if (!MayBeEmptyTempContext <List <T> > .IsInit())
     {
         MayBeEmptyTempContext <List <T> > .SetNewHandler(
             () => new List <T>(),
             list => list.Clear());
     }
     return(MayBeEmptyTempContext <List <T> > .Borrow(out linkedlist));
 }
Esempio n. 4
0
 public static MayBeEmptyTempContext <LineBox> BorrowLineBox(out LineBox linebox)
 {
     if (!MayBeEmptyTempContext <LineBox> .IsInit())
     {
         MayBeEmptyTempContext <LineBox> .SetNewHandler(
             () => new LineBox(),
             line => line.Reset());
     }
     return(MayBeEmptyTempContext <LineBox> .Borrow(out linebox));
 }
Esempio n. 5
0
        internal MayBeEmptyTempContext(out T tool)
        {
            MayBeEmptyTempContext <T> .GetFreeItem(out _tool);

            tool = _tool;
        }