private void OnTextSpansChanged(
            object sender,
            BlockEventArgs e)
        {
            int blockIndex = blocks.IndexOf(e.Block);
            var args       = new LineChangedArgs(blockIndex);

            RaiseLineChanged(args);
        }
        /// <summary>
        /// Raises the <see cref="LineChanged"/> event
        /// </summary>
        /// <param name="e">The e.</param>
        protected virtual void RaiseLineChanged(LineChangedArgs e)
        {
            EventHandler <LineChangedArgs> listeners = LineChanged;

            if (listeners != null)
            {
                listeners(this, e);
            }
        }
 /// <summary>
 /// Called when a single line changes.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The event arguments.</param>
 private void OnLineChanged(
     object sender,
     LineChangedArgs args)
 {
     foreach (IndicatorLine indicatorLine in indicatorLines)
     {
         if (args.LineIndex >= indicatorLine.StartLineIndex &&
             args.LineIndex <= indicatorLine.EndLineIndex)
         {
             indicatorLine.Reset();
             StartBackgroundUpdate();
         }
     }
 }
        /// <summary>
        /// Processes the line changed. This will never be called inside the
        /// access' write lock.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        private void ProcessLineChanged(
            object sender,
            LineChangedArgs args)
        {
            // Make sure we're on the proper thread.
            CheckGuiThread();

            // Get the line and reset it.
            CachedLine line = lines[args.LineIndex];

            line.Reset();

            // Call the base implementation to cascade the events up.
            base.OnLineChanged(sender, args);
        }
        /// <summary>
        /// Called when a line is changed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The args.</param>
        protected override void OnLineChanged(
            object sender,
            LineChangedArgs args)
        {
            // Queue up a line change since we need to keep track of the changes
            // but this might be called while another thread is locked.
            QueueLineEvent(() => ProcessLineChanged(sender, args));

            // Attempt to resolve the updates. This will do nothing if a lock
            // is currently acquired.
            Application.Invoke(ProcessQueuedLineChanges);

            // Start the background cacher to handle the lines that aren't
            // visible on screen.
            backgroundUpdater.Restart();
        }
        /// <summary>
        /// Performs the set text operation on the buffer.
        /// </summary>
        /// <param name="operation">The operation to perform.</param>
        /// <returns>
        /// The results to the changes to the buffer.
        /// </returns>
        protected override LineBufferOperationResults Do(SetTextOperation operation)
        {
            // Set the text of the line.
            lines[operation.LineIndex] = operation.Text;

            // Fire a line changed operation.
            var lineChangedArgs = new LineChangedArgs(operation.LineIndex);

            RaiseLineChanged(lineChangedArgs);

            // Return the appropriate results.
            var bufferPosition = new TextPosition(
                operation.LineIndex, CharacterPosition.End);
            var results = new LineBufferOperationResults(bufferPosition);

            return(results);
        }
        private void OnTextSpansChanged(
			object sender,
			BlockEventArgs e)
        {
            int blockIndex = blocks.IndexOf(e.Block);
            var args = new LineChangedArgs(blockIndex);
            RaiseLineChanged(args);
        }
Beispiel #8
0
 /// <summary>
 /// Called when a line changes in the underlying buffer.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The e.</param>
 protected virtual void OnLineChanged(
     object sender,
     LineChangedArgs e)
 {
     RaiseLineChanged(e);
 }
Beispiel #9
0
 /// <summary>
 /// Called when the line changed.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The args.</param>
 private void OnLineChanged(
     object sender,
     LineChangedArgs args)
 {
     RequestRedraw();
 }