当前位置: 首页>>代码示例>>C#>>正文


C# Foo.enum_test方法代码示例

本文整理汇总了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);
    }
开发者ID:FeepingCreature,项目名称:swig,代码行数:26,代码来源:runme.cs

示例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);
    }
开发者ID:janearc,项目名称:posixnap_old,代码行数:27,代码来源:runme.cs


注:本文中的Foo.enum_test方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。