CVB.Net 15.0
MiscExtensions Class Reference

Collection of miscellaneous extension methods that did not fit in anywhere else. Image. More...

Static Public Member Functions

static System.Drawing.Color ToGdiColor (this Color clr)
 Convert a WPF color to a GDI color. More...
 
static Color ToWpfColor (this System.Drawing.Color clr)
 Convert a GDI color to a WPF color. More...
 
static Size ToWpfSize (this System.Drawing.Size s)
 Convert a System.Drawing.Size to a WPF Size. More...
 
static Size ToWpfSize (this Size2D s)
 Convert a Size2D to a WPF Size. More...
 
static System.Drawing.Size ToDrawingSize (this Size s)
 Convert a Size to a Forms System.Drawing.Size. More...
 
static Size2D ToCvbSize (this Size s)
 Convert a Size to a Forms Size2D. More...
 
static void RemoveAll< T > (this ItemCollection c)
 Remove all elements of a given type from an item collection. More...
 
static double Length (this Point p)
 Calculate the length of a vector defined through a Point object. More...
 
static Point2Dd ToPointD (this Point p)
 Point conversion. More...
 
static char ToChar (this Key key)
 Convert a key state into a printable character. More...
 
static Cursor ToCursor (this RectPos border)
 Gets an appropriate cursor object depending on border location. More...
 

Detailed Description

Collection of miscellaneous extension methods that did not fit in anywhere else. Image.

Member Function Documentation

◆ Length()

static double Length ( this Point  p)
static

Calculate the length of a vector defined through a Point object.

Parameters
pPoint to calculate for.
Returns
Length (L2 norm).

◆ RemoveAll< T >()

static void RemoveAll< T > ( this ItemCollection  c)
static

Remove all elements of a given type from an item collection.

Template Parameters
TType of the items to be removed.
Parameters
cCollection from which to remove.
Type Constraints
T :class 

◆ ToChar()

static char ToChar ( this Key  key)
static

Convert a key state into a printable character.

Parameters
keyKey value to convert.
Returns
Printable representation of the key.

◆ ToCursor()

static Cursor ToCursor ( this RectPos  border)
static

Gets an appropriate cursor object depending on border location.

Parameters
borderLocation to get cursor for.
Returns
Appropriate cursor.

◆ ToCvbSize()

static Size2D ToCvbSize ( this Size  s)
static

Convert a Size to a Forms Size2D.

This method truncates floating point values.

Parameters
sSize to convert.
Returns
Drawing size.

◆ ToDrawingSize()

static System.Drawing.Size ToDrawingSize ( this Size  s)
static

Convert a Size to a Forms System.Drawing.Size.

This method truncates floating point values.

Parameters
sSize to convert.
Returns
Drawing size.

◆ ToGdiColor()

static System.Drawing.Color ToGdiColor ( this Color  clr)
static

Convert a WPF color to a GDI color.

Parameters
clrcolour to be converted
Returns
converted color

◆ ToPointD()

static Point2Dd ToPointD ( this Point  p)
static

Point conversion.

Parameters
pSystem.Windows.Point to be converted.
Returns
Converted Stemmer.Cvb.PointD

◆ ToWpfColor()

static Color ToWpfColor ( this System.Drawing.Color  clr)
static

Convert a GDI color to a WPF color.

Parameters
clrcolor to be converted
Returns
converted color

◆ ToWpfSize() [1/2]

static Size ToWpfSize ( this Size2D  s)
static

Convert a Size2D to a WPF Size.

Parameters
sSize to convert.
Returns
WPF size.

◆ ToWpfSize() [2/2]

static Size ToWpfSize ( this System.Drawing.Size  s)
static

Convert a System.Drawing.Size to a WPF Size.

Parameters
sSize to convert.
Returns
WPF size.