CVB.Net 14.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 System.Windows.Media.Color clr)
 Convert a WPF color to a GDI color. More...
 
static System.Windows.Media.Color ToWpfColor (this System.Drawing.Color clr)
 Convert a GDI color to a WPF color. More...
 
static System.Windows.Size ToWpfSize (this System.Drawing.Size s)
 Convert a System.Drawing.Size to a WPF System.Windows.Size. More...
 
static System.Windows.Size ToWpfSize (this Size2D s)
 Convert a Stemmer.Cvb.Size2D to a WPF System.Windows.Size. More...
 
static System.Drawing.Size ToDrawingSize (this System.Windows.Size s)
 Convert a System.Windows.Size to a Forms System.Drawing.Size. More...
 
static Stemmer.Cvb.Size2D ToCvbSize (this System.Windows.Size s)
 Convert a System.Windows.Size to a Forms Stemmer.Cvb.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 Stemmer.Cvb.Size2D ToCvbSize ( this System.Windows.Size  s)
static

Convert a System.Windows.Size to a Forms Stemmer.Cvb.Size2D.

This method truncates floating point values.

Parameters
sSize to convert.
Returns
Drawing size.

◆ ToDrawingSize()

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

Convert a System.Windows.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 System.Windows.Media.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 System.Windows.Media.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 System.Windows.Size ToWpfSize ( this Size2D  s)
static

Convert a Stemmer.Cvb.Size2D to a WPF System.Windows.Size.

Parameters
sSize to convert.
Returns
WPF size.

◆ ToWpfSize() [2/2]

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

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

Parameters
sSize to convert.
Returns
WPF size.