Show / Hide Table of Contents

Class UriTextBox

A HintTextBox designed specifically for entering URIs.

Inheritance
Object
HintTextBox
UriTextBox
Inherited Members
HintTextBox.OnEnter(EventArgs)
HintTextBox.OnLeave(EventArgs)
HintTextBox.OnTextChanged(EventArgs)
HintTextBox.OnBackColorChanged(EventArgs)
HintTextBox.OnClearButtonClicked(EventArgs)
HintTextBox.ForeColor
HintTextBox.Text
HintTextBox.HintText
HintTextBox.IsHintTextVisible
HintTextBox.ShowClearButton
HintTextBox.ClearButtonClicked
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
UriFormatException

Trying to read while Text is not a well-formed Uri.

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

Extension Methods

UpdateUtils.To<TIn, TOut>(TIn, Func<TIn, TOut>)
JsonStorage.SaveJson<T>(T, Stream)
JsonStorage.SaveJson<T>(T, String)
JsonStorage.ToJsonString<T>(T)
JsonStorage.ReparseAsJson<T>(Object)
JsonStorage.ReparseAsJson<T>(Object, T)
XmlStorage.SaveXml(Object, Stream, String)
XmlStorage.SaveXml<T>(T, String, String)
XmlStorage.ToXmlString(Object, String)
ConversionUtils.ConvertToString<TType>(TType)
In This Article
Back to top Copyright Bastian Eicher