예제 #1
0
        /// <summary>
        /// Calls the <see cref="IActiveElement.Deactivate"/> method on all registered active elements.
        /// </summary>
        /// <param name="e">The EventArgs to use</param>
        public void Deactivate(SnippetEventArgs e)
        {
            if (currentStatus == Status.Deactivated || currentStatus == Status.RaisingDeactivated)
            {
                return;
            }
            if (currentStatus != Status.Interactive)
            {
                throw new InvalidOperationException("Cannot call Deactivate() until RaiseInsertionCompleted() has finished.");
            }
            if (e == null)
            {
                e = new SnippetEventArgs(DeactivateReason.Unknown);
            }

            TextDocumentWeakEventManager.UpdateFinished.RemoveListener(Document, this);
            currentStatus = Status.RaisingDeactivated;
            TextArea.PopStackedInputHandler(myInputHandler);
            foreach (IActiveElement element in registeredElements)
            {
                element.Deactivate(e);
            }
            if (Deactivated != null)
            {
                Deactivated(this, e);
            }
            currentStatus = Status.Deactivated;
        }
예제 #2
0
 public void Deactivate(SnippetEventArgs e)
 {
     TextDocumentWeakEventManager.TextChanged.RemoveListener(context.Document, this);
     context.TextArea.TextView.BackgroundRenderers.Remove(background);
     context.TextArea.TextView.BackgroundRenderers.Remove(foreground);
     context.TextArea.Caret.PositionChanged -= Caret_PositionChanged;
 }
예제 #3
0
 public void Deactivate(SnippetEventArgs e)
 {
 }