Ejemplo n.º 1
0
        DelayData ShouldInstallDelayHandler()
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            IVsWindowFrame frame = ActiveFrame;

            if (frame != null)
            {
                IVsTextViewEx textView = GetTextView(frame) as IVsTextViewEx;

                if (textView != null)
                {
                    if (textView.IsCompletorWindowActive() == 0 || textView.IsExpansionUIActive() == 0)
                    {
                        return(new DelayData(textView));
                    }

                    return(null);
                }
            }

            IntPtr handle;

            if (IsEditBoxActive(out handle))
            {
                return(new DelayData(handle));
            }

            return(null);
        }
Ejemplo n.º 2
0
 public DelayData(IVsTextViewEx textView)
 {
     if (textView == null)
     {
         throw new ArgumentNullException("textView");
     }
     _textView = textView;
 }
Ejemplo n.º 3
0
        bool IsCompletorActive(IVsTextView view)
        {
            if (this.source.IsCompletorActive)
            {
                return(true);
            }

            IVsTextViewEx viewex = view as IVsTextViewEx;

            if (viewex != null)
            {
                return(viewex.IsCompletorWindowActive() == VSConstants.S_OK);
            }

            return(false);
        }
Ejemplo n.º 4
0
        public static Result <IVsWindowFrame> GetWindowFrame(this IVsTextViewEx textViewEx)
        {
            if (!ErrorHandler.Succeeded(textViewEx.GetWindowFrame(out object frame)))
            {
                return(Result.Error);
            }

            var vsWindowFrame = frame as IVsWindowFrame;

            if (vsWindowFrame == null)
            {
                return(Result.Error);
            }

            return(Result.CreateSuccess(vsWindowFrame));
        }
Ejemplo n.º 5
0
 public DelayData(IVsTextViewEx textView)
 {
     if (textView == null)
         throw new ArgumentNullException("textView");
     _textView = textView;
 }