一篇有意思的文章

Posted: 十二月 3rd, 2003 | Author: | Filed under: 胡编 | 1 Comment »

先来看看效果吧——

文章地址:http://www.codeproject.net/cs/miscctrl/flagseditor.asp


One Comment on “一篇有意思的文章”

  1. 1 http:// said at 8:31 下午 on 十二月 3rd, 2003:

    Otherwise an enum like this:

    enum Test{ ValueA = 1, ValueB = 2, ValueC = 4, ValueAB = ValueA | ValueB // 3}

    Will result in the initial checks having the combined value being checked if only one of the values is actually set. And when it returns the value it erringly adds values instead of ORing them.

    So if you have ValueAB checked, the value returned will be 6 (ValueA + ValueB + ValueAB) where-as the correct value is 3 (ValueAB).

    If you don’t mind, I’ll be using this code in the next version of my Wizard framework[^]. The only changes I made aside from the two fixes above was to change the namespace to match what I use in the framework. I have also included comments that the original code is yours.

    James

    唉,我好笨


Leave a Reply