protected void btnEval_Click(object sender, EventArgs e) { var hundredBRL = new Money(100M); this.lblTotal.Text = hundredBRL.ToString(); // Anonymous type var x = new { Nome = "bernardo", Idade = "24", }; #region Calling static member var thousand = Money.Thousand(); #endregion #region Calling non-static members (instance members) var moneyObj = new Money(); moneyObj.One(); #endregion #region Calling methods By Ref decimal b = 100; this.DoSomething(ref b); this.lblTotal.Text = b.ToString(); #endregion #region Calling methods By Ref with Reference Objects string goodBeer = "abadessa"; this.ToUpper(ref goodBeer); this.lblTotal.Text = goodBeer; #endregion #region Calling methods with out parameters int v100 = 100, res; this.Multiply(value: v100, result: out res); // Using TryParse method bool success; int valueParsed; success = Int32.TryParse("foo", out valueParsed); if (!success) { Response.Redirect("http://www.lmgtfy.com/?q=foo is not " + valueParsed); } #endregion }
protected void btnEval_Click(object sender, EventArgs e) { var hundredBRL = new Money(100M); this.lblTotal.Text = hundredBRL.ToString(); // Anonymous type var x = new { Nome = "bernardo", Idade = "24", }; #region Calling static member var thousand = Money.Thousand(); #endregion #region Calling non-static members (instance members) var moneyObj = new Money(); moneyObj.One(); #endregion #region Calling methods By Ref decimal b = 100; this.DoSomething(ref b); this.lblTotal.Text = b.ToString(); #endregion #region Calling methods By Ref with Reference Objects string goodBeer = "abadessa"; this.ToUpper(ref goodBeer); this.lblTotal.Text = goodBeer; #endregion #region Calling methods with out parameters int v100 = 100, res; this.Multiply(value: v100, result: out res); // Using TryParse method bool success; int valueParsed; success = Int32.TryParse("foo", out valueParsed); if (!success) Response.Redirect("http://www.lmgtfy.com/?q=foo is not " + valueParsed); #endregion }
protected void btnEval_Click(object sender, EventArgs e) { var hundredBRL = new Money(100M); this.lblTotal.Text = hundredBRL.ToString(); // Anonymous type var x = new { Nome = "bernardo", Idade = "24", }; #region Calling static member var thousand = Money.Thousand(); #endregion #region Calling non-static members (instance members) var moneyObj = new Money(); moneyObj.One(); #endregion #region Calling methods By Ref decimal b = 100; this.DoSomething(ref b); this.lblTotal.Text = b.ToString(); #endregion #region Calling methods By Ref with Reference Objects string goodBeer = "abadessa"; this.ToUpper(ref goodBeer); this.lblTotal.Text = goodBeer; #endregion }