You can get rid of your if/else statements by negating the bool’s value:
ruleScreenActive = !ruleScreenActive;
More Related Contents:
- CS0030: Cannot convert type ‘int’ to ‘bool’ [closed]
- Why does Boolean.ToString output “True” and not “true”
- What is the difference between bool and Boolean types in C#
- show Yes/NO instead True/False in datagridview
- What is the binary representation of a boolean value in c#
- Is a bool read/write atomic in C#
- Programming P2P application
- When to use Cast() and Oftype() in Linq
- What is the { get; set; } syntax in C#?
- What difference does .AsNoTracking() make?
- How can I limit Parallel.ForEach?
- Visual Studio 2010 suddenly can’t see namespace?
- How can I fix the Microsoft Visual Studio error: “package did not load correctly”?
- How to trigger event when a variable’s value is changed?
- Admin rights for a single method
- How to write Asynchronous LINQ query?
- Converting file into Base64String and back again
- Keep window on top and steal focus in WinForms
- C# arrow key input for a console app
- Finding an item in a List using C#
- Count number of bits in a 64-bit (long, big) integer?
- Application can’t scaffold items
- How can I disable model compatibility checking in Entity Framework 4.3?
- Access ASP.NET control from static [WebMethod] (JS ajax call)
- How to pass a null variable to a SQL Stored Procedure from C#.net code
- Custom deserializer only for some fields with json.NET
- Task.Run with Parameter(s)?
- Process.Start(url) fails
- How to Upload Image Via WebApi
- How to get hold of Content that is already read