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); }
public void Dispose() { if (_tool != null) { MayBeEmptyTempContext <T> .Release(_tool); _tool = default; } }
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)); }
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)); }
internal MayBeEmptyTempContext(out T tool) { MayBeEmptyTempContext <T> .GetFreeItem(out _tool); tool = _tool; }