From f52d80e643fc73e950538177bffd7bf408a159cc Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Sat, 27 May 2023 22:13:40 +0200 Subject: [PATCH] Fix typos. --- .../TestWebAppGlobalConfig.cs | 2 +- VAR.WebFormsCore.sln.DotSettings | 17 ++++++++++++++++- VAR.WebFormsCore/Code/ExtensionMethods.cs | 6 +++--- VAR.WebFormsCore/Code/GlobalConfig.cs | 6 ++---- VAR.WebFormsCore/Code/IGlobalConfig.cs | 2 +- VAR.WebFormsCore/Controls/CTextBox.cs | 12 ++++++------ VAR.WebFormsCore/Pages/PageCommon.cs | 2 +- VAR.WebFormsCore/Styles/01. base.css | 10 +++++----- 8 files changed, 35 insertions(+), 22 deletions(-) diff --git a/VAR.WebFormsCore.TestWebApp/TestWebAppGlobalConfig.cs b/VAR.WebFormsCore.TestWebApp/TestWebAppGlobalConfig.cs index ed84d96..ed1177a 100644 --- a/VAR.WebFormsCore.TestWebApp/TestWebAppGlobalConfig.cs +++ b/VAR.WebFormsCore.TestWebApp/TestWebAppGlobalConfig.cs @@ -19,7 +19,7 @@ public class TestWebAppGlobalConfig : IGlobalConfig return false; } - public void UserUnauthenticate(HttpContext context) + public void UserDeauthenticate(HttpContext context) { } } \ No newline at end of file diff --git a/VAR.WebFormsCore.sln.DotSettings b/VAR.WebFormsCore.sln.DotSettings index d18f71a..0b610a3 100644 --- a/VAR.WebFormsCore.sln.DotSettings +++ b/VAR.WebFormsCore.sln.DotSettings @@ -1,2 +1,17 @@  - ID \ No newline at end of file + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + DO_NOT_SHOW + ID + True + True + True + True + True + True + True + True + True + True + True \ No newline at end of file diff --git a/VAR.WebFormsCore/Code/ExtensionMethods.cs b/VAR.WebFormsCore/Code/ExtensionMethods.cs index 7e1e919..93d5cf0 100644 --- a/VAR.WebFormsCore/Code/ExtensionMethods.cs +++ b/VAR.WebFormsCore/Code/ExtensionMethods.cs @@ -9,19 +9,19 @@ namespace VAR.WebFormsCore.Code { #region HttpContext - public static string? GetRequestParm(this HttpContext context, string parm) + public static string GetRequestParameter(this HttpContext context, string parameter) { if (context.Request.Method == "POST") { foreach (string key in context.Request.Form.Keys) { - if (string.IsNullOrEmpty(key) == false && key == parm) { return context.Request.Form[key]; } + if (string.IsNullOrEmpty(key) == false && key == parameter) { return context.Request.Form[key][0] ?? string.Empty; } } } foreach (string key in context.Request.Query.Keys) { - if (string.IsNullOrEmpty(key) == false && key == parm) { return context.Request.Query[key]; } + if (string.IsNullOrEmpty(key) == false && key == parameter) { return context.Request.Query[key][0] ?? string.Empty; } } return string.Empty; diff --git a/VAR.WebFormsCore/Code/GlobalConfig.cs b/VAR.WebFormsCore/Code/GlobalConfig.cs index f2bb9f7..11c6e0b 100644 --- a/VAR.WebFormsCore/Code/GlobalConfig.cs +++ b/VAR.WebFormsCore/Code/GlobalConfig.cs @@ -19,9 +19,7 @@ namespace VAR.WebFormsCore.Code .SelectMany(x => x.GetTypes()) .FirstOrDefault( x => - x.IsAbstract == false && - x.IsInterface == false && - x.IsPublic && + x is { IsAbstract: false, IsInterface: false, IsPublic: true } && iGlobalConfig.IsAssignableFrom(x) ); if(foundGlobalConfig != null) @@ -48,7 +46,7 @@ namespace VAR.WebFormsCore.Code return false; } - public void UserUnauthenticate(HttpContext context) + public void UserDeauthenticate(HttpContext context) { } } diff --git a/VAR.WebFormsCore/Code/IGlobalConfig.cs b/VAR.WebFormsCore/Code/IGlobalConfig.cs index c93fe32..c15427a 100644 --- a/VAR.WebFormsCore/Code/IGlobalConfig.cs +++ b/VAR.WebFormsCore/Code/IGlobalConfig.cs @@ -14,6 +14,6 @@ namespace VAR.WebFormsCore.Code List AllowedExtensions { get; } bool IsUserAuthenticated(HttpContext context); - void UserUnauthenticate(HttpContext context); + void UserDeauthenticate(HttpContext context); } } \ No newline at end of file diff --git a/VAR.WebFormsCore/Controls/CTextBox.cs b/VAR.WebFormsCore/Controls/CTextBox.cs index f62bff6..516c491 100644 --- a/VAR.WebFormsCore/Controls/CTextBox.cs +++ b/VAR.WebFormsCore/Controls/CTextBox.cs @@ -13,7 +13,7 @@ namespace VAR.WebFormsCore.Controls private HiddenField? _hidSize; - private const string CssClassBase = "textbox"; + private const string CssClassBase = "textBox"; private string _cssClassExtra = ""; private bool _allowEmpty = true; @@ -85,7 +85,7 @@ namespace VAR.WebFormsCore.Controls public CTextBox() { Init += CTextBox_Init; - PreRender += CTextbox_PreRender; + PreRender += CTextBox_PreRender; } private void CTextBox_Init(object? sender, EventArgs e) @@ -100,7 +100,7 @@ namespace VAR.WebFormsCore.Controls Controls.Add(_hidSize); } - string strCfgName = $"{this.ClientID}_cfg"; + string strCfgName = $"{ClientID}_cfg"; Dictionary cfg = new() { {"txtContent", _txtContent.ClientID}, {"hidSize", _hidSize?.ClientID ?? string.Empty}, {"keepSize", _keepSize}, @@ -115,7 +115,7 @@ namespace VAR.WebFormsCore.Controls } } - private void CTextbox_PreRender(object? sender, EventArgs e) + private void CTextBox_PreRender(object? sender, EventArgs e) { _txtContent.CssClass = CssClassBase; if (string.IsNullOrEmpty(_cssClassExtra) == false) @@ -125,10 +125,10 @@ namespace VAR.WebFormsCore.Controls if (Page?.IsPostBack == true && (_allowEmpty == false && IsEmpty()) || _markedInvalid) { - _txtContent.CssClass += " textboxInvalid"; + _txtContent.CssClass += " textBoxInvalid"; } - _txtContent.Attributes.Add("onchange", "ElementRemoveClass(this, 'textboxInvalid');"); + _txtContent.Attributes.Add("onchange", "ElementRemoveClass(this, 'textBoxInvalid');"); if (string.IsNullOrEmpty(_placeHolder) == false) { diff --git a/VAR.WebFormsCore/Pages/PageCommon.cs b/VAR.WebFormsCore/Pages/PageCommon.cs index 5ffa2a6..75593f1 100644 --- a/VAR.WebFormsCore/Pages/PageCommon.cs +++ b/VAR.WebFormsCore/Pages/PageCommon.cs @@ -70,7 +70,7 @@ namespace VAR.WebFormsCore.Pages { if(Context != null) { - GlobalConfig.Get().UserUnauthenticate(Context); + GlobalConfig.Get().UserDeauthenticate(Context); } if (MustBeAuthenticated) { Context?.Response.Redirect(GlobalConfig.Get().LoginHandler); } } diff --git a/VAR.WebFormsCore/Styles/01. base.css b/VAR.WebFormsCore/Styles/01. base.css index 32b4a10..639ec83 100644 --- a/VAR.WebFormsCore/Styles/01. base.css +++ b/VAR.WebFormsCore/Styles/01. base.css @@ -115,7 +115,7 @@ h3 { font-size: 12px; } -.textbox { +.textBox { background: white; border: solid 1px rgba(0, 0, 0, 0.5); border-radius: 5px; @@ -126,23 +126,23 @@ h3 { box-shadow: inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(128, 128, 128, 1); } - .textbox:focus { + .textBox:focus { border: solid 1px black; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5); } -textarea.textbox { +textarea.textBox { height: 64px; resize: vertical; min-height: 21px; } -.textboxInvalid { +.textBoxInvalid { box-shadow: 0 0 10px rgba(255, 0, 0, 1), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5); border: solid 1px rgb(255, 0, 0); } - .textboxInvalid:focus { + .textBoxInvalid:focus { box-shadow: 0 0 10px rgba(255, 0, 0, 1), inset 0 -2px 5px rgba(255, 255, 255, 1), inset 0 2px 5px rgba(0, 0, 0, 0.5); border: solid 1px black; }