Created
May 20, 2019 10:14
-
-
Save andreisfedotov/700a6cd140b1e555947c2f5ec2483f1e to your computer and use it in GitHub Desktop.
Is feature disabled?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DataMember] | |
private bool IsFeatureDisabled | |
{ | |
get { return (Feature & (byte)IntegratedProducts.DisabledFlag) > 0; } | |
set | |
{ | |
Feature = value | |
? (byte)(Feature | (byte) IntegratedProducts.DisabledFlag) | |
: (byte)(Feature & (byte.MaxValue ^ (byte) IntegratedProducts.DisabledFlag)); | |
} | |
} | |
[DataMember] | |
private byte FeatureCode | |
{ | |
get { return (byte)(Feature & (byte.MaxValue ^ (byte)IntegratedProducts.DisabledFlag)); } | |
set | |
{ | |
Feature = IsFeatureDisabled | |
? (byte) (value | (byte) IntegratedProducts.DisabledFlag) | |
: value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment