Example #1
0
        internal static int ComputeTimeDelay(this TaggerDelay behavior, ITextBuffer textBufferOpt)
        {
            if (TextBufferAssociatedViewService.AnyAssociatedViewHasFocus(textBufferOpt))
            {
                // TODO : should we remove TaggerBehavior enum all together and put NearImmediateDelay
                // const in Interaction?
                switch (behavior)
                {
                case TaggerDelay.NearImmediate:
                    return(NearImmediateDelay);

                case TaggerDelay.Short:
                    return(ShortDelay);

                case TaggerDelay.Medium:
                    return(MediumDelay);

                case TaggerDelay.OnIdle:
                default:
                    return(IdleDelay);
                }
            }

            return(NonFocusDelay);
        }
Example #2
0
        internal static TimeSpan ComputeTimeDelay(this TaggerDelay behavior, ITextBuffer textBufferOpt)
        {
            if (TextBufferAssociatedViewService.AnyAssociatedViewHasFocus(textBufferOpt))
            {
                // TODO : should we remove TaggerBehavior enum all together and put NearImmediateDelay
                // const in Interaction?
                return(ComputeTimeDelay(behavior));
            }

            return(TimeSpan.FromMilliseconds(NonFocusDelay));
        }