TypeAssistantExtensionMethods

public static class TypeAssistantExtensionMethods
Extension methods for ITypeAssistant implementations.

Methods

DescribeLazyBoth

#Example
public static LazyStrings DescribeLazyBoth(this ITypeAssistant assistant, IPear pear, string prefix = null, string suffix = null)
Combine the primary and secondary descriptors into a single LazyStrings instance. This method handles formatting for null pears correctly.
assistant (ITypeAssistant)Assistant to invoke.
pear (IPear)Value to operate on.
prefix (string = null)Optional prefix for the primary string.
suffix (string = null)Optional suffix for the primary string.
Lazystring pair.

DescribeLazyPrimary

#Example
public static LazyString DescribeLazyPrimary(this ITypeAssistant assistant, IPear pear, string prefix = null, string suffix = null)
Wrap the primary descriptor into a single LazyString instance. This method handles formatting for null pears correctly.
assistant (ITypeAssistant)Assistant to invoke.
pear (IPear)Value to operate on.
prefix (string = null)Optional prefix for the descriptor string.
suffix (string = null)Optional suffix for the descriptor string.
Lazy string with deferred formatting.

DescribeLazySecondary

#Example
public static LazyString DescribeLazySecondary(this ITypeAssistant assistant, IPear pear)
Wrap the secondary descriptor into a single LazyString instance. This method handles formatting for null pears correctly.
assistant (ITypeAssistant)Assistant to invoke.
pear (IPear)Value to operate on.
Lazy string with deferred formatting.

FormatLazy

#Example
public static LazyString FormatLazy(this ITypeAssistant assistant, IPear pear)
Wrap the formatting into a single LazyString instance. This method handles formatting for null pears correctly.
assistant (ITypeAssistant)Assistant to invoke.
pear (IPear)Value to operate on.
Lazy string with deferred formatting.

ToStringWithFallback

#Example
public static string ToStringWithFallback(this ITypeAssistant assistant, IPear pear)
Call either the Format, FormatPartial or DescribePrimary methods depending on which one is available.
assistant (ITypeAssistant)
pear (IPear)
The result of one of the formatting methods, or string.Empty.