Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReplacePatternSmartTag" /> class.
        /// </summary>
        /// <param name="tag">The tag.</param>
        /// <param name="description">The description.</param>
        /// <param name="type">The type.</param>
        /// <param name="tagResult">The tag result.</param>
        public ReplacePatternSmartTag(string tag, string description, SmartTagType type, Func <Match, string, string> tagResult)
        {
            this.Description = description;
            this.Type        = type;
            this.Tag         = tag;
            this.TagResult   = tagResult;

            this.tagApplicationRegex = new Regex(@"(?x)\$\{\<" + this.Tag + @"(?>\((?<Options>(?>(?<Paren>\()|(?<-Paren>\))|[^\(\)]+)*)\))?\>\}", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReplacePatternSmartTag" /> class.
        /// </summary>
        /// <param name="tag">The tag.</param>
        /// <param name="description">The description.</param>
        /// <param name="type">The type.</param>
        /// <param name="tagResult">The tag result.</param>
        public ReplacePatternSmartTag(string tag, string description, SmartTagType type, Func<Match, string, string> tagResult)
        {
            this.Description = description;
            this.Type = type;
            this.Tag = tag;
            this.TagResult = tagResult;

            this.tagApplicationRegex = new Regex(@"(?x)\$\{\<" + this.Tag + @"(?>\((?<Options>(?>(?<Paren>\()|(?<-Paren>\))|[^\(\)]+)*)\))?\>\}", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }
Esempio n. 3
0
        public virtual void TriggerSmartTag(ITrackingPoint triggerPoint, SmartTagType type, SmartTagState state)
        {
            DismissSmartTag();
            ISmartTagSession session = Provider.SmartTagBroker.CreateSmartTagSession(TextView, type, triggerPoint, state);

            if (session != null)
            {
                session.Dismissed += HandleSmartTagDismissed;
                SmartTagSession    = session;
            }
        }
 public ISmartTagSession CreateSmartTagSession(ITextView textView, SmartTagType type, ITrackingPoint triggerPoint, SmartTagState state) {
     var session = new MockSmartTagSession(this) {
         TextView = textView,
         Type = type,
         TriggerPoint = triggerPoint,
         State = state
     };
     lock (_sessions) {
         _sessions.Add(new KeyValuePair<ITextView, ISmartTagSession>(textView, session));
     }
     session.Dismissed += Session_Dismissed;
     return session;
 }
Esempio n. 5
0
        public ISmartTagSession CreateSmartTagSession(ITextView textView, SmartTagType type, ITrackingPoint triggerPoint, SmartTagState state)
        {
            var session = new MockSmartTagSession(this)
            {
                TextView     = textView,
                Type         = type,
                TriggerPoint = triggerPoint,
                State        = state
            };

            lock (_sessions) {
                _sessions.Add(new KeyValuePair <ITextView, ISmartTagSession>(textView, session));
            }
            session.Dismissed += Session_Dismissed;
            return(session);
        }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReplacePatternSmartTag" /> class.
 /// </summary>
 /// <param name="tag">The tag.</param>
 /// <param name="description">The description.</param>
 /// <param name="type">The type.</param>
 /// <param name="tagResult">The tag result.</param>
 public ReplacePatternSmartTag(string tag, string description, SmartTagType type, Func <string, string> tagResult)
     : this(tag, description, type, (m, p) => tagResult(p))
 {
 }
Esempio n. 7
0
 void ITvlIntellisenseController.TriggerSmartTag(ITrackingPoint triggerPoint, SmartTagType type, SmartTagState state)
 {
     Contract.Requires <ArgumentNullException>(triggerPoint != null, "triggerPoint");
     throw new NotImplementedException();
 }
Esempio n. 8
0
 public TodoGlyphTag(SmartTagType smartTagType, ReadOnlyCollection <SmartTagActionSet> actionSets)
     : base(smartTagType, actionSets)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReplacePatternSmartTag" /> class.
 /// </summary>
 /// <param name="tag">The tag.</param>
 /// <param name="description">The description.</param>
 /// <param name="type">The type.</param>
 /// <param name="tagResult">The tag result.</param>
 public ReplacePatternSmartTag(string tag, string description, SmartTagType type, Func<string, string> tagResult)
     : this(tag, description, type, (m, p) => tagResult(p))
 {
 }
 public virtual void TriggerSmartTag(ITrackingPoint triggerPoint, SmartTagType type, SmartTagState state)
 {
     DismissSmartTag();
     ISmartTagSession session = Provider.SmartTagBroker.CreateSmartTagSession(TextView, type, triggerPoint, state);
     if (session != null)
     {
         session.Dismissed += HandleSmartTagDismissed;
         SmartTagSession = session;
     }
 }
 void ITvlIntellisenseController.TriggerSmartTag(ITrackingPoint triggerPoint, SmartTagType type, SmartTagState state)
 {
     Contract.Requires<ArgumentNullException>(triggerPoint != null, "triggerPoint");
     throw new NotImplementedException();
 }