コード例 #1
0
    public static void Main()
    {
        DisplayMessage messageTarget;

        if (Enviroment.GetCommandLineArgs().Length > 1)
        {
            messageTarget = ShowWindowsMessage;
        }
        else
        {
            messageTarget = Console.WriteLine;
        }

        messageTarget("Hello word!");
    }