Show / Hide Table of Contents

Class DescriptorHelpers

Helper extension methods used to simplify some parts of userdata descriptor implementations

Inheritance
System.Object
DescriptorHelpers
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: System.Dynamic.ExpandoObject
Assembly: cs.temp.dll.dll
Syntax
public static class DescriptorHelpers

Methods

Camelify(String)

Converts the specified name from underscore_case to camelCase.

Declaration
public static string Camelify(string name)
Parameters
System.String name

The name.

Returns
System.String

GetAllImplementedTypes(Type)

Gets all implemented types by a given type

Declaration
public static IEnumerable<Type> GetAllImplementedTypes(this Type t)
Parameters
Type t

The t.

Returns
IEnumerable<Type>

GetClrVisibility(FieldInfo)

Gets a string representing visibility of the given member type

Declaration
public static string GetClrVisibility(this FieldInfo info)
Parameters
FieldInfo info

Returns
System.String

GetClrVisibility(MethodBase)

Gets a string representing visibility of the given member type

Declaration
public static string GetClrVisibility(this MethodBase info)
Parameters
MethodBase info

Returns
System.String

GetClrVisibility(PropertyInfo)

Gets a string representing visibility of the given member type

Declaration
public static string GetClrVisibility(this PropertyInfo info)
Parameters
PropertyInfo info

Returns
System.String

GetClrVisibility(Type)

Gets the visibility of the type as a string

Declaration
public static string GetClrVisibility(this Type type)
Parameters
Type type

Returns
System.String

GetConversionMethodName(Type)

Gets the name of a conversion method to be exposed to Lua scripts

Declaration
public static string GetConversionMethodName(this Type type)
Parameters
Type type

The type.

Returns
System.String

GetMetaNamesFromAttributes(MethodInfo)

Gets the list of metamethod names from attributes - in practice the list of metamethods declared through MoonSharpUserDataMetamethodAttribute .

Declaration
public static List<string> GetMetaNamesFromAttributes(this MethodInfo mi)
Parameters
MethodInfo mi

The mi.

Returns
List<System.String>

GetVisibilityFromAttributes(MemberInfo)

Determines whether a MoonSharpVisibleAttribute or a MoonSharpHiddenAttribute is changing visibility of a member to scripts.

Declaration
public static bool ? GetVisibilityFromAttributes(this MemberInfo mi)
Parameters
MemberInfo mi

The member to check.

Returns
System.Nullable<System.Boolean>

true if visibility is forced visible, false if visibility is forced hidden or the specified MemberInfo is null, if no attribute was found

Exceptions
System.InvalidOperationException

If both MoonSharpHiddenAttribute and MoonSharpVisibleAttribute are specified and they convey different messages.

IsDelegateType(Type)

Declaration
public static bool IsDelegateType(this Type t)
Parameters
Type t

Returns
System.Boolean

IsPropertyInfoPublic(PropertyInfo)

Determines whether the specified PropertyInfo is visible publicly (either the getter or the setter is public).

Declaration
public static bool IsPropertyInfoPublic(this PropertyInfo pi)
Parameters
PropertyInfo pi

The PropertyInfo.

Returns
System.Boolean

IsValidSimpleIdentifier(String)

Determines whether the string is a valid simple identifier (starts with letter or underscore and contains only letters, digits and underscores).

Declaration
public static bool IsValidSimpleIdentifier(string str)
Parameters
System.String str

Returns
System.Boolean

SafeGetTypes(Assembly)

Gets the Types implemented in the assembly, catching the ReflectionTypeLoadException just in case..

Declaration
public static Type[] SafeGetTypes(this Assembly asm)
Parameters
Assembly asm

The assebly

Returns
Type[]

ToValidSimpleIdentifier(String)

Converts the string to a valid simple identifier (starts with letter or underscore and contains only letters, digits and underscores).

Declaration
public static string ToValidSimpleIdentifier(string str)
Parameters
System.String str

Returns
System.String

UpperFirstLetter(String)

Converts the specified name to one with an uppercase first letter (something to Something).

Declaration
public static string UpperFirstLetter(string name)
Parameters
System.String name

The name.

Returns
System.String

Back to top Built by Itinero, MIT licensed.