Ejemplo n.º 1
0
		/// <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");
			WeakLineTracker wlt = new WeakLineTracker(textDocument, targetTracker);
			textDocument.LineTrackers.Add(wlt);
			return wlt;
		}
Ejemplo n.º 2
0
        void ILineTracker.SetLineLength(DocumentLine line, int newTotalLength)
        {
            ILineTracker targetTracker = targetObject.Target as ILineTracker;

            if (targetTracker != null)
            {
                targetTracker.SetLineLength(line, newTotalLength);
            }
            else
            {
                Deregister();
            }
        }
Ejemplo n.º 3
0
        void ILineTracker.BeforeRemoveLine(DocumentLine line)
        {
            ILineTracker targetTracker = targetObject.Target as ILineTracker;

            if (targetTracker != null)
            {
                targetTracker.BeforeRemoveLine(line);
            }
            else
            {
                Deregister();
            }
        }
Ejemplo n.º 4
0
        void ILineTracker.RebuildDocument()
        {
            ILineTracker targetTracker = targetObject.Target as ILineTracker;

            if (targetTracker != null)
            {
                targetTracker.RebuildDocument();
            }
            else
            {
                Deregister();
            }
        }
        void ILineTracker.LineInserted(DocumentLine insertionPos, DocumentLine newLine)
        {
            ILineTracker targetTracker = targetObject.Target as ILineTracker;

            if (targetTracker != null)
            {
                targetTracker.LineInserted(insertionPos, newLine);
            }
            else
            {
                Deregister();
            }
        }
        void ILineTracker.ChangeComplete(DocumentChangeEventArgs e)
        {
            ILineTracker targetTracker = targetObject.Target as ILineTracker;

            if (targetTracker != null)
            {
                targetTracker.ChangeComplete(e);
            }
            else
            {
                Deregister();
            }
        }
Ejemplo n.º 7
0
        /// <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");
            }
            WeakLineTracker wlt = new WeakLineTracker(textDocument, targetTracker);

            textDocument.LineTrackers.Add(wlt);
            return(wlt);
        }
Ejemplo n.º 8
0
 private WeakLineTracker(TextDocument textDocument, ILineTracker targetTracker)
 {
     this.textDocument = textDocument;
     this.targetObject = new WeakReference(targetTracker);
 }
Ejemplo n.º 9
0
		private WeakLineTracker(TextDocument textDocument, ILineTracker targetTracker)
		{
			this.textDocument = textDocument;
			this.targetObject = new WeakReference(targetTracker);
		}
Ejemplo n.º 10
0
		public WeakLineTracker(TextDocument document, ILineTracker tracker)
		{
		}