// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
namespace Tango.Scripting.Editors.Document
{
/// <summary>
/// Allows registering a line tracker on a TextDocument using a weak reference from the document to the line tracker.
/// </summary>
public sealed class WeakLineTracker : ILineTracker
{
TextDocument textDocument;
WeakReference targetObject;
private WeakLineTracker(TextDocument textDocument, ILineTracker targetTracker)
{
this.textDocument = textDocument;
this.targetObject = new WeakReference(targetTracker);
}
/// <summary>
/// Registers the <paramref name="targetTracker"/> as line tracker for the <paramref name="textDoc