private static void editFraction(RichTextEditor editor) { RichTextBox richTextBox = editor.RichTextBox; TextPointer insertionPosition = richTextBox.Selection.End; Image image = Helper.GetImageAncestor(insertionPosition); FractionDialog dlg = new FractionDialog(); if (image != null) { dlg.FractionPart = editor.GetQuestionContentPart(image.Tag as string) as QuestionFractionPart; } if (dlg.ShowDialog().Value) { PictureCommands.InsertMathPicture(editor, dlg.FractionImage, dlg.FractionPart.PlaceHolder); if (image != null) { foreach (var temp in editor.Parts) { if (temp.PlaceHolder == (image.Tag as string)) { editor.Parts.Remove(temp); break; } } } editor.Parts.Add(dlg.FractionPart); } }
private static void insertFraction(RichTextEditor editor) { FractionDialog dlg = new FractionDialog(); if (dlg.ShowDialog().Value) { PictureCommands.InsertMathPicture(editor, dlg.FractionImage, dlg.FractionPart.PlaceHolder); editor.Parts.Add(dlg.FractionPart); } }