Class SystemExtensions
Inheritance
SystemExtensions
Assembly: Acoustics.Shared.dll
Syntax
public static class SystemExtensions
Properties
|
Improve this Doc
View Source
ExecutingDirectory
Declaration
public static string ExecutingDirectory { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddRange<T>(IList<T>, IEnumerable<T>)
Declaration
public static void AddRange<T>(this IList<T> list, IEnumerable<T> values)
Parameters
Type Parameters
|
Improve this Doc
View Source
And<T>(Expression<Func<T, Boolean>>, Expression<Func<T, Boolean>>)
Declaration
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
BinaryDeserialize(Byte[])
Deserialize byte array to object.
Declaration
public static object BinaryDeserialize(this byte[] bytes)
Parameters
Type |
Name |
Description |
Byte[] |
bytes |
The bytes.
|
Returns
Type |
Description |
Object |
Deserialized object.
|
|
Improve this Doc
View Source
BinaryDeserialize(Byte[], SerializationBinder)
Deserialize byte array to object.
Declaration
public static object BinaryDeserialize(this byte[] bytes, SerializationBinder binder)
Parameters
Returns
Type |
Description |
Object |
Deserialized object.
|
|
Improve this Doc
View Source
BinarySerialize(Object)
Convert an object to it's binary serialized form.
Declaration
public static byte[] BinarySerialize(this object o)
Parameters
Type |
Name |
Description |
Object |
o |
Object to serialize.
|
Returns
Type |
Description |
Byte[] |
Serialized object.
|
|
Improve this Doc
View Source
False<T>()
Declaration
public static Expression<Func<T, bool>> False<T>()
Returns
Type Parameters
|
Improve this Doc
View Source
HasValue<TKey, TValue>(Dictionary<TKey, TValue>, String)
Check if a dictionary has a value for a key.
Declaration
public static bool HasValue<TKey, TValue>(this Dictionary<TKey, TValue> dictionary, string key)
Parameters
Type |
Name |
Description |
Dictionary<TKey, TValue> |
dictionary |
The dictionary.
|
String |
key |
The dictionary key.
|
Returns
Type |
Description |
Boolean |
True if dictionary contains and has a value for key , otherwise false.
|
Type Parameters
Name |
Description |
TKey |
Type of key.
|
TValue |
Type of Value.
|
|
Improve this Doc
View Source
IndexOf<T>(IEnumerable<T>, Predicate<T>)
Declaration
public static int IndexOf<T>(this IEnumerable<T> source, Predicate<T> predicate)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
MaxOrDefault<TSource>(IEnumerable<TSource>)
Declaration
public static TSource MaxOrDefault<TSource>(this IEnumerable<TSource> source)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
MaxOrDefault<TSource>(IEnumerable<TSource>, TSource)
Declaration
public static TSource MaxOrDefault<TSource>(this IEnumerable<TSource> source, TSource defaultValue)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
|
TSource |
defaultValue |
|
Returns
Type Parameters
|
Improve this Doc
View Source
MaxOrDefault<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>)
Declaration
public static TResult MaxOrDefault<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
|
Func<TSource, TResult> |
selector |
|
Returns
Type Parameters
Name |
Description |
TSource |
|
TResult |
|
|
Improve this Doc
View Source
MaxOrDefault<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>, TResult)
Declaration
public static TResult MaxOrDefault<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector, TResult defaultValue)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
|
Func<TSource, TResult> |
selector |
|
TResult |
defaultValue |
|
Returns
Type Parameters
Name |
Description |
TSource |
|
TResult |
|
|
Improve this Doc
View Source
MinOrDefault<TSource>(IEnumerable<TSource>)
Declaration
public static TSource MinOrDefault<TSource>(this IEnumerable<TSource> source)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
MinOrDefault<TSource>(IEnumerable<TSource>, TSource)
Declaration
public static TSource MinOrDefault<TSource>(this IEnumerable<TSource> source, TSource defaultValue)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
|
TSource |
defaultValue |
|
Returns
Type Parameters
|
Improve this Doc
View Source
MinOrDefault<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>)
Declaration
public static TResult MinOrDefault<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
|
Func<TSource, TResult> |
selector |
|
Returns
Type Parameters
Name |
Description |
TSource |
|
TResult |
|
|
Improve this Doc
View Source
MinOrDefault<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>, TResult)
Declaration
public static TResult MinOrDefault<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector, TResult defaultValue)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
|
Func<TSource, TResult> |
selector |
|
TResult |
defaultValue |
|
Returns
Type Parameters
Name |
Description |
TSource |
|
TResult |
|
|
Improve this Doc
View Source
Or<T>(Expression<Func<T, Boolean>>, Expression<Func<T, Boolean>>)
Declaration
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr1, Expression<Func<T, bool>> expr2)
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
Page<TSource>(IEnumerable<TSource>, Int32, Int32)
Declaration
public static IEnumerable<TSource> Page<TSource>(this IEnumerable<TSource> source, int page, int pageSize)
Parameters
Type |
Name |
Description |
IEnumerable<TSource> |
source |
IEnumerable to page.
|
Int32 |
page |
Page number (begins at 1).
|
Int32 |
pageSize |
Number of items per page.
|
Returns
Type Parameters
Name |
Description |
TSource |
IEnumerable of 'object type' to page.
|
|
Improve this Doc
View Source
Page<TSource>(IQueryable<TSource>, Int32, Int32)
Declaration
public static IQueryable<TSource> Page<TSource>(this IQueryable<TSource> source, int page, int pageSize)
Parameters
Type |
Name |
Description |
IQueryable<TSource> |
source |
IQueryable to page.
|
Int32 |
page |
Page number (begins at 1).
|
Int32 |
pageSize |
Number of items per page.
|
Returns
Type |
Description |
IQueryable<TSource> |
Paged LINQ to SQL.
|
Type Parameters
Name |
Description |
TSource |
IQueryable of 'object type' to page.
|
|
Improve this Doc
View Source
PageByIndex<T>(IQueryable<T>, Nullable<Int32>, Nullable<Int32>)
Page IQueryable object using startIndex and number of items.
Declaration
public static IQueryable<T> PageByIndex<T>(this IQueryable<T> value, int? startIndex, int? length)
Parameters
Returns
Type |
Description |
IQueryable<T> |
Paged IQueryable object.
|
Type Parameters
Name |
Description |
T |
IQueryable of 'object type' to page.
|
|
Improve this Doc
View Source
ToByteDisplay(Int64)
Convert a byte count to human-readable format.
Declaration
public static string ToByteDisplay(this long byteCount)
Parameters
Type |
Name |
Description |
Int64 |
byteCount |
Number of bytes.
|
Returns
Type |
Description |
String |
Byte count in human-readable format.
|
|
Improve this Doc
View Source
ToDescriptionString(Enum)
Get description for enum.
Declaration
public static string ToDescriptionString(this Enum value)
Parameters
Type |
Name |
Description |
Enum |
value |
The value.
|
Returns
Type |
Description |
String |
Description text from DescriptionAttribute.
|
|
Improve this Doc
View Source
ToDictionary(NameValueCollection)
Convert NameValueCollection to a Dictionary.
Declaration
public static Dictionary<string, string> ToDictionary(this NameValueCollection collection)
Parameters
Returns
|
Improve this Doc
View Source
ToSortedDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>)
Declaration
public static SortedDictionary<TKey, TValue> ToSortedDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> l)
Parameters
Returns
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
|
Improve this Doc
View Source
True<T>()
Declaration
public static Expression<Func<T, bool>> True<T>()
Returns
Type Parameters
|
Improve this Doc
View Source
TryParseGuidRegex(String, out Guid)
Converts the string representation of a Guid to its Guid
equivalent. A return value indicates whether the operation
succeeded.
Declaration
public static bool TryParseGuidRegex(this string s, out Guid value)
Parameters
Type |
Name |
Description |
String |
s |
A string containing a Guid to convert.
|
Guid |
value |
The value.
|
Returns
Type |
Description |
Boolean |
true if s was converted
successfully; otherwise, false.
|
Exceptions
|
Improve this Doc
View Source
Utf8ByteArrayToString(Byte[])
To convert a Byte Array of Unicode values (UTF-8 encoded) to a complete String.
Declaration
public static string Utf8ByteArrayToString(this byte[] characters)
Parameters
Type |
Name |
Description |
Byte[] |
characters |
Unicode Byte Array to be converted to String.
|
Returns
Type |
Description |
String |
String converted from Unicode Byte Array.
|