TypeAssistantServer

public static class TypeAssistantServer
Provides static methods for registering and retrieving type assistants.

Fields

NullKey

#
public const string NullKey = "∅"

Methods

Find<T>

#
public static ITypeAssistant<T> Find<T>()
Find the type assistent associated with a specific type.
Type assistant or null.

FindByType

#
public static ITypeAssistant FindByType(Type type)
Find the type assistent associated with a specific type id.
type (Type)Type.
Type assistent or null.

FindByValue

#
public static ITypeAssistant FindByValue(object value)
Find the type assistent associated with a specific object.
value (object)Target object for assistant search.
Type assistent or null.

FindConstructor

#
public static ITypeAssistant FindConstructor(string name)
Find the type constructor matching the given name.
name (string)

FindConstructor<T>

#
public static TypeAssistant<T> FindConstructor<T>(string name)
Find the type constructor matching the given name.
name (string)

FindCurveAssistant

#
public static ICurveAssistant FindCurveAssistant(object targetObject)
Find the curve assistent associated with a specific object.
targetObject (object)Target object for assistant search.
Curve assistent or null.

FindCurveAssistant

#
public static void FindCurveAssistant(Type type, out ICurveAssistant assistant)
Find the curve assistent associated with a specific type id.
type (Type)Type.
assistant (out ICurveAssistant)Found assistant or null.

FindCurveAssistantByType

#
public static ICurveAssistant FindCurveAssistantByType(Type type)
Find the curve assistant associated with a specific type.
type (Type)

FindOrMake

#
public static ITypeAssistant FindOrMake(object targetObject)
Find the type assistent associated with a specific object. If no direct assistant can be found, a reimplementation of a more derived type may be constructed.
targetObject (object)Target object for assistant search.
Type assistent or null.

FindOrMake

#
public static void FindOrMake(Type type, out ITypeAssistant assistant)
Find the type assistent associated with a specific type id. If no direct assistant can be found, a reimplementation of a more derived type may be constructed.
type (Type)Type.
assistant (out ITypeAssistant)
Type assistent or null.

FindOrMake<T>

#
public static void FindOrMake<T>(out ITypeAssistant<T> assistant)
Find the type assistent associated with a specific type. If no direct assistant can be found, a reimplementation of a more derived type may be constructed.
assistant (out ITypeAssistant<T>)Assistant, if found.

FindSurfaceAssistant

#
public static ISurfaceAssistant FindSurfaceAssistant(object targetObject)
Find the surface assistent associated with a specific object.
targetObject (object)Target object for assistant search.
Surface assistent or null.

FindSurfaceAssistant

#
public static void FindSurfaceAssistant(Type type, out ISurfaceAssistant assistant)
Find the surface assistent associated with a specific type id.
type (Type)Type.
assistant (out ISurfaceAssistant)Found assistant or null.

FindSurfaceAssistantByType

#
public static ISurfaceAssistant FindSurfaceAssistantByType(Type type)
Find the surface assistant associated with a specific type.
type (Type)

Register

#
public static bool Register(ICurveAssistant assistant)
Register a curve assistant.
assistant (ICurveAssistant)Assistant to register.
True on success, false if the assistant is null or if a competing assistant was already defined.

Register

#
public static bool Register(ISurfaceAssistant assistant)
Register a surface assistant.
assistant (ISurfaceAssistant)Assistant to register.
True on success, false if the assistant is null or if a competing assistant was already defined.

Register

#
public static bool Register(ITypeAssistant assistant)
Register a type assistant.
assistant (ITypeAssistant)Assistant to register.
True on success, false if the assistant is null or if a competing assistant was already defined.

Sort

#
public static ITwig Sort(ITwig twig, out IndexMap map, out string[] warnings, out string[] errors)
Sort a twig containing potentially a variety of different data types and null values. Some effort is made to ensure this method doesn't have too much overhead when sorting twigs which contain only primitive data types such as doubles, integers or strings.
twig (ITwig)Twig to sort.
map (out Maths.IndexMap)Index map.
warnings (out string[])List of warning messages, if any.
errors (out string[])List of error messages, if any.
Twig with sorted values.

ToICurve

#
public static ICurve ToICurve(object targetObject)
Try and create an ICurve from an object.
targetObject (object)

ToNumericString

#
public static Prose.Text ToNumericString(object value)
Try and convert a value into a Prose.Text. If there is no assistant, the ToString() method will be invoked.
value (object)

Transform

#
public static bool Transform(IPear input, Transform transform, out IPear output)
Try and transform a pear using the registered type assistant.
input (IPear)Pear to transform.
transform (Transform)Transformation to apply.
output (out IPear)Transformed shape, or original pear.
True if a type assistant was defined for this type and supports transforming values.

Transform

#
public static bool Transform(object input, Transform transform, out object output)
Try and transform a value using the registered type assistant.
input (object)Value to transform.
transform (Transform)Transformation to apply.
output (out object)Transformed shape, or original value.
True if a type assistant was defined for this type and supports transforming values.