Current filter:
                                You should refresh the page.
                                  • Apply Boolean to Enum refactoring on the following code:

                                    [C#]
                                    class MyAttribute : Attribute { public MyAttribute(bool isSet) { IsSet = isSet; } public bool IsSet { get; } } [My(true)] class Program { static void Main(string[] args) { bool value = true; MyAttribute attr = new MyAttribute(false); attr = new MyAttribute(value); } }

                                    Result:

                                    [C#]
                                    class MyAttribute : Attribute { public MyAttribute(MyAttributeParam isSet) { IsSet = isSet == MyAttributeParam.Success; } public bool IsSet { get; } } public enum MyAttributeParam { Success, Failure } [My(true)] class Program { static void Main(string[] args) { bool value = true; MyAttribute attr = new MyAttribute(MyAttributeParam.Failure); attr = new MyAttribute(value ? MyAttributeParam.Success : MyAttributeParam.Failure); } }

                                    Expected Result:

                                    [C#]
                                    class MyAttribute : Attribute { public MyAttribute(MyAttributeParam isSet) { IsSet = isSet == MyAttributeParam.Success; } public bool IsSet { get; } } public enum MyAttributeParam { Success, Failure } [My(MyAttributeParam.Success)] class Program { static void Main(string[] args) { bool value = true; MyAttribute attr = new MyAttribute(MyAttributeParam.Failure); attr = new MyAttribute(value ? MyAttributeParam.Success : MyAttributeParam.Failure); } }
                                • Alex Z (DevExpress) 08.19.2016

                                  I have reproduced this issue and passed it to our developers. We will notify you of our results.

                                1 Solution

                                Creation Date Importance Sort by

                                Fixed: