private void AddHotSpots(ICollection <HotSpotInternal> hotSpots, TextBoxBase textBox) { if (_retrieveHotSpots != null) { RetrieveHotSpotsEventArgs retrieveHotSpots = new RetrieveHotSpotsEventArgs(textBox); _retrieveHotSpots.Invoke(this, retrieveHotSpots); foreach (HotSpot spot in retrieveHotSpots.HotSpots) { hotSpots.Add(new HotSpotInternal(spot, retrieveHotSpots.Color)); } } }
private void AddHotSpots(ICollection<HotSpotInternal> hotSpots, TextBoxBase textBox) { if (_retrieveHotSpots != null) { RetrieveHotSpotsEventArgs retrieveHotSpots = new RetrieveHotSpotsEventArgs(textBox); _retrieveHotSpots.Invoke(this, retrieveHotSpots); foreach (HotSpot spot in retrieveHotSpots.HotSpots) { hotSpots.Add(new HotSpotInternal(spot, retrieveHotSpots.Color)); } } }
private void CheckSpelling(object sender, RetrieveHotSpotsEventArgs e) { string text = e.Text; e.Color = Color.DarkSalmon; string language = GetLanguageForSpellChecking(e.Control); IEnumerable<WordTokenizer.Token> tokens = WordTokenizer.TokenizeText(text); foreach (WordTokenizer.Token token in tokens) { if (!IsWordSpelledCorrectly(language, token.Value)) { HotSpot.HotSpot hotArea = new HotSpot.HotSpot(e.Control, token.Offset, token.Length); hotArea.MouseLeave += OnMouseLeaveHotSpot; hotArea.MouseEnter += OnMouseEnterHotSpot; e.AddHotSpot(hotArea); } } }