Class UriTextBox
- Namespace
- NanoByte.Common.EtoControls
- Assembly
- NanoByte.Common.EtoForms.dll
A Eto.Forms.TextBox designed specifically for entering URIs.
public class UriTextBox : TextBox, IHandlerSource, IDisposable, IBindable, IMouseInputSource, IKeyboardInputSource, ICallbackSource
- Inheritance
-
objectWidgetBindableWidgetControlCommonControlTextControlTextBoxUriTextBox
- Implements
-
IHandlerSourceIBindableIMouseInputSourceIKeyboardInputSourceICallbackSource
- Inherited Members
-
TextBox.TextChangingEventTextBox.OnTextChanging(TextChangingEventArgs)TextBox.SelectAll()TextBox.GetCharacterIndex(PointF)TextBox.GetCallback()TextBox.ReadOnlyTextBox.MaxLengthTextBox.PlaceholderTextTextBox.ShowBorderTextBox.TextAlignmentTextBox.CaretIndexTextBox.SelectionTextBox.SelectedTextTextBox.AutoSelectModeTextBox.AlwaysShowSelectionTextBox.TextChangingTextBox.ReadOnlyChangedTextControl.TextChangedEventTextControl.TextTextControl.TextColorTextControl.TextBindingTextControl.TextChangedCommonControl.FontControl.SizeChangedEventControl.KeyDownEventControl.KeyUpEventControl.TextInputEventControl.MouseDownEventControl.MouseUpEventControl.MouseMoveEventControl.MouseLeaveEventControl.MouseEnterEventControl.MouseDoubleClickEventControl.MouseWheelEventControl.GotFocusEventControl.LostFocusEventControl.ShownEventControl.ThemeChangedEventControl.DragDropEventControl.DragOverEventControl.DragEnterEventControl.DragLeaveEventControl.DragEndEventControl.EnabledChangedEventControl.OnKeyDown(KeyEventArgs)Control.OnKeyUp(KeyEventArgs)Control.OnTextInput(TextInputEventArgs)Control.OnMouseDown(MouseEventArgs)Control.OnMouseUp(MouseEventArgs)Control.OnMouseMove(MouseEventArgs)Control.OnMouseLeave(MouseEventArgs)Control.OnMouseEnter(MouseEventArgs)Control.OnMouseDoubleClick(MouseEventArgs)Control.OnMouseWheel(MouseEventArgs)Control.OnDragLeave(DragEventArgs)Control.OnDragEnd(DragEventArgs)Control.Invalidate()Control.Invalidate(Rectangle)Control.UpdateLayout()Control.GetPreferredSize()Control.GetPreferredSize(SizeF)Control.CaptureMouse()Control.ReleaseMouseCapture()Control.Detach()Control.AttachNative()Control.DetachNative()Control.Focus()Control.SuspendLayout()Control.ResumeLayout()Control.PointFromScreen(PointF)Control.PointToScreen(PointF)Control.RectangleToScreen(RectangleF)Control.RectangleFromScreen(RectangleF)Control.DoDragDrop(DataObject, DragEffects)Control.DoDragDrop(DataObject, DragEffects, Image, PointF)Control.TriggerStyleChanged()Control.OnApplyCascadingStyles()Control.Print()Control.IsDesignModeControl.HandlerControl.GesturesControl.LoadedControl.VisualControlsControl.TagControl.LogicalParentControl.IsVisualControlControl.SizeControl.IsMouseCapturedControl.WidthControl.HeightControl.EnabledControl.VisibleControl.ParentControl.VisualParentControl.IsAttachedControl.BackgroundColorControl.HasFocusControl.IsSuspendedControl.ParentWindowControl.SupportedPlatformCommandsControl.BoundsControl.LocationControl.CursorControl.ToolTipControl.TabIndexControl.TabStopControl.AllowDropControl.ContextMenuControl.SizeChangedControl.KeyDownControl.KeyUpControl.TextInputControl.MouseDownControl.MouseUpControl.MouseMoveControl.MouseLeaveControl.MouseEnterControl.MouseDoubleClickControl.MouseWheelControl.GotFocusControl.LostFocusControl.ShownControl.ThemeChangedControl.PreLoadControl.LoadControl.LoadCompleteControl.UnLoadControl.DragDropControl.DragOverControl.DragEnterControl.DragLeaveControl.DragEndControl.EnabledChangedBindableWidget.Unbind()BindableWidget.UpdateBindings(BindingUpdateMode)BindableWidget.ParentsBindableWidget.DataContextBindableWidget.BindingsBindableWidget.IsDataContextChangingBindableWidget.DataContextChangedWidget.Initialize()Widget.Dispose()Widget.ToString()Widget.PlatformWidget.NativeHandleWidget.PropertiesWidget.IDWidget.StyleWidget.ControlObjectWidget.IsDisposedWidget.StyleChanged
- Extension Methods
Remarks
Will turn red for invalid input and green for valid input. Accepts dropped files and URIs.
Constructors
UriTextBox()
Creates a new URI text box.
public UriTextBox()
Properties
AllowRelative
When set to true relative URIs are accepted.
public bool AllowRelative { get; set; }
Property Value
HttpOnly
When set to true only URIs starting with "http:" or "https:" will be considered valid.
public bool HttpOnly { get; set; }
Property Value
IsValid
Indicates whether the currently entered text is a valid URI.
public bool IsValid { get; }
Property Value
Uri
The Uri represented by this text box.
public Uri? Uri { get; set; }
Property Value
Remarks
It is always safe to set this property. It is safe to read this property if IsValid is true.
Exceptions
- UriFormatException
Trying to read while Eto.Forms.TextControl.Text is not a well-formed Uri.
Methods
OnDragDrop(DragEventArgs)
Raises the Eto.Forms.Control.DragDrop event.
protected override void OnDragDrop(DragEventArgs e)
Parameters
eDragEventArgsEvent arguments
OnDragEnter(DragEventArgs)
Raises the Eto.Forms.Control.DragEnter event.
protected override void OnDragEnter(DragEventArgs e)
Parameters
eDragEventArgsEvent arguments
OnDragOver(DragEventArgs)
Raises the Eto.Forms.Control.DragOver event.
protected override void OnDragOver(DragEventArgs e)
Parameters
eDragEventArgsEvent arguments
ValidateUri(string?)
Checks if a text represents a valid Uri.
protected virtual bool ValidateUri(string? text)
Parameters
textstringText to check.