Bool değişkenin değerini true ise false, false ise true yapan csharp kodu alternatifidir.
public static bool DegerDegistir(bool b)
{
try
{
if (b == true)
{
b = false;
}
else
{
b = true;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return b;
}