Class UriTextBox
A HintTextBox designed specifically for entering URIs.
Inherited Members
Namespace: NanoByte.Common.Controls
Assembly: NanoByte.Common.WinForms.dll
Syntax
public class UriTextBox : HintTextBox
Remarks
Will turn red for invalid input and green for valid input. Will not allow focus to be lost for invalid input.
Constructors
UriTextBox()
Declaration
public UriTextBox()
Properties
AllowRelative
When set to true
relative URIs are accepted.
Declaration
public bool AllowRelative { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
HttpOnly
When set to true
only URIs starting with "http:" or "https:" will be considered valid.
Declaration
public bool HttpOnly { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsValid
Indicates whether the currently entered text is a valid URI.
Declaration
public bool IsValid { get; }
Property Value
Type | Description |
---|---|
Boolean |
Uri
The Uri represented by this text box.
Declaration
public Uri Uri { get; set; }
Property Value
Type | Description |
---|---|
Uri |
Remarks
It is always safe to set this property. It is safe to read this property after validation has been performed.
Exceptions
Type | Condition |
---|---|
System.UriFormatException |
Methods
OnDragDrop(DragEventArgs)
Declaration
protected override void OnDragDrop(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | drgevent |
OnDragEnter(DragEventArgs)
Declaration
protected override void OnDragEnter(DragEventArgs drgevent)
Parameters
Type | Name | Description |
---|---|---|
DragEventArgs | drgevent |
ValidateUri(String)
Checks if a text represents a valid Uri.
Declaration
protected virtual bool ValidateUri(string text)
Parameters
Type | Name | Description |
---|---|---|
String | text | Text to check. |
Returns
Type | Description |
---|---|
Boolean |