提交 2985194f 编写于 作者: J Justin Van Patten
上级 ef38b2b3
......@@ -175,12 +175,12 @@ internal static bool IsWindowsRuntimeObject(DynamicMetaObject obj)
Type curType = obj.RuntimeType;
while (curType != null)
{
if (curType.GetTypeInfo().Attributes.HasFlag(System.Reflection.TypeAttributes.WindowsRuntime))
if ((curType.GetTypeInfo().Attributes & TypeAttributes.WindowsRuntime) == TypeAttributes.WindowsRuntime)
{
// Found a WinRT COM object
return true;
}
if (curType.GetTypeInfo().Attributes.HasFlag(System.Reflection.TypeAttributes.Import))
if ((curType.GetTypeInfo().Attributes & TypeAttributes.Import) == TypeAttributes.Import)
{
// Found a class that is actually imported from COM but not WinRT
// this is definitely a non-WinRT COM object
......
......@@ -44,7 +44,7 @@ internal class CType : ITypeOrNamespace
public bool IsWindowsRuntimeType()
{
return this.AssociatedSystemType.GetTypeInfo().Attributes.HasFlag(System.Reflection.TypeAttributes.WindowsRuntime);
return (this.AssociatedSystemType.GetTypeInfo().Attributes & TypeAttributes.WindowsRuntime) == TypeAttributes.WindowsRuntime;
}
public bool IsCollectionType()
......
......@@ -805,10 +805,10 @@ Namespace Microsoft.VisualBasic.CompilerServices
Get
Dim curType As Type = _type
While curType IsNot Nothing
If curType.GetTypeInfo.Attributes.HasFlag(System.Reflection.TypeAttributes.WindowsRuntime) Then
If (curType.GetTypeInfo.Attributes And TypeAttributes.WindowsRuntime) = TypeAttributes.WindowsRuntime Then
' Found a WinRT COM object
Return True
ElseIf curType.GetTypeInfo.Attributes.HasFlag(System.Reflection.TypeAttributes.Import) Then
ElseIf (curType.GetTypeInfo.Attributes And TypeAttributes.Import) = TypeAttributes.Import Then
' Found a class that is actually imported from COM but not WinRT
' this is definitely a non-WinRT COM object
Return False
......
......@@ -148,7 +148,7 @@ public void Attributes(Type type, string name, int index, ParameterAttributes[]
ParameterInfo parameterInfo = GetParameterInfo(type, name, index);
foreach (ParameterAttributes attribute in expected)
{
Assert.True(parameterInfo.Attributes.HasFlag(attribute));
Assert.True((parameterInfo.Attributes & attribute) == attribute);
}
}
......
......@@ -135,7 +135,7 @@ public static IStorePal FromSystemStore(string storeName, StoreLocation storeLoc
return new DirectoryBasedStoreProvider(storeName, openFlags);
}
if (openFlags.HasFlag(OpenFlags.ReadWrite))
if ((openFlags & OpenFlags.ReadWrite) == OpenFlags.ReadWrite)
{
throw new PlatformNotSupportedException(SR.Cryptography_Unix_X509_MachineStoresReadOnly);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册