mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Replace extension method 'IsComObject(this Type)' with Type.IsCOMObject (#4646)
This commit is contained in:
committed by
Sergei Vorobev
parent
5941b894ab
commit
cfe173ac0e
@@ -2472,8 +2472,8 @@ namespace System.Management.Automation
|
||||
if (declaringTypeInfo.IsValueType ||
|
||||
propertyTypeInfo.IsGenericType ||
|
||||
declaringTypeInfo.IsGenericType ||
|
||||
property.DeclaringType.IsComObject() ||
|
||||
property.PropertyType.IsComObject())
|
||||
property.DeclaringType.IsCOMObject ||
|
||||
property.PropertyType.IsCOMObject)
|
||||
{
|
||||
this.readOnly = property.GetSetMethod() == null;
|
||||
this.writeOnly = property.GetGetMethod() == null;
|
||||
|
||||
@@ -463,7 +463,7 @@ namespace System.Management.Automation
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
if (objectType.IsComObject())
|
||||
if (objectType.IsCOMObject)
|
||||
{
|
||||
// All WinRT types are COM types.
|
||||
// All WinRT types would contain the TypeAttributes flag being set to WindowsRunTime.
|
||||
|
||||
@@ -118,16 +118,6 @@ namespace System.Management.Automation
|
||||
return LanguagePrimitives.IsInteger(LanguagePrimitives.GetTypeCode(type));
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static bool IsComObject(this Type type)
|
||||
{
|
||||
#if UNIX
|
||||
return false;
|
||||
#else
|
||||
return type.IsCOMObject;
|
||||
#endif
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
internal static TypeCode GetTypeCode(this Type type)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user