Mega Code Archive

 
Categories / C# / Language Basics
 

Iff operator in C#

//Octavalent Extension Methods //http://sdfasdf.codeplex.com/ //Library of extension methods for .Net create by Octavalent (www.octavalent.nl) namespace System.OctavalentExtensions {     public static class BooleanExtensions     {         public static object Iff(this bool value, object valueIfTrue, object valueIfFalse)         {             if (value)                 return valueIfTrue;             return valueIfFalse;         }     } }