示例#1
0
        private void RTFEditor_Loaded(object sender, RoutedEventArgs e)
        {
            var range = new TextRange(RichTextControl.Selection.Start, RichTextControl.Selection.End);

            Fonttype.SelectedValue   = range.GetPropertyValue(FlowDocument.FontFamilyProperty).ToString();
            Fontheight.SelectedValue = range.GetPropertyValue(FlowDocument.FontSizeProperty).ToString();

            RichTextControl.Focus();
        }
示例#2
0
        //
        // andere Font wurde vom Benutzer ausgewählt
        //
        private void Fonttype_DropDownClosed(object sender, EventArgs e)
        {
            string fontName = (string)Fonttype.SelectedItem;

            if (fontName != null)
            {
                RichTextControl.Selection.ApplyPropertyValue(System.Windows.Controls.RichTextBox.FontFamilyProperty, fontName);
                RichTextControl.Focus();
            }
        }
示例#3
0
        //
        // Textgröße wurde vom Benutzer verändert
        //
        private void Fontheight_DropDownClosed(object sender, EventArgs e)
        {
            string fontHeight = (string)Fontheight.SelectedItem;

            if (fontHeight != null)
            {
                RichTextControl.Selection.ApplyPropertyValue(System.Windows.Controls.RichTextBox.FontSizeProperty, fontHeight);
                RichTextControl.Focus();
            }
        }
示例#4
0
        private void Fonttype_DropDownClosed(object sender, EventArgs e)
        {
            var fontName = (string)Fonttype.SelectedItem;

            if (fontName == null)
            {
                return;
            }
            RichTextControl.Selection.ApplyPropertyValue(FontFamilyProperty, fontName);
            RichTextControl.Focus();
        }
示例#5
0
        private void Fontheight_DropDownClosed(object sender, EventArgs e)
        {
            var fontHeight = (string)Fontheight.SelectedItem;

            if (fontHeight == null)
            {
                return;
            }
            RichTextControl.Selection.ApplyPropertyValue(FontSizeProperty, fontHeight);
            RichTextControl.Focus();
        }
示例#6
0
        //
        // Nach dem Laden des Control
        //
        private void RTFEditor_Loaded(object sender, RoutedEventArgs e)
        {
            // Schrifttypen- und -größen-Initialisierung
            TextRange range = new TextRange(RichTextControl.Selection.Start, RichTextControl.Selection.End);

            ComboBox_FontFamily.SelectedValue = range.GetPropertyValue(FlowDocument.FontFamilyProperty).ToString();
            ComboBox_FontSize.Text            = range.GetPropertyValue(FlowDocument.FontSizeProperty).ToString();

            // aktuelle Zeilen- und Spaltenpositionen angeben
            aktZeile  = Zeilennummer();
            aktSpalte = Spaltennummer();

            RichTextControl.Focus();
        }
示例#7
0
        public static void PopulateRichTextControlModel(IEditorControl ctl, EditorController controller, RichTextControl model)
        {
            if (ctl.GetBool("notextprocessor")) return;

            var commandDataList = controller.GetElementDataAttribute("_RichTextControl_TextProcessorCommands", "data") as IEnumerable;

            model.TextProcessorCommands = (from IDictionary<string, string> commandData in commandDataList
                                           select new RichTextControl.TextProcessorCommand
                                           {
                                               Command = GetDictionaryValue(commandData, "command"),
                                               Info = GetDictionaryValue(commandData, "info"),
                                               InsertBefore = GetDictionaryValue(commandData, "insertbefore"),
                                               InsertAfter = GetDictionaryValue(commandData, "insertafter"),
                                               Source = GetDictionaryValue(commandData, "source"),
                                               Extensions = GetExtensions(commandData)
                                           });

        }
示例#8
0
 private void ComboBox_FontSize_DropDownClosed(object sender, EventArgs e)
 {
     RichTextControl.Focus();
 }