Class Extensions
Inheritance
System.Object
Extensions
Assembly: Emby.Media.Model.dll
public static class Extensions
Methods
Declaration
public static void AddIfNotExists<T>(this List<T> list, T item)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<T> |
list |
|
| T |
item |
|
Type Parameters
Creates a Rational from a Resolution.
Declaration
public static Rational AsRational(this Resolution resolution)
Parameters
| Type |
Name |
Description |
| Resolution |
resolution |
The resolution.
|
Returns
Creates a Resolution from a Size.
Declaration
public static Resolution AsResolution(this Size size)
Parameters
| Type |
Name |
Description |
| System.Drawing.Size |
size |
|
Returns
Creates a Resolution from a Size.
Declaration
public static Resolution? AsResolution(this Size? size)
Parameters
| Type |
Name |
Description |
| System.Nullable<System.Drawing.Size> |
size |
The size.
|
Returns
Capitalizes the specified string.
Declaration
public static string Capitalize(this string value)
Parameters
| Type |
Name |
Description |
| System.String |
value |
The string to capitalize.
|
Returns
| Type |
Description |
| System.String |
A string.
|
Declaration
public static int GetFirstDword(this Guid guid)
Parameters
| Type |
Name |
Description |
| System.Guid |
guid |
|
Returns
| Type |
Description |
| System.Int32 |
|
Gets a shortend (friendly) string that is still supposed to be locally unique.
Declaration
public static string GetFriendlyString(this Guid guid)
Parameters
| Type |
Name |
Description |
| System.Guid |
guid |
The unique identifier.
|
Returns
| Type |
Description |
| System.String |
A shortend (friendly) string.
|
Checks whether the specified string is non-null and non-empty.
Declaration
public static bool IsNotEmpty(this string value)
Parameters
| Type |
Name |
Description |
| System.String |
value |
The string to check.
|
Returns
| Type |
Description |
| System.Boolean |
A boolean.
|
Checks whether the specified string is null or empty.
Declaration
public static bool IsNullOrEmpty(this string value)
Parameters
| Type |
Name |
Description |
| System.String |
value |
The string to check.
|
Returns
| Type |
Description |
| System.Boolean |
A boolean.
|
Declaration
public static T JsonClone<T>(this T obj, IJsonSerializer jsonSerializer)
Parameters
Returns
Type Parameters
Declaration
public static T JsonClone<T>(this T obj, Type asType, IJsonSerializer jsonSerializer)
Parameters
| Type |
Name |
Description |
| T |
obj |
|
| System.Type |
asType |
|
| IJsonSerializer |
jsonSerializer |
|
Returns
Type Parameters
Adds the specified prefix to a string if the string is non-empty.
Declaration
public static string PrefixWith(this string value, string prefix)
Parameters
| Type |
Name |
Description |
| System.String |
value |
The string to prefix.
|
| System.String |
prefix |
The prefix.
|
Returns
| Type |
Description |
| System.String |
|