本文整理汇总了C#中Foo.enum_test方法的典型用法代码示例。如果您正苦于以下问题:C# Foo.enum_test方法的具体用法?C# Foo.enum_test怎么用?C# Foo.enum_test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Foo
的用法示例。
在下文中一共展示了Foo.enum_test方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
// Print out the value of some enums
Console.WriteLine("*** color ***");
Console.WriteLine(" " + color.RED + " = " + (int)color.RED);
Console.WriteLine(" " + color.BLUE + " = " + (int)color.BLUE);
Console.WriteLine(" " + color.GREEN + " = " + (int)color.GREEN);
Console.WriteLine("\n*** Foo::speed ***");
Console.WriteLine(" Foo::" + Foo.speed.IMPULSE + " = " + (int)Foo.speed.IMPULSE);
Console.WriteLine(" Foo::" + Foo.speed.WARP + " = " + (int)Foo.speed.WARP);
Console.WriteLine(" Foo::" + Foo.speed.LUDICROUS + " = " + (int)Foo.speed.LUDICROUS);
Console.WriteLine("\nTesting use of enums with functions\n");
example.enum_test(color.RED, Foo.speed.IMPULSE);
example.enum_test(color.BLUE, Foo.speed.WARP);
example.enum_test(color.GREEN, Foo.speed.LUDICROUS);
Console.WriteLine( "\nTesting use of enum with class method" );
Foo f = new Foo();
f.enum_test(Foo.speed.IMPULSE);
f.enum_test(Foo.speed.WARP);
f.enum_test(Foo.speed.LUDICROUS);
}
示例2: Main
static void Main()
{
// Print out the value of some enums
Console.WriteLine("*** color ***");
Console.WriteLine(" RED = " + example.RED);
Console.WriteLine(" BLUE = " + example.BLUE);
Console.WriteLine(" GREEN = " + example.GREEN);
Console.WriteLine("\n*** Foo::speed ***");
Console.WriteLine(" Foo::IMPULSE = " + Foo.IMPULSE);
Console.WriteLine(" Foo::WARP = " + Foo.WARP);
Console.WriteLine(" Foo::LUDICROUS = " + Foo.LUDICROUS);
Console.WriteLine("\nTesting use of enums with functions\n");
example.enum_test(example.RED, Foo.IMPULSE);
example.enum_test(example.BLUE, Foo.WARP);
example.enum_test(example.GREEN, Foo.LUDICROUS);
example.enum_test(1234,5678);
Console.WriteLine( "\nTesting use of enum with class method" );
Foo f = new Foo();
f.enum_test(Foo.IMPULSE);
f.enum_test(Foo.WARP);
f.enum_test(Foo.LUDICROUS);
}