internal void UnapplyToMyEdit(MyEdit myEdit) { foreach (LevelStyleProperty style in __StyleList) { switch (style.PropertyType) { case StylePropertyType.Typeface: myEdit.Document.FontFamily = Settings.DefaultFontFamily; myEdit.FontFamily = Settings.DefaultFontFamily; break; case StylePropertyType.FontColor: myEdit.Document.Foreground = Settings.DefaultFontColor; myEdit.Foreground = Settings.DefaultFontColor; break; case StylePropertyType.FontSize: myEdit.Document.FontSize = Settings.DefaultFontSize; myEdit.FontSize = Settings.DefaultFontSize; break; case StylePropertyType.IsBold: myEdit.Document.FontWeight = FontWeights.Normal; myEdit.FontWeight = FontWeights.Normal; break; case StylePropertyType.IsItalic: myEdit.Document.FontStyle = FontStyles.Normal; myEdit.FontStyle = FontStyles.Normal; break; } } }
internal void ApplyToMyEdit(MyEdit myEdit) { foreach (LevelStyleProperty style in __StyleList) { ApplyPropertyToFlowDocument(myEdit.Document, style.PropertyType, style.Value); } }
public override void Redo(OutlinerDocument document, TreeListView treeListView) { MyEdit edit = GetEdit(document, treeListView); Debug.Assert(edit != null, "Bad news: UndoMyAction's Undo has edit == null"); __UndoAction.Redo(edit); edit.Links_Update(); Keyboard.Focus(edit); }
private MyEdit GetEdit(OutlinerDocument document, TreeListView treeListView) { OutlinerNote note = document.FindOutlinerNoteByDocument(__DocumentGuid); Debug.Assert(note != null, "GetEdit's note == null"); TreeListViewItem item = ViewHelpers.GetContainerForItem(treeListView, note); Debug.Assert(item != null, "Bad news: UndoMyAction's Undo has item == null"); MainWindow mw = DragDropHelper.GetMainWindow(treeListView); MyEdit edit = item.GetEditor(mw.GetViewColumnId(__ColumnId), __ColumnId, __IsInlineNote); return(edit); }
void InitialEditControl() { // 2009/11/20 if (this.curEdit != null) this.Controls.Remove(this.curEdit); this.curEdit = new MyEdit(); curEdit.RightToLeft = RightToLeft.Inherit; curEdit.ImeMode = ImeMode.NoControl; // off curEdit.BorderStyle = BorderStyle.None; // BorderStyle.FixedSingle; curEdit.MaxLength = 0; curEdit.Multiline = true; curEdit.WordWrap = true; // 2009/10/24 if (curEdit.ReadOnly != this.ReadOnly) curEdit.ReadOnly = this.ReadOnly; this.Controls.Add(curEdit); /* if (this.FixedSizeFont == null) this.FixedSizeFont = CreateFixedSizeFont(); if (this.CaptionFont == null) this.CaptionFont = CreateCaptionFont(); * */ // m_bEditInitialized = true; }
void InitialEditControl() { // 2009/11/20 if (this.curEdit != null) { this.Controls.Remove(this.curEdit); this.curEdit.Dispose(); // 2015/9/16 this.curEdit = null; } this.curEdit = new MyEdit(); curEdit.RightToLeft = RightToLeft.Inherit; curEdit.ImeMode = ImeMode.NoControl; // off curEdit.BorderStyle = BorderStyle.None; // BorderStyle.FixedSingle; curEdit.MaxLength = 0; curEdit.Multiline = true; curEdit.WordWrap = true; // 2009/10/24 if (curEdit.ReadOnly != this.ReadOnly) curEdit.ReadOnly = this.ReadOnly; this.Controls.Add(curEdit); }