Skip to content

Instantly share code, notes, and snippets.

@theunrepentantgeek
Created June 27, 2016 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theunrepentantgeek/065723944d5a3af5620c461e811310c7 to your computer and use it in GitHub Desktop.
Save theunrepentantgeek/065723944d5a3af5620c461e811310c7 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Demo
{
enum OriginShow
{
None,
StarWars,
StarTrek,
Stargate,
Babylon5,
DrWho
}
class Program
{
static void Main(string[] args)
{
OriginShow? origin = null;
Console.WriteLine(origin == OriginShow.StarTrek); // False
Console.WriteLine(origin == OriginShow.Stargate); // False
Console.WriteLine(origin == null); // True
origin = OriginShow.Stargate;
Console.WriteLine(origin == OriginShow.StarTrek); // False
Console.WriteLine(origin == OriginShow.Stargate); // True
Console.WriteLine(origin == null); // False
Console.ReadLine();
}
void Write(bool value)
{
Console.WriteLine(value: value.ToString());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment