BEditor
Editor HTML B-Arts con toolbar, cronologia, visualizzazione sorgente, modalità a schermo intero, immagini, collegamenti, tabelle, stili e campi applicativi.
Contenuto e binding
Text/TextChanged: contenuto HTML con binding.GetHtmlAsync(): HTML corrente.GetOnlyTextAsync(): solo testo.SetTextAsync(html): sostituisce il contenuto.ReadOnly/ReadOnlyChangedeSetReadOnly(...).
Configurazione
I gruppi della toolbar si controllano tramite le proprietà ShowGroup*. ShowToggleSourceView e ShowToggleFullScreen abilitano le modalità avanzate. MaxHistorySizeMB limita la cronologia.
BFonts, BInterlines e BStyles ricevono rispettivamente BEditorFont, BEditorInterline e BEditorStyle. Fields contiene BItem inseribili nel testo e GetValueField ne risolve il valore.
Per immagini usare Images (BDictionary<string, byte[]>) e OnLoadImage; il callback può fornire URL o contenuto mediante BEditorImageEventArgs.
Esempio
<BEditor @ref="editor"
Width="100%"
Height="500px"
ShowToggleSourceView="true"
ShowToggleFullScreen="true"
@bind-Text="modello.Html">
<BFonts>
<BEditorFont Nome="Arial" FontFamily="Arial, sans-serif" />
</BFonts>
<BInterlines>
<BEditorInterline Nome="Normale" Valore="1.0" />
</BInterlines>
</BEditor>
Non manipolare direttamente il DOM dell'editor dal codice applicativo: usare i metodi pubblici e lasciare l'interop agli asset del framework.
Altri casi: BEditor.Examples.md.
<!-- BEGIN GENERATED API -->
Riferimento API completo
Identità
Namespace:
B.BWeb.BControlsAssembly:
BFrameworkWebControlsTipo:
classClasse base:
BBaseJSControlInterfacce:
IAsyncDisposable,IComponent,IHandleAfterRender,IHandleEventSorgente API: versione
5.0.1
Dichiarazione
public class BEditor : BBaseJSControl, IComponent, IHandleEvent, IHandleAfterRender, IAsyncDisposable
Costruttori
BEditor()
Campi pubblici
Nessun campo pubblico dichiarato.
Proprietà
| Proprietà | Tipo | Accesso |
|---|---|---|
BFonts |
RenderFragment |
get/set |
BInterlines |
RenderFragment |
get/set |
BStyles |
RenderFragment |
get/set |
ClientIdDlgImage |
string |
get |
ClientIdDlgLink |
string |
get |
ClientIdDlgTable |
string |
get |
ClientIdDlgTableOption |
string |
get |
Connection |
BConnection |
get/set |
CssClassBody |
string |
get/set |
CssClassButton |
string |
get/set |
CssClassButtonPrimary |
string |
get/set |
CssClassColorBox |
string |
get/set |
CssClassColorInput |
string |
get/set |
CssClassColorLabel |
string |
get/set |
CssClassContainer |
string |
get/set |
CssClassContent |
string |
get/set |
CssClassFieldDescription |
string |
get/set |
CssClassFieldInsert |
string |
get/set |
CssClassFieldItem |
string |
get/set |
CssClassFieldPreview |
string |
get/set |
CssClassFieldsEmpty |
string |
get/set |
CssClassFieldsHeader |
string |
get/set |
CssClassFieldsPanel |
string |
get/set |
CssClassGroup |
string |
get/set |
CssClassHidden |
string |
get/set |
CssClassSelect |
string |
get/set |
CssClassSelectNarrow |
string |
get/set |
CssClassSeparator |
string |
get/set |
CssClassSource |
string |
get/set |
CssClassStatusBar |
string |
get/set |
CssClassStatusItem |
string |
get/set |
CssClassStatusLeft |
string |
get/set |
CssClassStatusRight |
string |
get/set |
CssClassSurface |
string |
get/set |
CssClassTableOption |
string |
get/set |
CssClassTableResizeLayer |
string |
get/set |
CssClassToolbar |
string |
get/set |
CssClassToolbarRow |
string |
get/set |
DialogImageWidth |
string |
get/set |
DialogLinkWidth |
string |
get/set |
DialogTableOptionWidth |
string |
get/set |
DialogTableWidth |
string |
get/set |
Fields |
List<BItem> |
get/set |
FieldsPanelWidth |
string |
get/set |
FontSize |
List<int> |
get/set |
GetValueField |
Func<string, Task<string>> |
get/set |
Height |
string |
get/set |
Images |
BDictionary<string, byte[]> |
get/set |
Log |
BLogText |
get |
MaxHistorySizeMB |
int |
get/set |
OnLoadImage |
EventCallback<BEditorImageEventArgs> |
get/set |
ReadOnly |
bool |
get/set |
ReadOnlyChanged |
EventCallback<bool> |
get/set |
ShowFieldsPanel |
bool |
get/set |
ShowGroupClipboard |
bool |
get/set |
ShowGroupEditing |
bool |
get/set |
ShowGroupFields |
bool |
get/set |
ShowGroupFont |
bool |
get/set |
ShowGroupInsert |
bool |
get/set |
ShowGroupLists |
bool |
get/set |
ShowGroupParagraph |
bool |
get/set |
ShowGroupStyles |
bool |
get/set |
ShowGroupView |
bool |
get/set |
ShowToggleFullScreen |
bool |
get/set |
ShowToggleSourceView |
bool |
get/set |
Text |
string |
get/set |
TextAlignCenter |
string |
get/set |
TextAlignLeft |
string |
get/set |
TextAlignRight |
string |
get/set |
TextBold |
string |
get/set |
TextBulletedList |
string |
get/set |
TextChanged |
EventCallback<string> |
get/set |
TextClearFormatting |
string |
get/set |
TextColorLabel |
string |
get/set |
TextCopy |
string |
get/set |
TextCopyStyle |
string |
get/set |
TextCut |
string |
get/set |
TextFieldsHeader |
string |
get/set |
TextFind |
string |
get/set |
TextFullscreen |
string |
get/set |
TextHighlightLabel |
string |
get/set |
TextIndentDecrease |
string |
get/set |
TextIndentIncrease |
string |
get/set |
TextInsertField |
string |
get/set |
TextInsertFieldItem |
string |
get/set |
TextInsertHr |
string |
get/set |
TextInsertImage |
string |
get/set |
TextInsertLink |
string |
get/set |
TextInsertTable |
string |
get/set |
TextItalic |
string |
get/set |
TextJustify |
string |
get/set |
TextMultilevelList |
string |
get/set |
TextNoFields |
string |
get/set |
TextNumberedList |
string |
get/set |
TextPaste |
string |
get/set |
TextPastePlain |
string |
get/set |
TextPasteStyle |
string |
get/set |
TextRedo |
string |
get/set |
TextRemoveLink |
string |
get/set |
TextReplace |
string |
get/set |
TextRestartNumbering |
string |
get/set |
TextSelectAll |
string |
get/set |
TextShowInvisibles |
string |
get/set |
TextSpecialChars |
string |
get/set |
TextStatusChars |
string |
get/set |
TextStatusMode |
string |
get/set |
TextStatusSelection |
string |
get/set |
TextStatusWords |
string |
get/set |
TextStrike |
string |
get/set |
TextSubscript |
string |
get/set |
TextSuperscript |
string |
get/set |
TextToggleFieldPreview |
string |
get/set |
TextToggleSource |
string |
get/set |
TextUnderline |
string |
get/set |
TextUndo |
string |
get/set |
Width |
string |
get/set |
Callback Blazor
OnLoadImage:EventCallback<BEditorImageEventArgs>ReadOnlyChanged:EventCallback<bool>TextChanged:EventCallback<string>
Eventi CLR
Nessun evento CLR pubblico dichiarato.
Metodi
void AddFont(BEditorFont font)void AddInterline(BEditorInterline interline)void AddStyle(BEditorStyle style)Task BEditorTextChanged()void DeleteImage(string KeyImage)void DlgImageShow(string KeyImage, string RenderMode, string RendedrPosition, int Width, int Height)void DlgLinkShow(string Testo, string Url)void DlgTableOptionShow(string Target, string style)void DlgTableShow()Task<Dictionary<string, string>> GetFieldValues(string[] FieldKeys)Task<string> GetHtmlAsync()Task<string> GetOnlyTextAsync()Task<string> GetTextAsync()Task<object> ImportImage(string Base64)Task<object> ReceiveImageChunk(string base64Chunk, bool isLastChunk)Task SetDisabled(bool disabled)Task SetReadOnly(bool readOnly)Task SetTextAsync(string NewText)Task SyncToolbarColors(string TextColor, string HighlightColor)Task SyncToolbarCombos(string FontSizeValue, string LineSpacingValue)
Tipi annidati pubblici
BEditorCommand
Bold=0Italic=1Underline=2Strikethrough=3Superscript=4Subscript=5FontFamily=6FontSize=7TextColor=8HighlightColor=9AlignLeft=10AlignCenter=11AlignRight=12AlignJustify=13IncreaseIndent=14DecreaseIndent=15LineSpacing=16Style=17BulletedList=18NumberedList=19Cut=20Copy=21Paste=22PastePlainText=23CopyStyle=24PasteStyle=25ClearFormatting=26InsertLink=27RemoveLink=28InsertImage=29InsertHorizontalRule=30InsertTable=31Undo=32Redo=33ToggleSourceView=34Fullscreen=35ShowInvisibles=36InsertField=37ToggleFieldPreview=38
Membri B-Arts ereditati
Proprietà da
BBaseControl:string ClientId { get; }Proprietà da
BBaseControl:string CssClass { get; set; }Proprietà da
BBaseControl:bool Disabled { get; set; }Proprietà da
BBaseControl:EventCallback<bool> DisabledChanged { get; set; }Proprietà da
BBaseControl:string Id { get; set; }Proprietà da
BBaseControl:string Style { get; set; }Proprietà da
BBaseControl:int TabIndex { get; set; }Proprietà da
BBaseControl:bool Visible { get; set; }Proprietà da
BBaseControl:EventCallback<bool> VisibleChanged { get; set; }Metodo da
BBaseControl:Task SetVisible(bool visible)Metodo da
BBaseJSControl:void BJSControlIsInitialized()Metodo da
BBaseJSControl:ValueTask DisposeAsync()
