ConversionServer

public static class ConversionServer
This static class collects and maintains all conversion logic.

Properties

Actions

#
Enumerate over all registered actions. Note that some actions are created on an as-needed basis so this collection may change over time even without new plugins getting loaded.
public static IEnumerable<ConversionAction> Actions { get; }

Methods

Convert

#
Try and convert between weakly typed values.
public static bool Convert(
source,
targetType,
out object
target,
out Merit
merit,
out string
explanation
)

Convert

#
Try and convert between weakly typed values.
public static bool Convert(
source,
targetType,
out object
target
)

Convert<TTarget>

#
Try and convert to a strongly typed value.
public static bool Convert<TTarget>(
source,
out TTarget
target,
out Merit
merit,
out string
explanation
)

Convert<TTarget>

#
Try and convert to a strongly typed value.
public static bool Convert<TTarget>(
source,
out TTarget
target
)

ConvertIfBetter<TTarget>

#
Perform a conversion provided the merit improves.
public static bool ConvertIfBetter<TTarget>(
source,
Source value.
ref object
target,
Target value to optionally overwrite.
ref Merit
merit
Merit to beat.
)
True if a better conversion was found.

ConvertPear

#
Try and convert between weakly typed values.
public static bool ConvertPear(
source,
targetType,
out IPear
target,
out Merit
merit,
out string
explanation
)

ConvertPear

#
Try and convert between weakly typed values.
public static bool ConvertPear(
source,
targetType,
out IPear
target
)

ConvertPear<TTarget>

#
Try and convert to a strongly typed value.
public static bool ConvertPear<TTarget>(
source,
out Pear<TTarget>
target,
out Merit
merit,
out string
explanation
)

ConvertPear<TTarget>

#
Try and convert to a strongly typed value.
public static bool ConvertPear<TTarget>(
source,
out Pear<TTarget>
target
)

ConvertPearStrong<TSource, TTarget>

#
Try and convert between strongly typed values.
public static bool ConvertPearStrong<TSource, TTarget>(
Pear<TSource>
source,
out Pear<TTarget>
target,
out Merit
merit,
out string
explanation
)

ConvertPearStrong<TSource, TTarget>

#
Try and convert between strongly typed values.
public static bool ConvertPearStrong<TSource, TTarget>(
Pear<TSource>
source,
out Pear<TTarget>
target
)

ConvertTQ<TSource, TTarget>

#
Try and convert between strongly typed values.
public static bool ConvertTQ<TSource, TTarget>(
TSource
source,
out TTarget
target,
out Merit
merit,
out string
explanation
)

ConvertTQ<TSource, TTarget>

#
Try and convert between strongly typed values.
public static bool ConvertTQ<TSource, TTarget>(
TSource
source,
out TTarget
target
)

DowngradeType

#
Downgrade a type used in Grasshopper 2 to an equivalent type in Grasshopper 1.
public static object DowngradeType(
value
)

FindConversion

#
Get conversion action between two types.
public static ConversionAction FindConversion(
sourceType,
targetType
)

FindConversion<TSource, TTarget>

#
Get conversion action between two types.
public static ConversionAction<TSource, TTarget> FindConversion<TSource, TTarget>()

ShowDiagram

#
public static void ShowDiagram()

TryAddConversion

#
Attempt to add a conversion delegate. The method must point to a ConversionDelegate<TSource, TTarget> compliant method and have at least a MeritAttribute attached to it.
public static bool TryAddConversion(
method
)

UpgradeType

#
Upgrade a type used in Grasshopper 1 to an equivalent type in Grasshopper 2.
public static object UpgradeType(
value
)