/// <summary> /// Registers the <paramref name="targetTracker" /> as line tracker for the <paramref name="textDocument" />. /// A weak reference to the target tracker will be used, and the WeakLineTracker will deregister itself /// when the target tracker is garbage collected. /// </summary> public static WeakLineTracker Register(TextDocument textDocument, ILineTracker targetTracker) { if (textDocument == null) throw new ArgumentNullException("textDocument"); if (targetTracker == null) throw new ArgumentNullException("targetTracker"); var wlt = new WeakLineTracker(textDocument, targetTracker); textDocument.LineTrackers.Add(wlt); return wlt; }
/// <summary> /// Registers the <paramref name="targetTracker" /> as line tracker for the <paramref name="textDocument" />. /// A weak reference to the target tracker will be used, and the WeakLineTracker will deregister itself /// when the target tracker is garbage collected. /// </summary> public static WeakLineTracker Register(TextDocument textDocument, ILineTracker targetTracker) { if (textDocument == null) { throw new ArgumentNullException("textDocument"); } if (targetTracker == null) { throw new ArgumentNullException("targetTracker"); } var wlt = new WeakLineTracker(textDocument, targetTracker); textDocument.LineTrackers.Add(wlt); return(wlt); }