Files
mono/mcs/class/System.ComponentModel.Composition/Tests/UnitTestFramework/System/EnumExtensions.cs
T
Miguel de Icaza e3f39fb13c Add MEF for .NET 4
svn path=/trunk/mcs/; revision=145695
2009-11-09 01:39:41 +00:00

21 lines
576 B
C#

// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// -----------------------------------------------------------------------
#if !CLR40
using System;
namespace System
{
public static class EnumExtensions
{
public static bool HasFlag(this Enum enumRef, Enum flag)
{
long value = Convert.ToInt64(enumRef);
long flagVal = Convert.ToInt64(flag);
return (value & flagVal) == flagVal;
}
}
}
#endif