从DataGridViewContentAlignment中提取垂直和水平对齐

时间:2013-08-29 12:17:20

标签: .net enums bit-manipulation

我正在尝试为水平对齐测试以下类型的值:

public enum DataGridViewContentAlignment
{
    NotSet = 0,
    TopLeft = 1,
    TopCenter = 2,
    TopRight = 4,
    MiddleLeft = 16,
    MiddleCenter = 32,
    MiddleRight = 64,
    BottomLeft = 256,
    BottomCenter = 512,
    BottomRight = 1024,
}

例如,如果Aligneent是XXXLeft,我想编写一个返回true的测试。是否有一种紧凑的方式来编写它而不是三个或从句?

0 个答案:

没有答案