TextStylePreview Class
Represents a syntax-highlighting code editor control.
public class TextStylePreview : UIControl, IUIControl, IUIElement, ILogicalTreeNode, IDpiAwareElement, IDisposable, INotifyPropertyChanged
- Implements:
- IUIControl IUIElement ILogicalTreeNode IDpiAwareElement System.IDisposable
Constructors
TextStylePreview()
Initializes an instance of the TextStylePreview
class.
public TextStylePreview()
Properties
BackColor
Gets or sets the background color for the control.
public override Color BackColor { get; set; }
Property Value
DefaultSize
Gets the default size of the control.
Font
Gets or sets the font of the text displayed by the control.
public override Font Font { get; set; }
Property Value
ForeColor
Gets or sets the foreground color for the control.
public override Color ForeColor { get; set; }
Property Value
HighlightingStyle
Gets or sets the IHighlightingStyle to apply to the preview.
public IHighlightingStyle HighlightingStyle { get; set; }
Property Value
- IHighlightingStyle:
The IHighlightingStyle to apply to the preview.
HighlightingStyleRegistry
Gets or sets the optional alternate IHighlightingStyleRegistry to use.
public IHighlightingStyleRegistry HighlightingStyleRegistry { get; set; }
Property Value
- IHighlightingStyleRegistry:
The optional alternate IHighlightingStyleRegistry to use.
Remarks
If this property is null
, the AmbientHighlightingStyleRegistry will be used.
Padding
Gets or sets the padding for the control.
public Padding Padding { get; set; }
Property Value
Text
Gets or sets the text to preview.
public override string Text { get; set; }
Property Value
- String:
The text to preview. The default value is
AaBbCcXxYyZz
.
Methods
ArrangeOverride(Size)
Positions child elements and returns the element's size.
protected override Size ArrangeOverride(Size finalSize)
Parameter | Type | Description |
---|---|---|
finalSize | Size | The size within the parent that this element should use to arrange itself and its children. |
Returns
- Size:
The actual size used.
CreateChildren()
Invoked when the collection of child elements is to be created.
protected override IList CreateChildren()
Returns
Remarks
By default no child collection is created.
MeasureOverride(Graphics, Size)
Measures the size required for the element and its child elements.
protected override Size MeasureOverride(Graphics g, Size availableSize)
Parameter | Type | Description |
---|---|---|
g | Graphics | The |
availableSize | Size | The available size. |
Returns
- Size:
The desired size.
NotifyPropertyChanged(String)
Notifies that a property has changed.
protected void NotifyPropertyChanged(string propertyName)
Parameter | Type | Description |
---|---|---|
propertyName | String | The name of the property that was changed. |
OnDraw(CanvasDrawEventArgs)
Occurs when the canvas should be rendered.
protected virtual void OnDraw(CanvasDrawEventArgs e)
Parameter | Type | Description |
---|---|---|
e | CanvasDrawEventArgs | The |
OnPropertyChanged(PropertyChangedEventArgs)
Raises the PropertyChanged event.
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
Parameter | Type | Description |
---|---|---|
e | PropertyChangedEventArgs | The PropertyChangedEventArgs that contains the event data. |
ResetBackColor()
Resets the BackColor property to its default value.
public override void ResetBackColor()
ResetFont()
Resets the Font property to its default value.
public override void ResetFont()
ResetForeColor()
Resets the ForeColor property to its default value.
public override void ResetForeColor()
ResetPadding()
Resets the Padding property to its default value.
public virtual void ResetPadding()
ResetTabStop()
Resets the TabStop property to its default value.
public virtual void ResetTabStop()
ShouldSerializeBackColor()
Indicates whether the BackColor property should be persisted.
protected virtual bool ShouldSerializeBackColor()
Returns
- Boolean:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeFont()
Indicates whether the Font property should be persisted.
protected virtual bool ShouldSerializeFont()
Returns
- Boolean:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeForeColor()
Indicates whether the ForeColor property should be persisted.
protected virtual bool ShouldSerializeForeColor()
Returns
- Boolean:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializePadding()
Indicates whether the Padding property should be persisted.
protected virtual bool ShouldSerializePadding()
Returns
- Boolean:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeTabStop()
Indicates whether the TabStop property should be persisted.
protected virtual bool ShouldSerializeTabStop()
Returns
- Boolean:
true
if the property value has changed from its default; otherwise,false
.
Events
PropertyChanged
Occurs when a property has been changed.
Inherited Members
- UIControl.Dispose(Boolean)
- UIControl.ILogicalTreeNode.FindAncestor(Type)
- UIControl.ILogicalTreeNode.GetCommonAncestor(ILogicalTreeNode)
- UIControl.ILogicalTreeNode.IsAncestorOf(ILogicalTreeNode)
- UIControl.ILogicalTreeNode.IsDescendantOf(ILogicalTreeNode)
- UIControl.IUIControl.AddPendingGraphicsInversion(Rectangle)
- UIControl.IUIControl.AddPendingScrollOperation(Rectangle, Orientation, Int32)
- UIControl.IUIControl.AddPendingScrollOperation(Rectangle, Int32, Int32)
- UIControl.IUIControl.AddToInvalidatedRegion(Rectangle)
- UIControl.IUIElement.GetDrawState()
- UIControl.IUIElement.HitTest(PointHitTestParameters)
- UIControl.IUIElement.HitTest(PointHitTestParameters, Func<IUIElement, PointHitTestParameters, Boolean>)
- UIControl.IUIElement.HitTestRecursive(PointHitTestParameters)
- UIControl.IUIElement.HitTestRecursive(PointHitTestParameters, Func<IUIElement, PointHitTestParameters, Boolean>)
- UIControl.IUIElement.NotifyChildDesiredSizeChanged()
- UIControl.IUIElement.NotifyMouseLeaveEvent()
- UIControl.AddPendingGraphicsInversion(Rectangle)
- UIControl.AddPendingScrollOperation(Rectangle, Orientation, Int32)
- UIControl.AddPendingScrollOperation(Rectangle, Int32, Int32)
- UIControl.AddToInvalidatedRegion()
- UIControl.AddToInvalidatedRegion(Rectangle)
- UIControl.Arrange(Rectangle)
- UIControl.ContainsLocation(Point)
- UIControl.DpiScaleChanged(SizeF)
- UIControl.GetCursor(Point)
- UIControl.Invalidate(InvalidationLevels, InvalidationTypes)
- UIControl.InvalidateArrange()
- UIControl.InvalidateMeasure()
- UIControl.Measure(Graphics, Size)
- UIControl.OnClick(EventArgs)
- UIControl.OnDoubleClick(EventArgs)
- UIControl.OnDpiChangedAfterParent(EventArgs)
- UIControl.OnHandleCreated(EventArgs)
- UIControl.OnLayout(LayoutEventArgs)
- UIControl.OnLocationChanged(EventArgs)
- UIControl.OnMouseCaptureChanged(EventArgs)
- UIControl.OnMouseDown(MouseEventArgs)
- UIControl.OnMouseEnter(EventArgs)
- UIControl.OnMouseHover(EventArgs)
- UIControl.OnMouseLeave(EventArgs)
- UIControl.OnMouseMove(MouseEventArgs)
- UIControl.OnMouseUp(MouseEventArgs)
- UIControl.OnMouseWheel(MouseEventArgs)
- UIControl.OnPaint(PaintEventArgs)
- UIControl.OnPaintBackground(PaintEventArgs)
- UIControl.OnParentChanged()
- UIControl.OnParentChanged(EventArgs)
- UIControl.OnRender(PaintEventArgs)
- UIControl.OnRenderChildElements(PaintEventArgs)
- UIControl.OnResize(EventArgs)
- UIControl.OnRightToLeftChanged(EventArgs)
- UIControl.OnVisibleChanged(EventArgs)
- UIControl.Render(PaintEventArgs)
- UIControl.ResetDoubleBufferCanvas(Boolean)
- UIControl.ResumePainting()
- UIControl.SuspendPainting()
- UIControl.TransformToAncestor(IUIElement)
- UIControl.TransformToDescendant(IUIElement)
- UIControl.UpdateCursor()
- UIControl.UpdateLayout()
- UIControl.OnDpiChangedBeforeParent(EventArgs)
- UIControl.RescaleConstantsForDpi(Int32, Int32)
- UIControl.WndProc(Message)
- UIControl.IUIElement.CreateGraphics()
- UIControl.ILogicalTreeNode.Children
- UIControl.ILogicalTreeNode.Parent
- UIControl.IUIControl.MouseCaptureElement
- UIControl.IUIControl.Capture
- UIControl.IUIElement.Bounds
- UIControl.IUIElement.Size
- UIControl.IUIElement.Visibility
- UIControl.IUIElement.VisualOffset
- UIControl.ActualHeight
- UIControl.ActualWidth
- UIControl.BackgroundImage
- UIControl.CaptureMouseWhenPressed
- UIControl.ClipBounds
- UIControl.DesiredSize
- UIControl.DpiScaleFactor
- UIControl.IsArrangeValid
- UIControl.IsMeasureValid
- UIControl.IsPaintValid
- UIControl.IsRightToLeft
- UIControl.LastMouseUpButton
- UIControl.PaintingSuspended
- UIControl.UseControlGraphicsForMeasure
- UIControl.UseExtendedDoubleBuffering
- UIControl.DpiChangedAfterParent
- UIControl.DpiChangedBeforeParent