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;
|
using VAR.WebFormsCore.Code;
|
||||||
|
|
||||||
namespace VAR.WebFormsCore.TestWebApp;
|
namespace VAR.WebFormsCore.TestWebApp;
|
||||||
@@ -11,7 +9,7 @@ public class TestWebAppGlobalConfig: IGlobalConfig
|
|||||||
public string Author { get; } = "XXX";
|
public string Author { get; } = "XXX";
|
||||||
public string Copyright { get; } = "Copyright (c) 2022 by XXX, All Right Reserved";
|
public string Copyright { get; } = "Copyright (c) 2022 by XXX, All Right Reserved";
|
||||||
public string DefaultHandler { get; } = nameof(FrmDefault);
|
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 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)
|
public bool IsUserAuthenticated(HttpContext context)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
|
|
||||||
public int Index { get; set; }
|
public int Index { get; set; }
|
||||||
|
|
||||||
public virtual void Render(TextWriter textWriter)
|
protected virtual void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
foreach (Control control in Controls)
|
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));
|
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>();
|
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\" ");
|
textWriter.Write("<input type=\"hidden\" ");
|
||||||
RenderAttributes(textWriter, forceId: true);
|
RenderAttributes(textWriter, forceId: true);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
{
|
{
|
||||||
private string _method = "post";
|
private string _method = "post";
|
||||||
|
|
||||||
public override void Render(TextWriter textWriter)
|
protected override void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
textWriter.Write("<form ");
|
textWriter.Write("<form ");
|
||||||
RenderAttributes(textWriter);
|
RenderAttributes(textWriter);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
|
|
||||||
public HtmlGenericControl(string tag) { _tagName = tag; }
|
public HtmlGenericControl(string tag) { _tagName = tag; }
|
||||||
|
|
||||||
public override void Render(TextWriter textWriter)
|
protected override void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
textWriter.Write("<{0} ", _tagName);
|
textWriter.Write("<{0} ", _tagName);
|
||||||
RenderAttributes(textWriter);
|
RenderAttributes(textWriter);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
{
|
{
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
|
|
||||||
public override void Render(TextWriter textWriter)
|
protected override void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
textWriter.Write("<head ");
|
textWriter.Write("<head ");
|
||||||
RenderAttributes(textWriter);
|
RenderAttributes(textWriter);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
public string Content { get; init; }
|
public string Content { get; init; }
|
||||||
public string HttpEquiv { get; internal init; }
|
public string HttpEquiv { get; internal init; }
|
||||||
|
|
||||||
public override void Render(TextWriter textWriter)
|
protected override void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
textWriter.Write("<meta ");
|
textWriter.Write("<meta ");
|
||||||
RenderAttributes(textWriter);
|
RenderAttributes(textWriter);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
public string NavigateUrl { get; set; }
|
public string NavigateUrl { get; set; }
|
||||||
public string Text { get; init; }
|
public string Text { get; init; }
|
||||||
|
|
||||||
public override void Render(TextWriter textWriter)
|
protected override void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
textWriter.Write("<a ");
|
textWriter.Write("<a ");
|
||||||
RenderAttributes(textWriter);
|
RenderAttributes(textWriter);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
|
|
||||||
#region Life cycle
|
#region Life cycle
|
||||||
|
|
||||||
public override void Render(TextWriter textWriter)
|
protected override void Render(TextWriter textWriter)
|
||||||
{
|
{
|
||||||
textWriter.Write("<{0} ", _tagName);
|
textWriter.Write("<{0} ", _tagName);
|
||||||
RenderAttributes(textWriter);
|
RenderAttributes(textWriter);
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ namespace VAR.WebFormsCore.Controls
|
|||||||
{
|
{
|
||||||
public class LiteralControl : Control
|
public class LiteralControl : Control
|
||||||
{
|
{
|
||||||
private string Content { get; set; }
|
public string Content { get; set; }
|
||||||
|
|
||||||
public LiteralControl() { }
|
public LiteralControl() { }
|
||||||
public LiteralControl(string content) { Content = content; }
|
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)
|
if (TextMode == TextBoxMode.MultiLine)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user