public void ApplyPatch(TextPatch patch) { Enabled = Enabled.ApplyPatch(patch.Enabled); Contents = Contents.ApplyPatch(patch.Contents); PixelsPerLine = PixelsPerLine.ApplyPatch(patch.PixelsPerLine); Height = Height.ApplyPatch(patch.Height); Anchor = Anchor.ApplyPatch(patch.Anchor); Justify = Justify.ApplyPatch(patch.Justify); Font = Font.ApplyPatch(patch.Font); Color = Color.ApplyPatch(patch.Color); }
void IView.PatchLogSample(TextPatch p) { var dict = new NSMutableDictionary(); if (p.BackColor != null) { dict[NSStringAttributeKey.BackgroundColor] = p.BackColor.Value.ToNSColor(); } if (p.ForeColor != null) { dict[NSStringAttributeKey.ForegroundColor] = p.ForeColor.Value.ToNSColor(); } dict[NSStringAttributeKey.Font] = p.Bold == true ? monoBoldFont : monoFont; sampleLogTextBox.TextStorage.SetAttributes(dict, new NSRange(p.RangeBegin, p.RangeEnd - p.RangeBegin)); }
void IView.PatchLogSample(TextPatch p) { tom.ITextFont fnt = tomDoc.Range(p.RangeBegin, p.RangeEnd).Font; Func <Color?, int> translatorColor = cl => System.Drawing.ColorTranslator.ToWin32(cl.Value.ToSystemDrawingObject()); if (p.BackColor != null) { fnt.BackColor = translatorColor(p.BackColor); } if (p.ForeColor != null) { fnt.ForeColor = translatorColor(p.ForeColor); } if (p.Bold != null) { fnt.Bold = p.Bold.Value ? -1 : 0; } }
public void SynchronizeEngine(TextPatch patch) { ApplyPatch(patch); }