ConvertThroughString Class

Enables the LanguagePrimitives.ConvertTo method to convert a type to another type by using a string conversion.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation.dll)

'Usage
Dim instance As ConvertThroughString

'Declaration
Public Class ConvertThroughString
	Inherits PSTypeConverter
public class ConvertThroughString extends PSTypeConverter
public class ConvertThroughString extends PSTypeConverter

For example, suppose you have a type that has a parsing method that converts only a string to your type. If you want the ConvertTo method to use this converter with your class, you should use the TypeConverterAttribute with ConvertThroughString in your class. This would allow your type to convert integers, doubles, strings and other types.

Although it is possible to derive from this class, there is no established scenario for doing this and any attempt to do so might result in unexpected behavior.


System.Object
   System.Management.Automation.PSTypeConverter
    System.Management.Automation.ConvertThroughString

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

 

Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Show:
© 2014 Microsoft