private void Remove(ref StringBuilder tmpBuilder, ref int removals, int value) { for (int i = 0; i < CurrentText.Length; i++) { char current = CurrentText.GetCharacter16(i); if (current == value) { if (tmpBuilder == null) { tmpBuilder = StringBuilderPool.Rent(CurrentText.Length); // append the data that we were holding onto, // excluding the char we are on currently for (int j = 0; j < i; j++) { tmpBuilder.Append(CurrentText.GetCharacter16(j)); } } removals++; } else if (tmpBuilder != null) // we don't append if there are no changes yet { tmpBuilder.Append(current); } } }
private void PressFunctionKeyCommandExecuted(object sender, ExecutedRoutedEventArgs e) { var parameter = (VirtualKey)e.Parameter; switch (parameter.Key) { case Key.Tab: CurrentText += "\t"; break; case Key.Space: CurrentText += " "; break; case Key.Back: if (CurrentText.Length > 0) { CurrentText = CurrentText.Remove(CurrentText.Length - 1); } break; case Key.Enter: // ValidateDialog(this, new DialogResultEventArgs(true, CurrentText)); Confirm(CurrentText); break; case Key.Escape: // ValidateDialog(this, new DialogResultEventArgs(false, null)); Cancel(); break; } }
protected void UpdateParagraph() { untouched.Text = CurrentText.Substring(Math.Min(CurrentText.Length, UserText.Length)); PWrapper.Inlines.Clear(); foreach (Run r in Runs) { PWrapper.Inlines.Add(r); } PWrapper.Inlines.Add(Building); PWrapper.Inlines.Add(untouched); TextPointer docStart = CurrentTextTB.Document.ContentStart; TextPointer docEnd = CurrentTextTB.Document.ContentEnd; int trueLength = docStart.GetOffsetToPosition(docEnd); int userStringEndOffset = trueLength - (CurrentText.Length - UserText.Length) - 2; TextPointer tp = CurrentTextTB.Document.ContentStart; tp = tp.GetPositionAtOffset(userStringEndOffset + 10); if (tp == null) { tp = docEnd; } CurrentTextTB.Selection.Select(tp, tp); }
public override bool IsInDrawObject(Point point) { var measure = _graphics.MeasureString(CurrentText + (CurrentText.EndsWith("\n") ? "A" : ""), Font); var rect = new Rectangle(relativeStartPoint.X, relativeStartPoint.Y, (int)measure.Width, (int)measure.Height); return(rect.Contains(point)); }
private void Editor_KeyPress(object sender, KeyPressEventArgs e) { bool textChanged = false; if (e.KeyChar == '\b') // backspace { if (CurrentText.Length > 0) { CurrentText = CurrentText.Remove(CurrentText.Length - 1); textChanged = true; } } else if (e.KeyChar == ' ' && !SpaceAccepts) { CurrentText += e.KeyChar; textChanged = true; } else if (!char.IsControl(e.KeyChar)) { CurrentText += e.KeyChar; textChanged = true; } if (textChanged) { Editor.DoPrompt(Options.GetFullPrompt() + CurrentText); TextChanged(CurrentText); } }
public void DistributeText(string text, bool createBoxes = true) //Method to give one character each to all the boxes, createBoxes(default = true) indicates whether to recreate the boxes or not, false when called by CreateBoxes() to avoid loop { if (text == anagramText) { currentText = CurrentText.anagramText; } else if (text == shuffledText) { currentText = CurrentText.shuffledText; } if (!String.IsNullOrEmpty(text)) { int characters = text.Length; if (createBoxes) { NumberOfBoxes = characters; //NumberOfBoxes is a property which gets/sets the numberBoxes Variable and remakes all the boxes } char[] characterArray = text.ToCharArray(); for (int i = 0; i < characters; i++) { textBoxes[i].Text = characterArray[i].ToString(); textBoxes[i].SelectAll(); textBoxes[i].TextAlign = defTextAlignment; } } else { if (createBoxes) { NumberOfBoxes = defNumberBoxes; } } FixSize(); }
public TextProcessor(string text) { Input = text; Input = HttpUtility.HtmlDecode(Input); CurrentText = Input; CurrentText = CurrentText.StripHtml().ToStandard(); var _models = CurrentText.ToWords(); _models = _models.Where(t => t.IsWord()).ToArray(); for (int i = 0; i < _models.Length; i++) { var _word = new Word(_models[i]); if (_word.CanRead()) { WordObject _object = new WordObject(_models[i], i); _object.Indexs = CurrentText.IndexAll(_word.Value); FullWordObjects.Add(_object); _object.ToClean(); if (_object.IsClean()) { CleanWordObjects.Add(_object); } } } CountOfWords = CleanWordObjects.Count; CountOfFullWords = FullWordObjects.Count; TimeToRead = CountOfWords / 200; //Normal read speed LoadFull(); }
private void btnBack_Click(object sender, EventArgs e) { if (CurrentText.Length > 0) { CurrentText = CurrentText.Remove(CurrentText.Length - 1); } }
/// <summary> /// Clear display and set cursor at start of the first line /// </summary public void clrscr() { pulseEnable(0); pulseEnable(Convert.ToByte((1 << D4c))); Task.Delay(5).Wait(); CurrentText.Clear(); }
public bool IsPhrase(string pharse) { if (CurrentText.IndexOf(pharse) > 0) { return(true); } return(false); }
public bool IsValidCaptcha(string text) { if (text == null || CurrentText == null) { return(false); } return(text.ToLower().Equals(CurrentText.ToLower())); }
/// <summary> /// Prints a string onto display. Uses printc. /// </summary> /// <param name="text">Text which shall be displayed.</param> public void prints(string text) { foreach (char c in text) { this.printc(c); CurrentText.Append(c); // append string to variable that you can read later on when delivering status information } }
private bool MoveNext() { if (CanMoveAgain = BaseEnumerator.MoveNext()) { CurrentText.Append(Current); } return(CanMoveAgain); }
/// <summary> /// Loads the markdown document into the CurrentText /// </summary> /// <param name="filename"></param> /// <returns></returns> public bool Load(string filename = null, SecureString password = null) { if (string.IsNullOrEmpty(filename)) { filename = Filename; } if (password == null) { password = Password; } else { Password = password; } if (!File.Exists(filename)) { FileCrc = null; return(false); } Filename = filename; UpdateCrc(); GetFileEncoding(); try { CurrentText = File.ReadAllText(filename, Encoding); if (password != null) { if (CurrentText.StartsWith(ENCRYPTION_PREFIX)) { string encrypted = CurrentText.Substring(ENCRYPTION_PREFIX.Length); CurrentText = Encryption.DecryptString(encrypted, password.GetString()); if (string.IsNullOrEmpty(CurrentText)) { return(false); } } } OriginalText = CurrentText; AutoSaveBackups = mmApp.Configuration.AutoSaveBackups; AutoSaveDocuments = mmApp.Configuration.AutoSaveDocuments; ProcessScripts = mmApp.Configuration.MarkdownOptions.AllowRenderScriptTags; IsDirty = false; } catch { return(false); } return(true); }
public void Process(object callback) { AllText = new List <string>(); for (int i = 0; i < List.Count; i++) { if (List[i].ToUpper().Contains(CurrentText.ToUpper()) && CurrentText != string.Empty) { AllText.Add(List[i]); } } }
/// <summary> /// Prints text in two lines /// </summary> /// <param name="text">Text which shall be displayed.</param> /// <param name="charsMaxInLine">Determines the maximum chars on a line.</param> public void printInTwoLines(string text, int charsMaxInLine = 16) { string line1 = "", line2 = ""; line1 = text.Substring(0, charsMaxInLine); line2 = text.Substring(charsMaxInLine); prints(line1); gotoSecondLine(); CurrentText.AppendLine(); prints(line2); CurrentTextPlainString = text; }
public WordObject GetWord(int index) { if (index < CountOfWords) { WordObject model = CleanWordObjects[index]; model.Indexs = CurrentText.IndexAll(model.Value); return(model); } else { return(null); } }
public void DeleteCharacter() { if (Text.text.Length == 1) { return; } Text.text = CurrentText.Substring(0, CurrentText.Length - 1) + Caret; if (_capsOn) { _capsOn = false; UpdateLetters(); } }
/// <summary> /// Sets the PreviewWebRootPath from content in the YAML of the document: /// webRootPath: c:\temp\post\Topic\ /// </summary> public string GetPreviewWebRootPathFromDocument() { if (CurrentText.StartsWith("---")) { var yaml = StringUtils.ExtractString(CurrentText, "---", "---"); if (!string.IsNullOrEmpty(yaml)) { PreviewWebRootPath = StringUtils.ExtractString(CurrentText, "\npreviewWebRootPath:", "\n", true, false, false); if (string.IsNullOrEmpty(PreviewWebRootPath)) { return(null); } } } return(null); }
private void InitEditor() { SaveEditor(); if (currentAnswerNum > 0) { editor.Html = currentTask.answers[currentAnswerNum - 1]; } else { editor.Html = currentTask.question; } currentText = new CurrentText { task = currentTask, answerNum = currentAnswerNum }; }
private void BackgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { CurrentText = Clipboard.GetText(); // only if clipboard was not empty if (CurrentText.Length > 0) { if (CurrentText.CompareTo(PreviousText) != 0) { PreviousText = CurrentText; itemList.Items.Insert(0, CurrentText.ToString()); // select current item itemList.SelectedIndex = 0; } } }
private void CurrentText_Updated(object sender, TextChangedEventArgs e) { if (currentViewMode == ViewMode.Text) { CurrentText = TextBlock.Text; var textChars = CurrentText.ToCharArray(); CurrentCharSet = new HashSet <char>(textChars.Distinct()); // TODO: bind these values directly in XAML CountChars.Text = CountChar; CountUniqueChars.Text = CountCharUnique; // UpdateWordCount(); } }
public void LoadFull() { Words = FullWordObjects.Select(t => t.Value).ToList(); EnglihsWords = CleanWordObjects.Where(t => t.Lang == WordLang.English) .Select(t => t.Value.ToLower()) .Distinct() .ToList(); VietnameseWords = CleanWordObjects.Where(t => t.Lang == WordLang.Vietnamese) .Select(t => t.Value.ToLower()) .Distinct() .ToList(); Numbers = CleanWordObjects.Where(t => t.IsNumber()) .Select(t => t.Value.ToLower()) .Distinct() .ToList(); UrlLinks = CleanWordObjects.Where(t => t.Value.IsUrl()) .Select(t => t.Value.ToLower()) .Distinct() .ToList(); Emails = CleanWordObjects.Where(t => t.Value.IsEmail()) .Select(t => t.Value.ToLower()) .Distinct() .ToList(); Sentences = CurrentText.GetSentences() .Distinct() .ToList(); QuestionSentences = GetQuestionSentences(); CountOfQuestions = QuestionSentences.Count(); try { Phrases = GetPhrases().ToList(); MathExprs = GetMathExprs().ToList(); Commands = GetCommands(); MakeOutput(); } catch { return; } }
private void Reset() { CurrentText = TextCreater.GetText(); CurrentText = CurrentText.Replace("\r", ""); PausesList = new List <double>(); HoldingList = new List <double>(); StartEnterDate = null; EndEnterDate = null; KeyDownDate = null; EndEnterDate = null; PrewKey = Key.None; ErrorCount = 0; OverlappingCount = 0; Runs = new LinkedList <Run>(); Building = new Run(string.Empty); Building.Background = Good; UserText = string.Empty; UpdateParagraph(); }
public IEnumerator <PreprocessorToken> GetEnumerator() { MoveNext(); while (CanMoveAgain) { First = Current; CurrentText.Clear(); var tokenType = PreprocessorTokenType.InvalidSequence; if (IsNonDigit(Current)) { tokenType = ParseRule( IsNonDigit, PreprocessorTokenType.Keyword); } else if (Current == '+') { tokenType = ParseCharacter('+'); } else if (IsDigit(Current)) { tokenType = ParseRule( IsDigit, PreprocessorTokenType.DecimalNumber); } if (CanMoveAgain) { CurrentText.Remove(CurrentText.Length - 1, 1); } yield return(new PreprocessorToken( CurrentText.ToString(), First, tokenType)); } }
// ********************************** Capture button's click event *********************************** void MyButtonClick(object sender, EventArgs e) { try { Button button = sender as Button; string szTemp = ""; if (!liszSymbols.Contains(button.Content) && button.Content.ToString() != "Enter" && boClearList) { CurrentText.Text = ""; boClearList = false; } if (button.Content.ToString() == "C") { ClearLists(); CurrentText.Text = ""; } else if (button.Content.ToString() == "<") { if (CurrentText.Text.Length != 0) { CurrentText.Text = CurrentText.Text.Remove(CurrentText.Text.Length - 1, 1); } } else if (button.Content.ToString() != "Enter") { if (!liszSymbols.Contains(button.Content)) { if (button.Content.ToString() == "." && !CurrentText.Text.Contains(".")) { CurrentText.Text += button.Content.ToString(); } else if (button.Content.ToString() != ".") { CurrentText.Text += button.Content.ToString(); } } else { lidoValues.Add(double.Parse(CurrentText.Text)); liszOperations.Add(button.Content.ToString()); HistoryText.Text += CurrentText.Text + button.Content.ToString(); CurrentText.Text = ""; } } else if (button.Content.ToString() == "Enter") { if (!string.IsNullOrEmpty(CurrentText.Text)) { lidoValues.Add(double.Parse(CurrentText.Text)); if (button.Content.ToString() != "C") { HistoryText.Text += CurrentText.Text; szTemp = HistoryText.Text; } double doResutl = 0; for (int i = 0; i < liszOperations.Count; i++) { doResutl = DoOperation(lidoValues[i], lidoValues[i + 1], liszOperations[i]); lidoValues[i + 1] = doResutl; } if (doResutl != 0) { CurrentText.Text = doResutl.ToString("N4"); } else { CurrentText.Text = "0"; } ClearLists(); boClearList = true; liszOperationsHistory.Insert(0, $"{szTemp} = {CurrentText.Text}"); } } CurrentText.Focus(); } catch { AlertBar("Invalid input", 2); } }
IEnumerator blitText(CurrentText currentText) { currentText.on_enter.Invoke(); foreach (Transform t in textHolder.transform) { Destroy(t.gameObject); } foreach (var spoken in currentText.spoken) { bool shouldContinue = true; foreach (var flag in spoken.required) { shouldContinue &= get_state(flag); } if (!shouldContinue) { continue; } yield return(new WaitForSeconds(.1f)); yield return(StartCoroutine(TypewriterText( Instantiate(spokenPrefab.gameObject, Vector3.zero, Quaternion.identity, textHolder.transform) .GetComponent <TMPro.TMP_Text>(), spoken.text, spoken.speaker))); LayoutRebuilder.ForceRebuildLayoutImmediate(textHolder.GetComponent <RectTransform>()); yield return(new WaitForSeconds(config.inter_spoken_wait_time)); } yield return(new WaitForSeconds(config.time_between_spoken_and_choices)); Instantiate(spacePrefab.gameObject, Vector3.zero, Quaternion.identity, textHolder.transform); foreach (var choice in currentText.choices) { bool shouldContinue = true; foreach (var flag in choice.required) { shouldContinue &= get_state(flag); } if (!shouldContinue) { continue; } GameObject choice_object = Instantiate(choicePrefab.gameObject, textHolder.transform); choice_object.GetComponent <Button>().onClick.AddListener(() => { foreach (var flag in choice.set_true) { set_state(flag, true); } foreach (var flag in choice.set_false) { set_state(flag, false); } currentText.on_exit.Invoke(); go_to(choice.dest); }); yield return(StartCoroutine(TypewriterText( choice_object.GetComponentInChildren <TMPro.TMP_Text>(), choice.choice, Speaker.player ))); LayoutRebuilder.ForceRebuildLayoutImmediate(textHolder.GetComponent <RectTransform>()); yield return(new WaitForSeconds(config.inter_choice_wait_time)); } yield return(null); }
public void go_to(CurrentText ct) { StopAllCoroutines(); StartCoroutine(blitText(ct)); }
private void textBox1_TextChanged(object sender, TextChangedEventArgs e) { if (ReplacingNow) { return; } if (!WordStart) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { switch (textBoxContent.Text.Substring(change.Offset, 1)) { case " ": case ",": case ".": case ":": case ";": case "(": case ")": case "!": case "?": case "\"": WordStart = true; UsernameStarted = false; HashtagStarted = false; break; default: WordStart = false; break; } if (WordStart) { break; } } } } if (UsernameStarted || HashtagStarted) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { switch (textBoxContent.Text.Substring(change.Offset, 1)) { case " ": case ",": case ".": case ":": case ";": case "(": case ")": case "!": case "?": case "\"": WordStart = true; UsernameStarted = false; HashtagStarted = false; break; default: WordStart = false; break; } if (WordStart) { break; } } } } if (WordStart && (!UsernameStarted && !HashtagStarted)) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { if (textBoxContent.Text.Substring(change.Offset, 1) == " ") { WordStart = true; continue; } else { WordStart = false; } if (textBoxContent.Text.Substring(change.Offset, 1) == "@") { UsernameStarted = true; StartPosition = change.Offset; CurrentText = ""; } else if (textBoxContent.Text.Substring(change.Offset, 1) == "#") { HashtagStarted = true; StartPosition = change.Offset; CurrentText = ""; } } } } if (UsernameStarted) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { CurrentText += textBoxContent.Text.Substring(change.Offset, change.AddedLength); } else if (change.RemovedLength > 0) { if (change.RemovedLength >= CurrentText.Length) { UsernameStarted = false; CurrentText = ""; MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; return; } else if (change.RemovedLength == CurrentText.Length) { WordStart = true; CurrentText = ""; popupMatchingUsernames.IsOpen = false; MatchingTexts.Clear(); } else { CurrentText = CurrentText.Substring(0, CurrentText.Length - change.RemovedLength); } } } if (Usernames.Where(name => name.ToLower().StartsWith(CurrentText.ToLower())).Count() > 0) { MatchingTexts.Clear(); foreach (string username in Usernames.Where(name => name.ToLower().StartsWith(CurrentText.ToLower()))) { MatchingTexts.Add(username); if (MatchingTexts.Count >= Properties.Settings.Default.MaxNumberOfEntriesInAutocomplete) { break; } } popupMatchingUsernames.PlacementRectangle = textBoxContent.GetRectFromCharacterIndex(textBoxContent.CaretIndex, true); popupMatchingUsernames.IsOpen = true; } else { MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; } } else if (HashtagStarted) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { CurrentText += textBoxContent.Text.Substring(change.Offset, change.AddedLength); } else if (change.RemovedLength > 0) { if (change.RemovedLength >= CurrentText.Length) { HashtagStarted = false; CurrentText = ""; MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; return; } else if (change.RemovedLength == CurrentText.Length) { WordStart = true; CurrentText = ""; popupMatchingUsernames.IsOpen = false; MatchingTexts.Clear(); } else { CurrentText = CurrentText.Substring(0, CurrentText.Length - change.RemovedLength); } } } if (Hashtags.Where(tag => tag.ToLower().StartsWith(CurrentText.ToLower())).Count() > 0) { MatchingTexts.Clear(); foreach (string hashtag in Hashtags.Where(tag => tag.ToLower().StartsWith(CurrentText.ToLower()))) { MatchingTexts.Add(hashtag); if (MatchingTexts.Count >= Properties.Settings.Default.MaxNumberOfEntriesInAutocomplete) { break; } } popupMatchingUsernames.PlacementRectangle = textBoxContent.GetRectFromCharacterIndex(textBoxContent.CaretIndex, true); popupMatchingUsernames.IsOpen = true; } else { MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; } } }
private void textBox1_TextChanged(object sender, TextChangedEventArgs e) { if (ReplacingNow) { return; } if (!WordStart) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { switch (textBoxContent.Text.Substring(change.Offset, 1)) { case " ": case ",": case ".": case ":": case ";": case "(": case ")": case "!": case "?": case "\"": WordStart = true; UsernameStarted = false; HashtagStarted = false; break; default: WordStart = false; break; } if (WordStart) { break; } } } } if (UsernameStarted || HashtagStarted) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { switch (textBoxContent.Text.Substring(change.Offset, 1)) { case " ": case ",": case ".": case ":": case ";": case "(": case ")": case "!": case "?": case "\"": WordStart = true; UsernameStarted = false; HashtagStarted = false; break; default: WordStart = false; break; } if (WordStart) { break; } } } } if (WordStart && (!UsernameStarted && !HashtagStarted)) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { if (textBoxContent.Text.Substring(change.Offset, 1) == " ") { WordStart = true; continue; } else { WordStart = false; } if (textBoxContent.Text.Substring(change.Offset, 1) == "@") { UsernameStarted = true; StartPosition = change.Offset; CurrentText = ""; } else if (textBoxContent.Text.Substring(change.Offset, 1) == "#") { HashtagStarted = true; StartPosition = change.Offset; CurrentText = ""; } } } } if (UsernameStarted) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { CurrentText += textBoxContent.Text.Substring(change.Offset, change.AddedLength); } else if (change.RemovedLength > 0) { if (change.RemovedLength >= CurrentText.Length) { UsernameStarted = false; CurrentText = ""; MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; return; } else if (change.RemovedLength == CurrentText.Length) { WordStart = true; CurrentText = ""; popupMatchingUsernames.IsOpen = false; MatchingTexts.Clear(); } else { CurrentText = CurrentText.Substring(0, CurrentText.Length - change.RemovedLength); } } } if (AppController.Current.AllKnownUsernames.Where(name => name.ToLower().StartsWith(CurrentText.ToLower())).Count() > 0) { MatchingTexts.Clear(); foreach (string username in AppController.Current.AllKnownUsernames.Where(name => name.ToLower().StartsWith(CurrentText.ToLower()))) { MatchingTexts.Add(username); if (MatchingTexts.Count >= 10) { break; } } popupMatchingUsernames.PlacementRectangle = textBoxContent.GetRectFromCharacterIndex(textBoxContent.CaretIndex, true); popupMatchingUsernames.IsOpen = true; } else { MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; } } else if (HashtagStarted) { foreach (TextChange change in e.Changes) { if (change.AddedLength > 0) { CurrentText += textBoxContent.Text.Substring(change.Offset, change.AddedLength); } else if (change.RemovedLength > 0) { if (change.RemovedLength >= CurrentText.Length) { HashtagStarted = false; CurrentText = ""; MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; return; } else if (change.RemovedLength == CurrentText.Length) { WordStart = true; CurrentText = ""; popupMatchingUsernames.IsOpen = false; MatchingTexts.Clear(); } else { CurrentText = CurrentText.Substring(0, CurrentText.Length - change.RemovedLength); } } } if (AppController.Current.AllKnownHashtags.Where(tag => tag.ToLower().StartsWith(CurrentText.ToLower())).Count() > 0) { MatchingTexts.Clear(); foreach (string hashtag in AppController.Current.AllKnownHashtags.Where(tag => tag.ToLower().StartsWith(CurrentText.ToLower()))) { MatchingTexts.Add(hashtag); if (MatchingTexts.Count >= 10) { break; } } popupMatchingUsernames.PlacementRectangle = textBoxContent.GetRectFromCharacterIndex(textBoxContent.CaretIndex, true); popupMatchingUsernames.IsOpen = true; } else { MatchingTexts.Clear(); popupMatchingUsernames.IsOpen = false; } } #region links as markups string pattern = @"\[(?<markupText>[^\]]+)\]\((?<markupLink>[^)]+)\)"; NumberOfChars = textBoxContent.Text.Length; MarkdownLinksInText.Clear(); foreach (Match match in Regex.Matches(textBoxContent.Text, pattern, RegexOptions.IgnoreCase)) { if (!MarkdownLinksInText.ContainsKey(match.Groups["markupLink"].Value)) { MarkdownLinksInText.Add(match.Groups["markupLink"].Value, match.Groups["markupText"].Value); } NumberOfChars -= 4 + match.Groups["markupLink"].Value.Length; } #endregion }