コード例 #1
0
ファイル: Program.cs プロジェクト: odinscode/mentoring
        static void Main(string[] args)
        {
            var defaultUser = string.Empty;

            if (args.Length != 0)
            {
                defaultUser = args[0];
            }
            System.Console.WriteLine(GreetingService.GreetPerson(defaultUser));
        }
コード例 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.activity_main);

            EditText userNameInput = FindViewById <EditText>(Resource.Id.UserNameInput);
            TextView userGreeted   = FindViewById <TextView>(Resource.Id.UserGreeted);
            Button   greetButton   = FindViewById <Button>(Resource.Id.GreetButton);

            greetButton.Click += (sender, e) =>
            {
                userGreeted.Text = GreetingService.GreetPerson(userNameInput.Text);
            };
        }
コード例 #3
0
        private void GreetingButton_Click(object sender, EventArgs e)
        {
            var userName = this.EnterNameTextbox.Text;

            MessageBox.Show(GreetingService.GreetPerson(userName));
        }