M
Matthias S.
Hi,
I've got a class with an Options property. I'd like to implement this
property in a way that a calling syntax like
MyClassInstance.Options = MyClass.Option1 | MyClass.Option2;
can be used. My questions with that:
1. How do I store these BitFlags internally?
2. How do I check for whether certain Bits have been set.
3. The above code shows how to switch 2 bits ON (hopefully, correct me
if I'm wrong). How would the syntax look If I'd like to switch Option1
ON and Option2 OFF?
I'd highly appreceate a short example!
Thanks in advance.
Matthias
I've got a class with an Options property. I'd like to implement this
property in a way that a calling syntax like
MyClassInstance.Options = MyClass.Option1 | MyClass.Option2;
can be used. My questions with that:
1. How do I store these BitFlags internally?
2. How do I check for whether certain Bits have been set.
3. The above code shows how to switch 2 bits ON (hopefully, correct me
if I'm wrong). How would the syntax look If I'd like to switch Option1
ON and Option2 OFF?
I'd highly appreceate a short example!
Thanks in advance.
Matthias