-
Notifications
You must be signed in to change notification settings - Fork 2
Extensions
Char related extension methods
Shortcut for ToUpper
Param | Description |
---|---|
ch |
Returns:
Shortcut for ToLower
Param | Description |
---|---|
ch |
Returns:
CommonExtensions
Returns random element from given params collection
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
rnd | |
things |
Returns:
Indicates whether the regular expression specified by pattern
finds a match in a specified input String
.
Param | Description |
---|---|
value | |
pattern |
Returns: true
if there is a match
Serializes an object of type T in to an XML string
Type Param | Description |
---|---|
T | Any class type |
Param | Description |
---|---|
obj | Object to serialize |
Returns: A string that represents XML, empty otherwise
Deserializes an xml string into an object of Type T
Type Param | Description |
---|---|
T | Any class type |
Param | Description |
---|---|
xml | XML as string to deserialize from |
Returns: A new object of type T if successful, null if failed
Returns default value of given object
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
source |
Returns:
Returns given Decimal value formated as currency
Param | Description |
---|---|
value | |
cultureName |
Returns:
Shortcut for IsNullOrWhiteSpace
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
obj |
Returns:
Makes a copy from the object. Doesn't copy the reference memory, only data.
Type Param | Description |
---|---|
T | Type of the return object. |
Param | Description |
---|---|
item | Object to be copied. |
Returns: Returns the copied object.
Limit a value to a certain range. When the value is smaller/bigger than the range, snap it to the range border.
Type Param | Description |
---|---|
T | The type of the value to limit. |
Param | Description |
---|---|
source | The source for this extension method. |
start | The start of the interval, included in the interval. |
end | The end of the interval, included in the interval. |
object
== null
Param | Description |
---|---|
object |
Returns:
Returns true
if given string is path to a directory
Param | Description |
---|---|
path |
Returns:
Returns true
if given string is path to a file
Param | Description |
---|---|
path |
Returns:
DataTable related extension methods
DateTime related extension methods http://extensionoverflow.codeplex.com/SourceControl/latest#ExtensionMethods
Elapseds the time.
Param | Description |
---|---|
datetime | The datetime. |
Returns: TimeSpan
🔹 Method Extensions.DateAndTime.DateTimeExtensions.WeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule,System.DayOfWeek)
Weeks the of year.
Param | Description |
---|---|
datetime | The datetime. |
weekrule | The weekrule. |
firstDayOfWeek | The first day of week. |
Returns:
Weeks the of year.
Param | Description |
---|---|
datetime | The datetime. |
firstDayOfWeek | The first day of week. |
Returns:
🔹 Method Extensions.DateAndTime.DateTimeExtensions.WeekOfYear(System.DateTime,System.Globalization.CalendarWeekRule)
Weeks the of year.
Param | Description |
---|---|
datetime | The datetime. |
weekrule | The weekrule. |
Returns:
Weeks the of year.
Param | Description |
---|---|
datetime | The datetime. |
weekrule | The weekrule. |
Returns:
🔹 Method Extensions.DateAndTime.DateTimeExtensions.GetDateTimeForDayOfWeek(System.DateTime,System.DayOfWeek,System.DayOfWeek)
Gets the date time for day of week.
Param | Description |
---|---|
datetime | The datetime. |
day | The day. |
firstDayOfWeek | The first day of week. |
Returns:
Firsts the date time of week.
Param | Description |
---|---|
datetime | The datetime. |
Returns:
🔹 Method Extensions.DateAndTime.DateTimeExtensions.FirstDateTimeOfWeek(System.DateTime,System.DayOfWeek)
Firsts the date time of week.
Param | Description |
---|---|
datetime | The datetime. |
firstDayOfWeek | The first day of week. |
Returns:
🔹 Method Extensions.DateAndTime.DateTimeExtensions.DaysFromFirstDayOfWeek(System.DayOfWeek,System.DayOfWeek)
Dayses from first day of week.
Param | Description |
---|---|
current | The current. |
firstDayOfWeek | The first day of week. |
Returns:
Figure out if DateTime holds a date value that is a weekend
Param | Description |
---|---|
value |
Returns:
Returns given time as string formated to dd.MM.yyyy HH:mm:ss
Param | Description |
---|---|
dateTime |
Returns:
Returns given time as string formated to dd.MM.yyyy HH:mm:ss:ms
Param | Description |
---|---|
dateTime |
Returns:
Returns given unix timestamp as DateTime
Param | Description |
---|---|
unixTimeStamp |
Returns:
Enum related extension methods
Returns DescriptionAttribute value for enum
Type Param | Description |
---|---|
T | |
U |
Param | Description |
---|---|
enumerationValue | |
attributeType |
Returns:
Returns DescriptionAttribute value for enum
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
enumerationValue |
Returns:
https://stackoverflow.com/questions/5542816/printing-flags-enum-as-separate-flags
Param | Description |
---|---|
value |
Returns:
Linq related extension methods
http://extensionoverflow.codeplex.com/SourceControl/latest#ExtensionMethods
Converts the Linq data to a comma separated string including header.
Param | Description |
---|---|
data | The data. |
Returns:
Converts the Linq data to a comma separated string including header.
Param | Description |
---|---|
data | The data. |
delimiter | The delimiter. |
Returns:
🔹 Method Extensions.Linq.LinqExtensions.ToCSVString(System.Linq.IOrderedQueryable,System.String,System.String)
Converts the Linq data to a comma separated string including header.
Param | Description |
---|---|
data | The data. |
delimiter | The delimiter. |
nullvalue | The null value. |
Returns:
🔹 Method Extensions.Linq.LinqExtensions.ForEach1(System.Collections.Generic.IEnumerable{
0},System.Action{``0})
Shortcut for foreach statement
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
enum | |
mapFunction |
🔹 Method Extensions.Linq.LinqExtensions.OrderBy1(System.Collections.Generic.IEnumerable{
0},System.String)
Orders Enumerable using given sort expression Example: users.OrderBy("Name desc")
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
list | |
sortExpression | Property and sort direction |
Returns:
Returns randomly ordered Enumerable
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
target |
Returns:
Convert a [1](https://www.google.cz/search?q=System.Collections.Generic.IEnumerable
1)
to a [1](https://www.google.cz/search?q=System.Collections.ObjectModel.Collection
1)
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
enumerable |
Returns:
🔹 Method Extensions.Linq.LinqExtensions.OrderBy2(System.Collections.Generic.IEnumerable{
0},System.Func{0,
1},System.Boolean)
Type Param | Description |
---|---|
TSource | |
TKey |
Param | Description |
---|---|
enumerable | |
keySelector | |
descending |
Returns:
🔹 Method Extensions.Linq.LinqExtensions.OrderBy1(System.Collections.Generic.IEnumerable{
0},System.Func{0,System.IComparable},System.Func{
0,System.IComparable},System.Func{``0,System.IComparable}[])
Order by multiple properties http://www.extensionmethod.net/csharp/ienumerable-t/orderby
Type Param | Description |
---|---|
TSource |
Param | Description |
---|---|
enumerable | |
keySelector1 | |
keySelector2 | |
keySelectors |
Returns:
🔹 Method Extensions.Linq.LinqExtensions.OrderBy1(System.Collections.Generic.IEnumerable{
0},System.Boolean,System.Func{0,System.IComparable},System.Func{
0,System.IComparable}[])
OrderBy by multiple properties http://www.extensionmethod.net/csharp/ienumerable-t/orderby
Type Param | Description |
---|---|
TSource |
Param | Description |
---|---|
enumerable | |
descending | True if descending |
keySelector | |
keySelectors |
Returns:
🔹 Method Extensions.Linq.LinqExtensions.Filter1(System.Collections.Generic.IEnumerable{
0},System.Func{``0,System.Boolean})
Allows you to filter an [1](https://www.google.cz/search?q=System.Collections.Generic.IEnumerable
1)
http://www.extensionmethod.net/csharp/ienumerable-t/filter
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
list | |
filterParam |
Returns:
Adds an element to an [1](https://www.google.cz/search?q=System.Collections.Generic.IEnumerable
1)
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
target | |
element |
Returns:
Concatenates the members of a constructed [1](https://www.google.cz/search?q=System.Collections.Generic.IEnumerable
1)
collection of type String , using the specified separator between each member.
Type Param | Description |
---|---|
T |
Param | Description |
---|---|
collection | |
separator |
Returns:
XML related extensions
Formats given XML document
Param | Description |
---|---|
doc |
Returns:
Converts XDocument to XmlDocument
Param | Description |
---|---|
xDocument |
Returns:
Converts XmlDocument to XDocument
Param | Description |
---|---|
xmlDocument |
Returns:
Converts XElement to XmlDocument
Param | Description |
---|---|
xElement |
Returns:
Converts XmlDocument to Stream
Param | Description |
---|---|
doc |
Returns: