Skip to content

Commit

Permalink
2.0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jurioli committed May 21, 2022
1 parent 2e315ef commit becd6fa
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 7 deletions.
Binary file removed Blazor.WebForm.Components.2.0.1.3.nupkg
Binary file not shown.
Binary file added Blazor.WebForm.Components.2.0.1.4.nupkg
Binary file not shown.
6 changes: 3 additions & 3 deletions Blazor.WebForm.Components/Blazor.WebForm.Components.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>Blazor.WebForm.Components.pfx</AssemblyOriginatorKeyFile>
<Version>2.0.1.3</Version>
<Version>2.0.1.4</Version>
<RootNamespace>asp</RootNamespace>
<Copyright>Jurio li</Copyright>
<AssemblyName>Blazor.WebForm.Components</AssemblyName>
Expand All @@ -17,8 +17,8 @@

<ItemGroup>
<PackageReference Include="Applied" Version="1.2.1.6" />
<PackageReference Include="Blazor.WebForm.UI" Version="2.0.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.4" />
<PackageReference Include="Blazor.WebForm.UI" Version="2.0.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.5" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 1 addition & 4 deletions Blazor.WebForm.Components/PluralHolder.razor
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@
{
foreach (Extensions.Web.UI.WebControls.PluralHolder.PluralItem item in this.Control.Items)
{
if (item.DataItem == null || item.DataItem == item.DataItem)
{
item.DataItem = this.DataItem;
}
item.DataItem = this.DataItem;
}
}
}
Expand Down
115 changes: 115 additions & 0 deletions Blazor.WebForm.Components/RichTextBox.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
@using Blazor.WebForm.UI
@using Blazor.WebForm.UI.ControlComponents
@using System.Web.UI
@using System.Web.UI.WebControls
@inherits WebControlComponent<System.Web.UI.WebControls.RichTextBox>
@this.RenderWithInner(this.Control)
@code {
[Parameter]
public RenderFragment ChildContent { get; set; }

[Parameter]
public string ValidationGroup
{
get
{
return this.Control.ValidationGroup;
}
set
{
this.Control.ValidationGroup = value;
}
}

[Parameter]
public bool CausesValidation
{
get
{
return this.Control.CausesValidation;
}
set
{
this.Control.CausesValidation = value;
}
}

[Parameter]
public bool AutoPostBack
{
get
{
return this.Control.AutoPostBack;
}
set
{
this.Control.AutoPostBack = value;
}
}

[Parameter]
public string InnerHtml
{
get
{
return this.Control.InnerHtml;
}
set
{
this.Control.InnerHtml = value;
}
}

[Parameter]
public HtmlTextWriterTag TextBoxTag
{
get
{
return this.Control.TextBoxTag;
}
set
{
this.Control.TextBoxTag = value;
}
}

[Parameter]
public EventHandler OnTextChanged
{
get
{
return this.GetEventProperty();
}
set
{
this.SetEventProperty(value, i => this.Control.TextChanged += i, i => this.Control.TextChanged -= i);
}
}

protected override void OnInitialized()
{
base.OnInitialized();
if (this.HasPropertyBindEvent<string>(nameof(this.InnerHtml)))
{
this.Control.AutoPostBack = true;
this.Control.TextChanged += this.BindInnerHtmlChanged;
if (this.HasEventProperty(nameof(this.OnTextChanged)))
{
this.SetBindEventProperty(nameof(this.OnTextChanged), this.BindInnerHtmlChanged);
}
}
}

private void BindInnerHtmlChanged(object sender, EventArgs e)
{
this.InvokePropertyBindEvent(nameof(this.InnerHtml), this.InnerHtml);
}

protected override void SetInnerPropertyWithInner(IReadOnlyDictionary<string, object> parameters)
{
if (parameters.ContainsKey(nameof(this.ChildContent)) && this.ChildContent != null)
{
this.InnerHtml = RenderUtility.GetContentString(this.ChildContent);
}
}
}

0 comments on commit becd6fa

Please sign in to comment.