LanguagePrimitives LanguagePrimitives LanguagePrimitives Class

Definition

Defines language support methods

public static class LanguagePrimitives
type LanguagePrimitives = class
Public Class LanguagePrimitives
Inheritance
LanguagePrimitivesLanguagePrimitivesLanguagePrimitives

Methods

Compare(Object, Object) Compare(Object, Object) Compare(Object, Object)

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

Compare(Object, Object, Boolean) Compare(Object, Object, Boolean) Compare(Object, Object, Boolean)

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

Compare(Object, Object, Boolean, IFormatProvider) Compare(Object, Object, Boolean, IFormatProvider) Compare(Object, Object, Boolean, IFormatProvider)

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

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

Converts PSObject to resultType.

ConvertTo(Object, Type) ConvertTo(Object, Type) ConvertTo(Object, Type)

Converts valueToConvert to resultType

ConvertTo(Object, Type, IFormatProvider) ConvertTo(Object, Type, IFormatProvider) ConvertTo(Object, Type, IFormatProvider)

Converts valueToConvert to resultType possibly considering formatProvider

ConvertTo<T>(Object) ConvertTo<T>(Object) ConvertTo<T>(Object)

Generic convertto that simplifies working with workflow.

ConvertTypeNameToPSTypeName(String) ConvertTypeNameToPSTypeName(String) 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) Equals(Object, Object, Boolean, IFormatProvider) 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) Equals(Object, Object, Boolean) 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) Equals(Object, Object) Equals(Object, Object)

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

GetEnumerable(Object) GetEnumerable(Object) GetEnumerable(Object)

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

GetEnumerator(Object) GetEnumerator(Object) GetEnumerator(Object)

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

GetPSDataCollection(Object) GetPSDataCollection(Object) 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) IsObjectEnumerable(Object) IsObjectEnumerable(Object)

Returns True if the language considers obj to be IEnumerable

IsTrue(Object) IsTrue(Object) IsTrue(Object)

Returns true if the language considers obj to be true

TryConvertTo(Object, Type, Object) TryConvertTo(Object, Type, Object) TryConvertTo(Object, Type, Object)

Sets result to valueToConvert converted to resultType.

TryConvertTo(Object, Type, IFormatProvider, Object) TryConvertTo(Object, Type, IFormatProvider, Object) 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<T>(Object, T) TryConvertTo<T>(Object, T) TryConvertTo<T>(Object, T)

Sets result to valueToConvert converted to resultType.

TryConvertTo<T>(Object, IFormatProvider, T) TryConvertTo<T>(Object, IFormatProvider, T) 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.

Applies to