Freigeben über


LanguagePrimitives Class

Definition

Defines language support methods.

public ref class LanguagePrimitives abstract sealed
public static class LanguagePrimitives
type LanguagePrimitives = class
Public Class LanguagePrimitives
Inheritance
LanguagePrimitives

Methods

Compare(Object, Object, Boolean, IFormatProvider)

Compare first and second, converting second to the type of the first, if necessary.

Compare(Object, Object, Boolean)

Compare first and second, converting second to the type of the first, if necessary.

Compare(Object, Object)

Compare first and second, converting second to the type of the first, if necessary.

ConvertPSObjectToType(PSObject, Type, Boolean, IFormatProvider, Boolean)

Converts PSObject to resultType.

ConvertTo(Object, Type, IFormatProvider)

Converts valueToConvert to resultType possibly considering formatProvider.

ConvertTo(Object, Type)

Converts valueToConvert to resultType.

ConvertTo<T>(Object)

Generic convertto that simplifies working with workflow.

ConvertTypeNameToPSTypeName(String)

BUGBUG - brucepay Mar. 2013 - I don't think this is general enough for dynamic keywords to support arbitrary target languages with arbitrary type representations so we may need an extension point here...

Maps a .NET or CIM type name string (e.g. SInt32) to the form expected by PowerShell users, namely "[typename]" If there is no mapping, then it returns null. If the string to convert is null or empty then the function returns "[object]" as the default typeless type.

Equals(Object, Object, Boolean, IFormatProvider)

Used to compare two objects for equality converting the second to the type of the first, if required.

Equals(Object, Object, Boolean)

Used to compare two objects for equality converting the second to the type of the first, if required.

Equals(Object, Object)

Used to compare two objects for equality converting the second to the type of the first, if required.

GetEnumerable(Object)

Retrieves the IEnumerable of obj or null if the language does not consider obj to be IEnumerable.

GetEnumerator(Object)

Retrieves the IEnumerator of obj or null if the language does not consider obj as capable of returning an IEnumerator.

GetPSDataCollection(Object)

This method takes a an arbitrary object and wraps it in a PSDataCollection of PSObject. This simplifies interacting with the PowerShell workflow activities.

IsObjectEnumerable(Object)

Returns True if the language considers obj to be IEnumerable.

IsTrue(Object)

Returns true if the language considers obj to be true.

TryCompare(Object, Object, Boolean, IFormatProvider, Int32)

Tries to compare first and second, converting second to the type of the first, if necessary. If a conversion is needed but fails, false is return.

TryCompare(Object, Object, Boolean, Int32)

Tries to compare first and second, converting second to the type of the first, if necessary. If a conversion is needed but fails, false is return.

TryCompare(Object, Object, Int32)

Tries to compare first and second, converting second to the type of the first, if necessary. If a conversion is needed but fails, false is return.

TryConvertTo(Object, Type, IFormatProvider, Object)

Sets result to valueToConvert converted to resultType considering formatProvider for custom conversions, calling the Parse method and calling Convert.ChangeType.

TryConvertTo(Object, Type, Object)

Sets result to valueToConvert converted to resultType.

TryConvertTo<T>(Object, IFormatProvider, T)

Sets result to valueToConvert converted to resultType considering formatProvider for custom conversions, calling the Parse method and calling Convert.ChangeType.

TryConvertTo<T>(Object, T)

Sets result to valueToConvert converted to resultType.

Applies to