NanoByte.Common  2.6.1
NanoByte.Common.Controls.UriTextBox Class Reference

A HintTextBox designed specifically for entering URIs. More...

Inheritance diagram for NanoByte.Common.Controls.UriTextBox:
NanoByte.Common.Controls.HintTextBox

Protected Member Functions

override void OnDragEnter (DragEventArgs drgevent)
 
override void OnDragDrop (DragEventArgs drgevent)
 
virtual bool ValidateUri (string text)
 Checks if a text represents a valid Uri. More...
 
- Protected Member Functions inherited from NanoByte.Common.Controls.HintTextBox
override void OnEnter (EventArgs e)
 
override void OnLeave (EventArgs e)
 
override void OnTextChanged (EventArgs e)
 
override void OnBackColorChanged (EventArgs e)
 
virtual void OnClearButtonClicked (EventArgs e)
 Raises the ClearButtonClicked event. More...
 

Properties

Uri?????? Uri [get, set]
 The Uri represented by this text box. More...
 
bool HttpOnly [get, set]
 When set to true only URIs starting with "http:" or "https:" will be considered valid. More...
 
bool AllowRelative [get, set]
 When set to true relative URIs are accepted. More...
 
bool IsValid [get]
 Indicates whether the currently entered text is a valid URI. More...
 
- Properties inherited from NanoByte.Common.Controls.HintTextBox
new Color ForeColor [get, set]
 Gets or sets the color used when displaying text in the control. More...
 
override string? Text [get, set]
 
string HintText [get, set]
 A text to be displayed in SystemColors.GrayText when TextBox.Text is empty. More...
 
bool IsHintTextVisible [get]
 Indicates whether the HintText is currently visible. More...
 
bool ShowClearButton [get, set]
 Controls whether the clear button is shown. Remains invisible when the HintText is visible. More...
 

Additional Inherited Members

- Events inherited from NanoByte.Common.Controls.HintTextBox
EventHandler? ClearButtonClicked
 Occurs when the clear button is clicked. More...
 

Detailed Description

A HintTextBox designed specifically for entering URIs.

Will turn red for invalid input and green for valid input. Will not allow focus to be lost for invalid input.

Member Function Documentation

◆ ValidateUri()

virtual bool NanoByte.Common.Controls.UriTextBox.ValidateUri ( string  text)
inlineprotectedvirtual

Checks if a text represents a valid Uri.

Parameters
textText to check.

Property Documentation

◆ AllowRelative

bool NanoByte.Common.Controls.UriTextBox.AllowRelative
getset

When set to true relative URIs are accepted.

◆ HttpOnly

bool NanoByte.Common.Controls.UriTextBox.HttpOnly
getset

When set to true only URIs starting with "http:" or "https:" will be considered valid.

◆ IsValid

bool NanoByte.Common.Controls.UriTextBox.IsValid
get

Indicates whether the currently entered text is a valid URI.

◆ Uri

Uri?????? NanoByte.Common.Controls.UriTextBox.Uri
getset

The Uri represented by this text box.

Exceptions
UriFormatExceptionTrying to read while TextBox.Text is not a well-formed Uri.

It is always safe to set this property. It is safe to read this property after validation has been performed.


The documentation for this class was generated from the following file: