Use "string" instead of "String"

This commit is contained in:
2017-02-15 07:21:26 +01:00
parent c223951fda
commit d6a19bdf27
7 changed files with 23 additions and 21 deletions

View File

@@ -67,7 +67,7 @@ namespace VAR.Focus.Web.Controls
CssClass = CssClassBase; CssClass = CssClassBase;
if (string.IsNullOrEmpty(_cssClassExtra) == false) if (string.IsNullOrEmpty(_cssClassExtra) == false)
{ {
CssClass = String.Format("{0} {1}", CssClassBase, _cssClassExtra); CssClass = string.Format("{0} {1}", CssClassBase, _cssClassExtra);
} }
if (Page.IsPostBack && (_allowEmpty == false && IsEmpty()) || _markedInvalid) if (Page.IsPostBack && (_allowEmpty == false && IsEmpty()) || _markedInvalid)
{ {
@@ -82,7 +82,7 @@ namespace VAR.Focus.Web.Controls
if (_nextFocusOnEnter != null) if (_nextFocusOnEnter != null)
{ {
this.Attributes.Add("onkeydown", String.Format( this.Attributes.Add("onkeydown", string.Format(
"if(event.keyCode==13){{document.getElementById('{0}').focus(); return false;}}", "if(event.keyCode==13){{document.getElementById('{0}').focus(); return false;}}",
_nextFocusOnEnter.ClientID)); _nextFocusOnEnter.ClientID));
} }

View File

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Web;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using VAR.Focus.BusinessLogic; using VAR.Focus.BusinessLogic;
using VAR.Focus.BusinessLogic.Entities; using VAR.Focus.BusinessLogic.Entities;
@@ -29,7 +30,7 @@ namespace VAR.Focus.Web.Pages
private void FrmBoard_Init(object sender, EventArgs e) private void FrmBoard_Init(object sender, EventArgs e)
{ {
string strIDBoard = Context.GetRequestParm("idBoard"); string strIDBoard = Context.GetRequestParm("idBoard");
if (String.IsNullOrEmpty(strIDBoard) == false) if (string.IsNullOrEmpty(strIDBoard) == false)
{ {
_idBoard = Convert.ToInt32(strIDBoard); _idBoard = Convert.ToInt32(strIDBoard);
} }
@@ -134,7 +135,7 @@ namespace VAR.Focus.Web.Pages
}; };
btnDelete.CommandArgument = Convert.ToString(board.IDBoard); btnDelete.CommandArgument = Convert.ToString(board.IDBoard);
btnDelete.Click += BtnDelete_Click; btnDelete.Click += BtnDelete_Click;
btnDelete.Attributes.Add("onclick", String.Format("return confirm('{0}');", "¿Are you sure to delete?")); btnDelete.Attributes.Add("onclick", string.Format("return confirm('{0}');", "¿Are you sure to delete?"));
pnlButtons.Controls.Add(btnDelete); pnlButtons.Controls.Add(btnDelete);
pnlBoardSelector.Controls.Add(pnlButtons); pnlBoardSelector.Controls.Add(pnlButtons);

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Web;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using VAR.Focus.BusinessLogic; using VAR.Focus.BusinessLogic;
using VAR.Focus.BusinessLogic.Entities; using VAR.Focus.BusinessLogic.Entities;
@@ -39,7 +40,7 @@ namespace VAR.Focus.Web.Pages
private void FrmBoardEdit_Init(object sender, EventArgs e) private void FrmBoardEdit_Init(object sender, EventArgs e)
{ {
string strIDBoard = Context.GetRequestParm("idBoard"); string strIDBoard = Context.GetRequestParm("idBoard");
if (String.IsNullOrEmpty(strIDBoard) == false) if (string.IsNullOrEmpty(strIDBoard) == false)
{ {
_idBoard = Convert.ToInt32(strIDBoard); _idBoard = Convert.ToInt32(strIDBoard);
} }
@@ -102,7 +103,7 @@ namespace VAR.Focus.Web.Pages
Panel pnlButtons = new Panel(); Panel pnlButtons = new Panel();
pnlButtons.Controls.Add(_btnSave); pnlButtons.Controls.Add(_btnSave);
pnlButtons.Controls.Add(_btnExit); pnlButtons.Controls.Add(_btnExit);
Controls.Add(FormUtils.CreateField(String.Empty, pnlButtons)); Controls.Add(FormUtils.CreateField(string.Empty, pnlButtons));
} }
private void LoadData() private void LoadData()

View File

@@ -43,17 +43,17 @@ namespace VAR.Focus.Web.Pages
while (exAux != null) while (exAux != null)
{ {
CLabel lblMessage = new CLabel { Tag = "P" }; CLabel lblMessage = new CLabel { Tag = "P" };
lblMessage.Text = String.Format("<b>{0}:</b> {1}", "Message", HttpUtility.HtmlEncode(exAux.Message)); lblMessage.Text = string.Format("<b>{0}:</b> {1}", "Message", HttpUtility.HtmlEncode(exAux.Message));
Controls.Add(lblMessage); Controls.Add(lblMessage);
CLabel lblStacktraceTitle = new CLabel { Tag = "p" }; CLabel lblStacktraceTitle = new CLabel { Tag = "p" };
lblStacktraceTitle.Text = String.Format("<b>{0}:</b>", "Stacktrace"); lblStacktraceTitle.Text = string.Format("<b>{0}:</b>", "Stacktrace");
Controls.Add(lblStacktraceTitle); Controls.Add(lblStacktraceTitle);
Panel pnlStacktrace = new Panel(); Panel pnlStacktrace = new Panel();
pnlStacktrace.CssClass = "divCode"; pnlStacktrace.CssClass = "divCode";
Controls.Add(pnlStacktrace); Controls.Add(pnlStacktrace);
LiteralControl litStackTrace = new LiteralControl( LiteralControl litStackTrace = new LiteralControl(
String.Format("<pre><code>{0}</code></pre>", HttpUtility.HtmlEncode(exAux.StackTrace))); string.Format("<pre><code>{0}</code></pre>", HttpUtility.HtmlEncode(exAux.StackTrace)));
pnlStacktrace.Controls.Add(litStackTrace); pnlStacktrace.Controls.Add(litStackTrace);
exAux = exAux.InnerException; exAux = exAux.InnerException;

View File

@@ -65,11 +65,11 @@ namespace VAR.Focus.Web.Pages
_txtPassword.NextFocusOnEnter = _btnLogin; _txtPassword.NextFocusOnEnter = _btnLogin;
_txtPassword.PlaceHolder = "Password"; _txtPassword.PlaceHolder = "Password";
Controls.Add(FormUtils.CreateField(String.Empty, _btnLogin)); Controls.Add(FormUtils.CreateField(string.Empty, _btnLogin));
_btnLogin.Text = "Login"; _btnLogin.Text = "Login";
_btnLogin.Click += btnLogin_Click; _btnLogin.Click += btnLogin_Click;
Controls.Add(FormUtils.CreateField(String.Empty, new HyperLink { Text = "Register user", NavigateUrl = "FrmRegister" })); Controls.Add(FormUtils.CreateField(string.Empty, new HyperLink { Text = "Register user", NavigateUrl = "FrmRegister" }));
} }
#endregion Private methods #endregion Private methods

View File

@@ -51,8 +51,8 @@ namespace VAR.Focus.Web.Pages
{ {
_txtPassword1.MarkedInvalid = true; _txtPassword1.MarkedInvalid = true;
_txtPassword2.MarkedInvalid = true; _txtPassword2.MarkedInvalid = true;
_txtPassword1.Text = String.Empty; _txtPassword1.Text = string.Empty;
_txtPassword2.Text = String.Empty; _txtPassword2.Text = string.Empty;
return; return;
} }
@@ -60,7 +60,7 @@ namespace VAR.Focus.Web.Pages
_pnlRegister.Visible = false; _pnlRegister.Visible = false;
_pnlSuccess.Visible = true; _pnlSuccess.Visible = true;
_lblSuccess.Text = String.Format("User {0} created sucessfully", user.Name); _lblSuccess.Text = string.Format("User {0} created sucessfully", user.Name);
} }
private void btnExit_Click(object sender, EventArgs e) private void btnExit_Click(object sender, EventArgs e)
@@ -92,7 +92,7 @@ namespace VAR.Focus.Web.Pages
_txtPassword1.NextFocusOnEnter = _txtPassword2; _txtPassword1.NextFocusOnEnter = _txtPassword2;
_txtPassword1.PlaceHolder = "Password"; _txtPassword1.PlaceHolder = "Password";
_pnlRegister.Controls.Add(FormUtils.CreateField(String.Empty, _txtPassword2)); _pnlRegister.Controls.Add(FormUtils.CreateField(string.Empty, _txtPassword2));
_txtPassword2.NextFocusOnEnter = _btnRegister; _txtPassword2.NextFocusOnEnter = _btnRegister;
_txtPassword2.PlaceHolder = "Password"; _txtPassword2.PlaceHolder = "Password";
@@ -105,7 +105,7 @@ namespace VAR.Focus.Web.Pages
Panel pnlButtons = new Panel(); Panel pnlButtons = new Panel();
pnlButtons.Controls.Add(_btnRegister); pnlButtons.Controls.Add(_btnRegister);
pnlButtons.Controls.Add(_btnExit); pnlButtons.Controls.Add(_btnExit);
_pnlRegister.Controls.Add(FormUtils.CreateField(String.Empty, pnlButtons)); _pnlRegister.Controls.Add(FormUtils.CreateField(string.Empty, pnlButtons));
Controls.Add(_pnlSuccess); Controls.Add(_pnlSuccess);
_pnlSuccess.Visible = false; _pnlSuccess.Visible = false;
@@ -114,7 +114,7 @@ namespace VAR.Focus.Web.Pages
_btnExitSuccess.Text = "Exit"; _btnExitSuccess.Text = "Exit";
_btnExitSuccess.Click += btnExit_Click; _btnExitSuccess.Click += btnExit_Click;
_pnlSuccess.Controls.Add(FormUtils.CreateField(String.Empty, _btnExitSuccess)); _pnlSuccess.Controls.Add(FormUtils.CreateField(string.Empty, _btnExitSuccess));
} }
#endregion Private methods #endregion Private methods

View File

@@ -80,7 +80,7 @@ namespace VAR.Focus.Web.Pages
private void PageCommon_PreRender(object sender, EventArgs e) private void PageCommon_PreRender(object sender, EventArgs e)
{ {
_head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : String.Format("{0}{1}{2}", Title, Globals.TitleSeparator, Globals.Title); _head.Title = string.IsNullOrEmpty(Title) ? Globals.Title : string.Format("{0}{1}{2}", Title, Globals.TitleSeparator, Globals.Title);
_btnLogout.Visible = (_currentUser != null); _btnLogout.Visible = (_currentUser != null);
} }
@@ -122,8 +122,8 @@ namespace VAR.Focus.Web.Pages
_head.Controls.Add(new HtmlMeta { Name = "viewport", Content = "width=device-width, initial-scale=1, maximum-scale=4, user-scalable=1" }); _head.Controls.Add(new HtmlMeta { Name = "viewport", Content = "width=device-width, initial-scale=1, maximum-scale=4, user-scalable=1" });
string version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); string version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
_head.Controls.Add(new LiteralControl(String.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version))); _head.Controls.Add(new LiteralControl(string.Format("<script type=\"text/javascript\" src=\"ScriptsBundler?v={0}\"></script>\n", version)));
_head.Controls.Add(new LiteralControl(String.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version))); _head.Controls.Add(new LiteralControl(string.Format("<link href=\"StylesBundler?v={0}\" type=\"text/css\" rel=\"stylesheet\"/>\n", version)));
_body = new HtmlGenericControl("body"); _body = new HtmlGenericControl("body");
html.Controls.Add(_body); html.Controls.Add(_body);
@@ -151,7 +151,7 @@ namespace VAR.Focus.Web.Pages
_btnLogout.ID = "btnLogout"; _btnLogout.ID = "btnLogout";
_btnLogout.Text = "Logout"; _btnLogout.Text = "Logout";
_btnLogout.Click += btnLogout_Click; _btnLogout.Click += btnLogout_Click;
_btnLogout.Attributes.Add("onclick", String.Format("return confirm('{0}');", "¿Are you sure to exit?")); _btnLogout.Attributes.Add("onclick", string.Format("return confirm('{0}');", "¿Are you sure to exit?"));
pnlUserInfo.Controls.Add(_btnLogout); pnlUserInfo.Controls.Add(_btnLogout);
_pnlContainer.CssClass = "divContent"; _pnlContainer.CssClass = "divContent";