Replace extension method 'IsComObject(this Type)' with Type.IsCOMObject (#4646)

This commit is contained in:
Dongbo Wang
2017-08-22 17:44:48 -07:00
committed by Sergei Vorobev
parent 5941b894ab
commit cfe173ac0e
3 changed files with 3 additions and 13 deletions
@@ -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)
{