C# Class YamuiFramework.Helper.Utilities

ファイルを表示 Open project: jcaillon/3P

Public Properties

Property Type Description
KeyPressValidChars char[]>.Dictionary
SimpleTypes Type[]
Validations Predicate>.Dictionary

Public Methods

Method Description
ForEachLine ( string filePath, byte dataResources, string>.Action toApplyOnEachLine, Encoding encoding, Action onException ) : bool

Reads all the line of either the filePath (if the file exists) or from byte array dataResources, Apply the action toApplyOnEachLine to each line Uses encoding as the Encoding to read the file or convert the byte array to a string Uses the char # as a comment in the file

GetAll ( Control control, Type type ) : IEnumerable

List all the controls children of "control" of type "type" this is recursive, so it find them all

GetCultureChars ( bool digits, bool neg, bool pos, bool dec = false, bool grp = false, bool e = false ) : char[]
GetCultureChars ( bool timeChars, bool timeSep, bool dateSep, char other ) : char[]
GetFirst ( Control control, Type type ) : Control

Get the first control of the type type it can find

IsInvalidKey ( char keyChar, Type itemType ) : bool
IsSimpleType ( this type ) : bool
IsSupportedType ( Type type ) : bool
MeasureHtmlPrefWidth ( string htmlContent, int minWidth, int maxWidth ) : int

Returns a fair width in which an html can be displayed

Private Methods

Method Description
SubForEachLine ( string filePath, byte dataResources, string>.Action toApplyOnEachLine, Encoding encoding ) : void

Method Details

ForEachLine() public static method

Reads all the line of either the filePath (if the file exists) or from byte array dataResources, Apply the action toApplyOnEachLine to each line Uses encoding as the Encoding to read the file or convert the byte array to a string Uses the char # as a comment in the file
public static ForEachLine ( string filePath, byte dataResources, string>.Action toApplyOnEachLine, Encoding encoding, Action onException ) : bool
filePath string
dataResources byte
toApplyOnEachLine string>.Action
encoding Encoding
onException Action
return bool

GetAll() public static method

List all the controls children of "control" of type "type" this is recursive, so it find them all
public static GetAll ( Control control, Type type ) : IEnumerable
control Control
type Type
return IEnumerable

GetCultureChars() public static method

public static GetCultureChars ( bool digits, bool neg, bool pos, bool dec = false, bool grp = false, bool e = false ) : char[]
digits bool
neg bool
pos bool
dec bool
grp bool
e bool
return char[]

GetCultureChars() public static method

public static GetCultureChars ( bool timeChars, bool timeSep, bool dateSep, char other ) : char[]
timeChars bool
timeSep bool
dateSep bool
other char
return char[]

GetFirst() public static method

Get the first control of the type type it can find
public static GetFirst ( Control control, Type type ) : Control
control Control
type Type
return Control

IsInvalidKey() public static method

public static IsInvalidKey ( char keyChar, Type itemType ) : bool
keyChar char
itemType Type
return bool

IsSimpleType() public static method

public static IsSimpleType ( this type ) : bool
type this
return bool

IsSupportedType() public static method

public static IsSupportedType ( Type type ) : bool
type Type
return bool

MeasureHtmlPrefWidth() public static method

Returns a fair width in which an html can be displayed
public static MeasureHtmlPrefWidth ( string htmlContent, int minWidth, int maxWidth ) : int
htmlContent string
minWidth int
maxWidth int
return int

Property Details

KeyPressValidChars public_oe static_oe property

public static Dictionary KeyPressValidChars
return char[]>.Dictionary

SimpleTypes public_oe static_oe property

public static Type[] SimpleTypes
return Type[]

Validations public_oe static_oe property

public static Dictionary> Validations
return Predicate>.Dictionary