Код: Выделить всё
var isVisible = false
isVisible.toggle() // true
Код: Выделить всё
public static class Utilities {
public static void Toggle(this bool variable) {
variable = !variable;
//bool temp = variable;
//variable = !temp;
}
}
Есть ли способ реализовать ту же функцию переключения на C#?
Подробнее здесь: https://stackoverflow.com/questions/728 ... n-the-same