Class ExtensionMethodsForImplicitTyping
A set of extension methods that assist in enabling implicit typing for the configuration container.
Inheritance
Inherited Members
Namespace: ExtendedXmlSerializer
Assembly: ExtendedXmlSerializer.dll
Syntax
public static class ExtensionMethodsForImplicitTyping
Methods
EnableImplicitTyping(IConfigurationContainer, IEnumerable<Type>)
Convenience method to pass in a source type enumerable and resolve it into an array to pass to EnableImplicitTyping(IConfigurationContainer, Type[]). This is primarily used by the EnableImplicitTyping* methods, but can also be used with any enumerable of System.Type.
Declaration
public static IConfigurationContainer EnableImplicitTyping(this IConfigurationContainer this, IEnumerable<Type> types)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Collections.Generic.IEnumerable<System.Type>
types
The types to register as implicit. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTyping(IConfigurationContainer, Type[])
Enables implicit typing on a configuration container, which will create a serializer that does not emit xmlns namespaces for the provided types, nor will it require them during deserialization. This makes XML more JSON-like in its resulting output and required input, leading to more streamlined and less verbose documents. Note that this feature has limits, namely that there can be only one type with any given name. The type name is considered the unique identifier and if there is more than one type with the same name an exception is thrown.
Declaration
public static IConfigurationContainer EnableImplicitTyping(this IConfigurationContainer this, params Type[] types)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type[]
types
The types to register. Ensure the provided types all have unique names or else an exception is thrown. |
Returns
IConfigurationContainer
The configured configuration container. |
EnableImplicitTypingByInspecting(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all recursively found public property types within the provided type. All public property types found within the provided type will be included and registered as an implicit type. Use this with care and ensure that the names of all the public types found within the namespace are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingByInspecting(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingByInspecting<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all recursively found public property types within the provided type. All public property types found within the provided type will be included and registered as an implicit type. Use this with care and ensure that the names of all the public types found within the namespace are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingByInspecting<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |
See Also
EnableImplicitTypingFromAll(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all found types within the provided subject type's assembly. All types found within the provided subject type's assembly will be included and registered as an implicit type. Use this with care and ensure that the names of all the types found within the assembly are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromAll(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingFromAll<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all found types within the provided subject type's assembly. All types found within the provided subject type's assembly will be included and registered as an implicit type. Use this with care and ensure that the names of all the types found within the assembly are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromAll<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |
See Also
EnableImplicitTypingFromNamespace(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all found types within the provided subject type's namespace. All types found within the provided subject type's namespace will be included and registered as an implicit type. Use this with care and ensure that the names of all the types found within the namespace are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromNamespace(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingFromNamespace<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all found types within the provided subject type's namespace. All types found within the provided subject type's namespace will be included and registered as an implicit type. Use this with care and ensure that the names of all the types found within the namespace are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromNamespace<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |
See Also
EnableImplicitTypingFromNamespacePublic(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all found public types within the provided subject type's namespace. All public types found within the provided subject type's namespace will be included and registered as an implicit type. Use this with care and ensure that the names of all the public types found within the namespace are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromNamespacePublic(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingFromNamespacePublic<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all found public types within the provided subject type's namespace. All public types found within the provided subject type's namespace will be included and registered as an implicit type. Use this with care and ensure that the names of all the public types found within the namespace are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromNamespacePublic<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |
See Also
EnableImplicitTypingFromNested(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all nested types -- private or otherwise -- found within the provided subject type. All nested types found within the provided subject type will be included and registered as an implicit type.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromNested(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingFromNested<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all nested types -- private or otherwise -- found within the provided subject type. All nested types found within the provided subject type will be included and registered as an implicit type.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromNested<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |
See Also
EnableImplicitTypingFromPublic(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all found public types within the provided subject type's assembly. All public types found within the provided subject type's assembly will be included and registered as an implicit type. Use this with care and ensure that the names of all the public types found within the assembly are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromPublic(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingFromPublic<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all found public types within the provided subject type's assembly. All public types found within the provided subject type's assembly will be included and registered as an implicit type. Use this with care and ensure that the names of all the public types found within the assembly are unique. Otherwise, an exception will be thrown if more than one type share the same name.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromPublic<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |
See Also
EnableImplicitTypingFromPublicNested(IConfigurationContainer, Type)
Convenience method to enable implicit typing on a container, using all public-nested types found within the provided subject type. All public nested types found within the provided subject type will be included as an implicit type.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromPublicNested(this IConfigurationContainer this, Type type)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
System.Type
type
The subject type to query for type resolution. |
Returns
IConfigurationContainer
The configured configuration container. |
See Also
EnableImplicitTypingFromPublicNested<T>(IConfigurationContainer)
Convenience method to enable implicit typing on a container, using all public-nested types found within the provided subject type. All public nested types found within the provided subject type will be included as an implicit type.
Declaration
public static IConfigurationContainer EnableImplicitTypingFromPublicNested<T>(this IConfigurationContainer this)
Parameters
IConfigurationContainer
this
The configuration container to configure. |
Returns
IConfigurationContainer
The configured configuration container. |
Type Parameters
T
The subject type to query for type resolution. |