private void Save_Click(object sender, EventArgs e) { var foo = new Foo(this.Key.Text); if (MessageBox.Show("Do you want to save a Foo object with key \'" + foo.GetCmKey() + "\'?", "Proceed?", MessageBoxButtons.OKCancel) != DialogResult.OK) return; if (this.IsSync.Checked) { this.Results.Text = JsonConvert.SerializeObject(foo.Save()); } else { foo.SaveAsync(result => { this.Results.Text = JsonConvert.SerializeObject(result); }); } }