static void Main(string[] args) { var defaultUser = string.Empty; if (args.Length != 0) { defaultUser = args[0]; } System.Console.WriteLine(GreetingService.GreetPerson(defaultUser)); }
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); }; }
private void GreetingButton_Click(object sender, EventArgs e) { var userName = this.EnterNameTextbox.Text; MessageBox.Show(GreetingService.GreetPerson(userName)); }