Control: Change to protected some members
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using VAR.WebFormsCore.Code;
|
||||
|
||||
namespace VAR.WebFormsCore.TestWebApp;
|
||||
@@ -11,7 +9,7 @@ public class TestWebAppGlobalConfig: IGlobalConfig
|
||||
public string Author { get; } = "XXX";
|
||||
public string Copyright { get; } = "Copyright (c) 2022 by XXX, All Right Reserved";
|
||||
public string DefaultHandler { get; } = nameof(FrmDefault);
|
||||
public string LoginHandler { get; }
|
||||
public string LoginHandler { get; } = nameof(FrmDefault);
|
||||
public List<string> AllowedExtensions { get; } = new List<string> { ".png", ".jpg", ".jpeg", ".gif", ".ico", ".wav", ".mp3", ".ogg", ".mp4", ".webm", ".webp", ".mkv", ".avi" };
|
||||
public bool IsUserAuthenticated(HttpContext context)
|
||||
{
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
|
||||
public int Index { get; set; }
|
||||
|
||||
public virtual void Render(TextWriter textWriter)
|
||||
protected virtual void Render(TextWriter textWriter)
|
||||
{
|
||||
foreach (Control control in Controls)
|
||||
{
|
||||
@@ -147,7 +147,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public static void RenderAttribute(TextWriter textWriter, string key, string value)
|
||||
protected static void RenderAttribute(TextWriter textWriter, string key, string value)
|
||||
{
|
||||
textWriter.Write(" {0}=\"{1}\"", key, ServerHelpers.HtmlEncode(value));
|
||||
}
|
||||
@@ -179,7 +179,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public List<Control> ChildsOfType<T>(List<Control> controls = null)
|
||||
protected List<Control> ChildsOfType<T>(List<Control> controls = null)
|
||||
{
|
||||
controls ??= new List<Control>();
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<input type=\"hidden\" ");
|
||||
RenderAttributes(textWriter, forceId: true);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
{
|
||||
private string _method = "post";
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<form ");
|
||||
RenderAttributes(textWriter);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
|
||||
public HtmlGenericControl(string tag) { _tagName = tag; }
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<{0} ", _tagName);
|
||||
RenderAttributes(textWriter);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
{
|
||||
public string Title { get; set; }
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<head ");
|
||||
RenderAttributes(textWriter);
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
public string Content { get; init; }
|
||||
public string HttpEquiv { get; internal init; }
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<meta ");
|
||||
RenderAttributes(textWriter);
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
public string NavigateUrl { get; set; }
|
||||
public string Text { get; init; }
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<a ");
|
||||
RenderAttributes(textWriter);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
|
||||
#region Life cycle
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
textWriter.Write("<{0} ", _tagName);
|
||||
RenderAttributes(textWriter);
|
||||
|
||||
@@ -4,11 +4,11 @@ namespace VAR.WebFormsCore.Controls
|
||||
{
|
||||
public class LiteralControl : Control
|
||||
{
|
||||
private string Content { get; set; }
|
||||
public string Content { get; set; }
|
||||
|
||||
public LiteralControl() { }
|
||||
public LiteralControl(string content) { Content = content; }
|
||||
|
||||
public override void Render(TextWriter textWriter) { textWriter.Write(Content); }
|
||||
protected override void Render(TextWriter textWriter) { textWriter.Write(Content); }
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,7 @@ namespace VAR.WebFormsCore.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public override void Render(TextWriter textWriter)
|
||||
protected override void Render(TextWriter textWriter)
|
||||
{
|
||||
if (TextMode == TextBoxMode.MultiLine)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user