C# Class ICSharpCode.AvalonEdit.Utils.ExtensionMethods

Show file Open project: VE-2016/VE-2016

Public Methods

Method Description
AddRange ( ICollection collection, IEnumerable elements ) : void
CoerceValue ( double value, double minimum, double maximum ) : double

Forces the value to stay between mininum and maximum.

CoerceValue ( int value, int minimum, int maximum ) : int

Forces the value to stay between mininum and maximum.

CreateTypeface ( FrameworkElement fe ) : Typeface

Creates typeface from the framework element.

GetAttributeOrNull ( XmlElement element, string attributeName ) : string

Gets the value of the attribute, or null if the attribute does not exist.

GetBoolAttribute ( XmlElement element, string attributeName ) : bool?

Gets the value of the attribute as boolean, or null if the attribute does not exist.

GetBoolAttribute ( XmlReader reader, string attributeName ) : bool?

Gets the value of the attribute as boolean, or null if the attribute does not exist.

IsClose ( Size d1, Size d2 ) : bool

Returns true if the doubles are close (difference smaller than 0.01).

IsClose ( Vector d1, Vector d2 ) : bool

Returns true if the doubles are close (difference smaller than 0.01).

IsClose ( double d1, double d2 ) : bool

Returns true if the doubles are close (difference smaller than 0.01).

Sequence ( value ) : IEnumerable

Creates an IEnumerable with a single value.

ToSystemDrawing ( Point p ) : System.Drawing.Point
ToWpf ( System.Drawing.Point p ) : Point
ToWpf ( System.Drawing.Rectangle rect ) : Rect
ToWpf ( System.Drawing.Size s ) : Size
TransformFromDevice ( Point point, Visual visual ) : Point
TransformFromDevice ( Rect rect, Visual visual ) : Rect
TransformFromDevice ( Size size, Visual visual ) : Size
TransformToDevice ( Point point, Visual visual ) : Point
TransformToDevice ( Rect rect, Visual visual ) : Rect
TransformToDevice ( Size size, Visual visual ) : Size
VisualAncestorsAndSelf ( DependencyObject obj ) : IEnumerable

Private Methods

Method Description
CheckIsFrozen ( Freezable f ) : void
Log ( bool condition, string format ) : void

Method Details

AddRange() public static method

public static AddRange ( ICollection collection, IEnumerable elements ) : void
collection ICollection
elements IEnumerable
return void

CoerceValue() public static method

Forces the value to stay between mininum and maximum.
public static CoerceValue ( double value, double minimum, double maximum ) : double
value double
minimum double
maximum double
return double

CoerceValue() public static method

Forces the value to stay between mininum and maximum.
public static CoerceValue ( int value, int minimum, int maximum ) : int
value int
minimum int
maximum int
return int

CreateTypeface() public static method

Creates typeface from the framework element.
public static CreateTypeface ( FrameworkElement fe ) : Typeface
fe FrameworkElement
return Typeface

GetAttributeOrNull() public static method

Gets the value of the attribute, or null if the attribute does not exist.
public static GetAttributeOrNull ( XmlElement element, string attributeName ) : string
element XmlElement
attributeName string
return string

GetBoolAttribute() public static method

Gets the value of the attribute as boolean, or null if the attribute does not exist.
public static GetBoolAttribute ( XmlElement element, string attributeName ) : bool?
element XmlElement
attributeName string
return bool?

GetBoolAttribute() public static method

Gets the value of the attribute as boolean, or null if the attribute does not exist.
public static GetBoolAttribute ( XmlReader reader, string attributeName ) : bool?
reader XmlReader
attributeName string
return bool?

IsClose() public static method

Returns true if the doubles are close (difference smaller than 0.01).
public static IsClose ( Size d1, Size d2 ) : bool
d1 Size
d2 Size
return bool

IsClose() public static method

Returns true if the doubles are close (difference smaller than 0.01).
public static IsClose ( Vector d1, Vector d2 ) : bool
d1 Vector
d2 Vector
return bool

IsClose() public static method

Returns true if the doubles are close (difference smaller than 0.01).
public static IsClose ( double d1, double d2 ) : bool
d1 double
d2 double
return bool

Sequence() public static method

Creates an IEnumerable with a single value.
public static Sequence ( value ) : IEnumerable
return IEnumerable

ToSystemDrawing() public static method

public static ToSystemDrawing ( Point p ) : System.Drawing.Point
p Point
return System.Drawing.Point

ToWpf() public static method

public static ToWpf ( System.Drawing.Point p ) : Point
p System.Drawing.Point
return Point

ToWpf() public static method

public static ToWpf ( System.Drawing.Rectangle rect ) : Rect
rect System.Drawing.Rectangle
return Rect

ToWpf() public static method

public static ToWpf ( System.Drawing.Size s ) : Size
s System.Drawing.Size
return Size

TransformFromDevice() public static method

public static TransformFromDevice ( Point point, Visual visual ) : Point
point Point
visual Visual
return Point

TransformFromDevice() public static method

public static TransformFromDevice ( Rect rect, Visual visual ) : Rect
rect Rect
visual Visual
return Rect

TransformFromDevice() public static method

public static TransformFromDevice ( Size size, Visual visual ) : Size
size Size
visual Visual
return Size

TransformToDevice() public static method

public static TransformToDevice ( Point point, Visual visual ) : Point
point Point
visual Visual
return Point

TransformToDevice() public static method

public static TransformToDevice ( Rect rect, Visual visual ) : Rect
rect Rect
visual Visual
return Rect

TransformToDevice() public static method

public static TransformToDevice ( Size size, Visual visual ) : Size
size Size
visual Visual
return Size

VisualAncestorsAndSelf() public static method

public static VisualAncestorsAndSelf ( DependencyObject obj ) : IEnumerable
obj DependencyObject
return IEnumerable