Exemplo n.º 1
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            BuildBulma();

            builder.OpenElement(0, "progress");
            builder.AddMultipleAttributes(1, CombinedAdditionalAttributes);
            builder.AddAttribute(2, "max", "100");

            if (Indeterminate == false)
            {
                Value = Math.Clamp(Value, 0, 100);

                builder.AddAttribute(3, "value", Value);
            }

            builder.CloseElement();
        }
Exemplo n.º 2
0
    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        var asset = Value;

        builder.OpenElement("span");
        builder.AddAttribute("hg-asset-display");
        builder.AddMultipleAttributes(AdditionalAttributes);
        if (asset is not null && asset.ShardNum > 0 || asset !.RealmNum > 0 || asset.AccountNum > 0)
        {
            builder.AddContent(asset.ShardNum);
            builder.AddContent(".");
            builder.AddContent(asset.RealmNum);
            builder.AddContent(".");
            builder.AddContent(asset.AccountNum);
            builder.AddContent(".");
            builder.AddContent(asset.SerialNum);
        }
Exemplo n.º 3
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     if (Type != null)
     {
         builder.OpenComponent(1, Type);
         if (AddAttributes)
         {
             builder.AddAttribute(2, "Class", _Class);
             builder.AddAttribute(3, "Style", _Style);
             if (Attributes?.Count > 0)
             {
                 builder.AddMultipleAttributes(4, Attributes);
             }
         }
         builder.CloseComponent();
     }
 }
Exemplo n.º 4
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement(0, Tag);
     if (Attributes != null)
     {
         builder.AddMultipleAttributes(2, Attributes);
     }
     builder.AddElementReferenceCapture(1, reference =>
     {
         Ref = reference;
     });
     if (ChildContent != null)
     {
         builder.AddContent(3, ChildContent);
     }
     builder.CloseElement();
 }
Exemplo n.º 5
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     if (builder != null)
     {
         builder.OpenElement(0, "span");
         builder.AddMultipleAttributes(1, AdditionalAttributes);
         if (TxId == null)
         {
             builder.AddContent(2, "None");
         }
         else
         {
             builder.AddContent(2, $"{TxId.Address.ShardNum}.{TxId.Address.RealmNum}.{TxId.Address.AccountNum}@{TxId.ValidStartSeconds}.{TxId.ValidStartNanos}");
         }
         builder.CloseElement();
     }
 }
Exemplo n.º 6
0
 /// <inheritdoc />
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement(0, "input");
     builder.AddAttribute(1, "step", _stepAttributeValue);
     builder.AddMultipleAttributes(2, AdditionalAttributes);
     builder.AddAttribute(2, "id", Id);
     builder.AddAttribute(3, "required", Required);
     builder.AddAttribute(4, "disabled", !Enabled);
     builder.AddAttribute(5, "type", "number");
     builder.AddAttribute(6, "class", $"{CssClass} pf-c-form-control {(IsValid == true && !HasValidationMessages ? CssClassConstants.Success : String.Empty)} {AdditionalCssClass}");
     builder.AddAttribute(7, "value", BindConverter.FormatValue(CurrentValueAsString));
     builder.AddAttribute(8, "onchange", EventCallback.Factory.CreateBinder <string>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
     builder.AddAttribute(9, "aria-invalid", HasValidationMessages.ToString().ToLower());
     builder.AddAttribute(10, "aria-describedby", $"{Id}-helper");
     builder.AddAttribute(11, "onblur", EventCallback.Factory.Create <FocusEventArgs>(this, OnBlur));
     builder.CloseElement();
 }
Exemplo n.º 7
0
        /// <inheritdoc />
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            if (Visible)
            {
                if (Data != null)
                {
                    builder.OpenRegion(Data.GetHashCode());
                }

                builder.OpenElement(0, "form");
                builder.AddAttribute(1, "style", Style);

                if (Action != null)
                {
                    builder.AddAttribute(2, "method", Method);
                    builder.AddAttribute(3, "action", Action);
                }

                builder.AddAttribute(4, "onsubmit", handleSubmitDelegate);
                builder.AddMultipleAttributes(5, Attributes);
                builder.AddAttribute(6, "class", GetCssClass());
                builder.AddElementReferenceCapture(7, form => Element = form);

                builder.OpenComponent <CascadingValue <IRadzenForm> >(8);
                builder.AddAttribute(9, "IsFixed", true);
                builder.AddAttribute(10, "Value", this);
                builder.AddAttribute(11, "ChildContent", new RenderFragment(contentBuilder =>
                {
                    contentBuilder.OpenComponent <CascadingValue <EditContext> >(0);
                    contentBuilder.AddAttribute(1, "IsFixed", true);
                    contentBuilder.AddAttribute(2, "Value", EditContext);
                    contentBuilder.AddAttribute(3, "ChildContent", ChildContent?.Invoke(EditContext));
                    contentBuilder.CloseComponent();
                }));

                builder.CloseComponent(); // CascadingValue<IRadzenForm>


                builder.CloseElement(); // form

                if (Data != null)
                {
                    builder.CloseRegion();
                }
            }
        }
Exemplo n.º 8
0
        protected override sealed void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(1, "img");

            if (IconReady())
            {
                builder.AddAttribute(2, "src", GenerateSourceUri());
            }

            builder.AddAttribute(3, "alt", GetAltText());
            builder.AddAttribute(4, "class", Class);
            builder.AddAttribute(5, "style", Style);
            builder.AddAttribute(6, "width", Width);
            builder.AddAttribute(7, "height", Height);
            builder.AddMultipleAttributes(8, UserAttributes);
            builder.CloseElement();
        }
Exemplo n.º 9
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(0, "div");
            builder.AddAttribute(1, "class", "control");

            #region Input
            builder.OpenElement(2, "input");
            builder.AddMultipleAttributes(3, AdditionalAttributes);
            builder.AddAttribute(4, "class", CssClass);
            builder.AddAttribute(5, "type", "date");
            builder.AddAttribute(6, "value", CurrentValueAsString);
            builder.AddAttribute(7, "onchange", EventCallback.Factory.CreateBinder(this, (value) => CurrentValueAsString = value, CurrentValueAsString));
            builder.CloseElement();
            #endregion

            builder.CloseElement();
        }
Exemplo n.º 10
0
 /// <summary>
 /// コンポーネントのレンダリングを行います。
 /// </summary>
 /// <param name="builder">ビルダ。</param>
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement(0, "input");
     builder.AddMultipleAttributes(1, this.AdditionalAttributes);
     builder.AddAttribute(2, "type", "text");
     builder.AddAttribute(3, "value", BindConverter.FormatValue(this.FilterText));
     builder.AddAttribute(4, "onchange", EventCallback.Factory.CreateBinder <string>(
                              this,
                              __value =>
     {
         this.FilterText = __value;
         this.Filter.FilterOn();
     },
                              this.FilterText
                              ));
     builder.CloseElement();
 }
Exemplo n.º 11
0
        /// <inheritdoc/>
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            base.BuildRenderTree(builder);
            builder?.OpenElement(0, TagName);

            builder.AddMultipleAttributes(1, Attributes);
            builder.AddEventPreventDefaultAttribute(2, "onclick", ClickPreventDefault);
            builder.AddEventStopPropagationAttribute(3, "onclick", ClickStopPropagation);
            builder.AddContent(4, ChildContent);
            builder.AddElementReferenceCapture(2, capturedRef =>
            {
                ElementRef = capturedRef;
                ElementRefChanged?.Invoke(ElementRef);   // Invoke the callback for the binding to work.
            });

            builder.CloseElement();
        }
Exemplo n.º 12
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     if (builder != null)
     {
         builder.OpenElement(0, "span");
         builder.AddMultipleAttributes(1, AdditionalAttributes);
         if (Hash.IsEmpty)
         {
             builder.AddContent(2, "Empty");
         }
         else
         {
             builder.AddContent(2, Hex.FromBytes(Hash));
         }
         builder.CloseElement();
     }
 }
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     base.BuildRenderTree(builder);
     builder.OpenElement(0, _Component);
     builder.AddAttribute(1, "class", _Class);
     builder.AddAttribute(2, "style", _Style);
     if (OnClick.HasDelegate)
     {
         builder.AddAttribute(3, "onclick", EventCallback.Factory.Create(this, HandleClick));
     }
     if (OnMouseLeave.HasDelegate)
     {
         builder.AddAttribute(4, "onmouseleave", EventCallback.Factory.Create(this, HandleMouseLeaveAsync));
     }
     if (OnMouseEnter.HasDelegate)
     {
         builder.AddAttribute(5, "onmouseenter", EventCallback.Factory.Create(this, HandleMouseEnterAsync));
     }
     if (OnFocus.HasDelegate)
     {
         builder.AddAttribute(6, "onfocus", EventCallback.Factory.Create <FocusEventArgs>(this, HandleFocusAsync));
     }
     if (OnBlur.HasDelegate)
     {
         builder.AddAttribute(7, "onblur", EventCallback.Factory.Create <FocusEventArgs>(this, HandleBlurAsync));
     }
     if (!string.IsNullOrWhiteSpace(Id))
     {
         builder.AddAttribute(8, "id", Id);
     }
     if (OnClickStop.HasValue)
     {
         builder.AddEventStopPropagationAttribute(9, "onclick", OnClickStop.Value);
     }
     if (OnClickPrevent.HasValue)
     {
         builder.AddEventPreventDefaultAttribute(10, "onclick", OnClickPrevent.Value);
     }
     builder.AddMultipleAttributes(11, Attributes);
     builder.AddContent(12, ChildContent);
     builder.AddElementReferenceCapture(13, (__value) => {
         RootRef.Current = (ElementReference)__value;
     });
     builder.CloseElement();
 }
Exemplo n.º 14
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            BuildBulma();

            builder.OpenElement(0, "input");
            builder.AddMultipleAttributes(1, AdditionalAttributes);
            builder.AddAttribute(2, "type", "range");
            builder.AddAttribute(3, "class", InputClassBuilder.ClassString);
            builder.AddAttribute(4, "min", Min);
            builder.AddAttribute(5, "max", Max);
            builder.AddAttribute(6, "step", Step);
            builder.AddAttribute(7, "value", Value);
            builder.AddAttribute(8, "oninput", EventCallback.Factory.CreateBinder <string>(
                                     this,
                                     __value => CurrentValueAsString = __value, CurrentValueAsString
                                     ));
            builder.CloseElement();
        }
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            var sequenceGenerator = new SequenceGenerator();

            builder.OpenElement(sequenceGenerator.GetNextValue(), TagName);
            builder.AddAttribute(sequenceGenerator.GetNextValue(), "class", CssClasses);
            if (TagName == HtmlTagNames.BUTTON || TagName == HtmlTagNames.INPUT)
            {
                builder.AddAttribute(sequenceGenerator.GetNextValue(), "type", Type.GetCssClassPart());
            }
            else
            {
                builder.AddAttribute(sequenceGenerator.GetNextValue(), "role", "button");
            }
            builder.AddMultipleAttributes(sequenceGenerator.GetNextValue(), AdditionalAttributes?.Where(pair => pair.Key != "class"));
            builder.AddContent(sequenceGenerator.GetNextValue(), ChildContent);
            builder.CloseElement();
        }
Exemplo n.º 16
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            base.BuildRenderTree(builder);

            builder.OpenElement(0, "svg");
            builder.AddAttribute(1, "viewBox", "0 0 50 50");
            builder.AddMultipleAttributes(2, AttributeSet !);
            builder.OpenElement(3, "circle");
            builder.AddAttribute(4, "class", "spinner-path");
            builder.AddAttribute(5, "style", GetSpinnerCircleStyle());
            builder.AddAttribute(6, "cx", "25");
            builder.AddAttribute(7, "cy", "25");
            builder.AddAttribute(8, "r", "20");
            builder.AddAttribute(9, "fill", "none");
            builder.AddAttribute(10, "stroke-width", "5");
            builder.CloseElement();
            builder.CloseElement();
        }
Exemplo n.º 17
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(0, "a");

            builder.AddMultipleAttributes(1, AdditionalAttributes);
            builder.AddAttribute(2, "class", CssClass);

            if (this.OnClick.HasDelegate)
            {
                builder.AddAttribute(3, "onclick", this.OnClick);
                builder.AddEventPreventDefaultAttribute(4, "onclick", true);
                builder.AddEventStopPropagationAttribute(5, "onclick", true);
            }

            builder.AddContent(6, ChildContent);

            builder.CloseElement();
        }
Exemplo n.º 18
0
    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        // If _fixedEditContext changes, tear down and recreate all descendants.
        // This is so we can safely use the IsFixed optimization on CascadingValue,
        // optimizing for the common case where _fixedEditContext never changes.
        builder.OpenRegion(EditContext !.GetHashCode());

        builder.OpenElement(0, "span");
        builder.AddMultipleAttributes(1, AdditionalAttributes);
        builder.OpenComponent <CascadingValue <EditContext> >(3);
        builder.AddAttribute(4, "IsFixed", true);
        builder.AddAttribute(5, "Value", EditContext);
        builder.AddAttribute(6, "ChildContent", ChildContent?.Invoke(EditContext));
        builder.CloseComponent();
        builder.CloseElement();

        builder.CloseRegion();
    }
Exemplo n.º 19
0
        /// <summary>
        /// コンポーネントのレンダリングを行います。
        /// </summary>
        /// <param name="builder">ビルダ。</param>
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            if (this.IsVisible == true)
            {
                builder.OpenElement(0, "div");
                builder.AddMultipleAttributes(1, this.AdditionalAttributes);
                builder.AddAttribute(2, "class", $"layer-component layer-content {this.ClassName}");

                builder.OpenRegion(1000);
                this.BuildRenderTreeHideAction(builder);
                builder.CloseRegion();

                builder.OpenElement(3, "div");
                builder.AddContent(4, ChildContent);
                builder.CloseElement();
                builder.CloseElement();
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// BuildRenderTree 方法
 /// </summary>
 /// <param name="builder"></param>
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement(0, TagName);
     if (AdditionalAttributes != null)
     {
         builder.AddMultipleAttributes(1, AdditionalAttributes);
     }
     if (TriggerClick && OnClick != null)
     {
         builder.AddAttribute(2, "onclick", EventCallback.Factory.Create <MouseEventArgs>(this, e => OnClick()));
     }
     if (TriggerDoubleClick && OnDoubleClick != null)
     {
         builder.AddAttribute(3, "ondblclick", EventCallback.Factory.Create <MouseEventArgs>(this, e => OnDoubleClick()));
     }
     builder.AddContent(4, ChildContent);
     builder.CloseElement();
 }
Exemplo n.º 21
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            BuildBulma();

            if (HeaderSize.HasValue)
            {
                builder.OpenElement(0, $"h{HeaderSize}");
            }
            else
            {
                builder.OpenElement(0, "p");
            }

            builder.AddMultipleAttributes(1, CombinedAdditionalAttributes);
            builder.AddContent(2, ChildContent);

            builder.CloseElement();
        }
Exemplo n.º 22
0
        /// <summary>
        /// コンポーネントのレンダリングを行います。
        /// </summary>
        /// <param name="builder">ビルダ。</param>
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            if (this.Item.EditMode == EditModeOptions.Edit)
            {
                if (this.EditableState == EditStateOptions.None ||
                    (this.Item.EditState & this.EditableState) > 0)
                {
                    builder.OpenElement(0, "select");
                    builder.AddMultipleAttributes(1, AdditionalAttributes);
                    builder.AddAttribute(2, "value", BindConverter.FormatValue(this.CurrentValueAsString));
                    builder.AddAttribute(3, "onchange", EventCallback.Factory.CreateBinder <string>(
                                             this,
                                             __value =>
                    {
                        this.CurrentValueAsString = __value;
                        this.SelectedCallBack?.Invoke(this.GetSelectedDropItem());
                    },
                                             this.CurrentValueAsString
                                             ));

                    if (this.DropItems != null)
                    {
                        var seq = 4;
                        foreach (var dropItem in this.DropItems)
                        {
                            builder.OpenElement(seq++, "option");
                            builder.AddAttribute(seq++, "value", dropItem.Key);
                            builder.AddContent(seq++, dropItem.Value);
                            builder.CloseElement();
                        }
                    }
                    builder.CloseElement();
                }
                else
                {
                    builder.AddContent(100, this.DisplayValue);
                }
            }
            else
            {
                builder.AddContent(200, this.DisplayValue);
            }
            base.BuildRenderTree(builder);
        }
Exemplo n.º 23
0
        /// <summary>
        /// Renders the component to the supplied RenderTreeBuilder.
        /// </summary>
        /// <param name="builder">A RenderTreeBuilder that will receive the render output.</param>
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(0, "input");
            builder.AddMultipleAttributes(1, AdditionalAttributes);
            builder.AddAttribute(2, "type", "text");
            builder.AddAttribute(3, "class", CssClass);
            builder.AddAttribute(4, "value", BindConverter.FormatValue(CurrentValueAsString));
            builder.AddAttribute(5, "onchange", EventCallback.Factory.CreateBinder <String>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
            if (this.BrowserInputMode == BrowserInputMode.Decimal)
            {
                builder.AddAttribute(6, "inputmode", "decimal");
            }
            else if (this.BrowserInputMode == BrowserInputMode.Numeric)
            {
                builder.AddAttribute(6, "inputmode", "numeric");
            }

            builder.CloseElement();
        }
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            /*
             *  <div @attributes="Attributes"
             *       onclick="@(MouseButtonTrigger == MouseButtonTrigger.Left || MouseButtonTrigger == MouseButtonTrigger.Both ? $"blazorContextMenu.OnContextMenu(event, '{MenuId.Replace("'","\\'")}'); " : "")"
             *       ondblclick="@(MouseButtonTrigger == MouseButtonTrigger.DoubleClick ? $"blazorContextMenu.OnContextMenu(event, '{MenuId.Replace("'","\\'")}'); " : "")"
             *       oncontextmenu="@(MouseButtonTrigger == MouseButtonTrigger.Right || MouseButtonTrigger == MouseButtonTrigger.Both ? $"blazorContextMenu.OnContextMenu(event, '{MenuId.Replace("'","\\'")}');": "")"
             *       class="@CssClass">
             *      @ChildContent
             *  </div>
             */

            builder.OpenElement(0, WrapperTag);

            builder.AddMultipleAttributes(1, Microsoft.AspNetCore.Components.CompilerServices.RuntimeHelpers.TypeCheck <global::System.Collections.Generic.IEnumerable <global::System.Collections.Generic.KeyValuePair <string, object> > >(Attributes));

            if (MouseButtonTrigger == MouseButtonTrigger.Left || MouseButtonTrigger == MouseButtonTrigger.Both)
            {
                builder.AddAttribute(2, "onclick", $"blazorContextMenu.OnContextMenu(event, '{MenuId.Replace("'", "\\'")}', {StopPropagation.ToString().ToLower()});");
            }

            if (MouseButtonTrigger == MouseButtonTrigger.Right || MouseButtonTrigger == MouseButtonTrigger.Both)
            {
                builder.AddAttribute(3, "oncontextmenu", $"blazorContextMenu.OnContextMenu(event, '{MenuId.Replace("'", "\\'")}', {StopPropagation.ToString().ToLower()});");
            }

            if (MouseButtonTrigger == MouseButtonTrigger.DoubleClick)
            {
                builder.AddAttribute(4, "ondblclick", $"blazorContextMenu.OnContextMenu(event, '{MenuId.Replace("'", "\\'")}', {StopPropagation.ToString().ToLower()});");
            }

            if (!string.IsNullOrWhiteSpace(CssClass))
            {
                builder.AddAttribute(5, "class", CssClass);
            }
            builder.AddAttribute(6, "id", Id);
            builder.AddContent(7, ChildContent);
            builder.AddElementReferenceCapture(8, (__value) =>
            {
                contextMenuTriggerElementRef = __value;
            });
            builder.CloseElement();
        }
Exemplo n.º 25
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            if (PagerState.PageCount == 0)
            {
                return;
            }

            builder.OpenElement(0, "div");
            builder.AddAttribute(1, "class", PagerContainerClass);
            builder.AddMultipleAttributes(2, Attributes);

            builder.OpenElement(3, "div");
            builder.AddAttribute(4, "class", "dataTables_paginate paging_simple_numbers");

            RenderPagination(builder);

            builder.CloseElement(); // div
            builder.CloseElement(); // div
        }
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            builder.OpenElement(0, "ul");
            builder.AddMultipleAttributes(1, AdditionalAttributes);
            builder.AddAttribute(2, "class", CssClass);
            builder.AddAttribute(3, "class", "list-group");
            //builder.AddAttribute(4, "value", BindConverter.FormatValue(CurrentValueAsString));
            var converter = TypeDescriptor.GetConverter(typeof(Qualifications));
            //builder.AddAttribute(5, "onchange", EventCallback.Factory.CreateBinder<TEnum>(this, value =>
            //{
            //    CurrentValueAsString = converter.ConvertToString(value);
            //}, (TEnum)converter.ConvertFromString(CurrentValueAsString), null));

            // Add an option element per enum value

            var enumType = typeof(Qualifications);
            var current  = Convert.ToInt64(CurrentValue);

            foreach (Qualifications value in Enum.GetValues(enumType))
            {
                var intVal = Convert.ToInt32(value);
                builder.OpenElement(4, "li");
                builder.AddAttribute(5, "class", $"list-group-item d-flex justify-content-between align-items-center" +
                                     $" {((current & intVal) == intVal ? "bg-primary text-light" : "")}");
                builder.AddAttribute(6, "onclick", EventCallback.Factory.Create(this, (x) =>
                {
                    if ((current & intVal) == intVal)
                    {
                        current ^= intVal;
                    }
                    else
                    {
                        current |= intVal;
                    }

                    CurrentValue = (Qualifications)current;
                }));
                builder.AddContent(12, GetDisplayName(value));
                builder.CloseElement();
            }

            builder.CloseElement(); // close the select element
        }
Exemplo n.º 27
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement("div");
     builder.AddAttribute("hg-signature-map-display");
     builder.AddMultipleAttributes(AdditionalAttributes);
     if (Value is not null)
     {
         builder.OpenRegion();
         int count = 0;
         foreach (var signaturePair in Value.SigPair)
         {
             builder.OpenRegion(count++);
             BuildSignatureMapRow(builder, signaturePair);
             builder.CloseRegion();
         }
         builder.CloseRegion();
     }
     builder.CloseElement();
 }
Exemplo n.º 28
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement(0, "li");
     builder.OpenElement(1, "a");
     builder.AddMultipleAttributes(2, AdditionalAttributes);
     builder.AddAttribute(3, "class", CssClass);
     builder.AddAttribute(5, "tabindex", _isActive ? "0" : "1");
     builder.AddAttribute(6, "role", "menuitem");
     builder.AddAttribute(7, "aria-label", Text);
     builder.OpenComponent <TelerikIcon>(8);
     builder.AddAttribute(9, "Icon", Icon);
     builder.CloseComponent();
     builder.OpenElement(10, "span");
     builder.AddAttribute(11, "class", "k-item-text");
     builder.AddContent(12, Text);
     builder.CloseElement();
     builder.CloseElement();
     builder.CloseElement();
 }
Exemplo n.º 29
0
        public void Apply(ref int sequence, RenderTreeBuilder treeBuilder)
        {
            if (Attributes.Any())
            {
                treeBuilder.AddMultipleAttributes(sequence + 3, Attributes);
            }

            if (Class.Any())
            {
                treeBuilder.AddAttribute(sequence + 1, "class", (string)Class);
            }

            if (Style.Any())
            {
                treeBuilder.AddAttribute(sequence + 2, "style", (string)Style);
            }

            sequence += SequenceCount;
        }
Exemplo n.º 30
0
 /// <summary>
 /// inherited
 /// </summary>
 /// <param name="builder"></param>
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     if (this._Show)
     {
         this.ClearDuplicateAttributes();
         builder.OpenElement(0, this._Tag);
         builder.AddMultipleAttributes(1, AdditionalAttributes);
         builder.AddAttribute(2, "class", this._Css);
         if (!string.IsNullOrEmpty(this._Content))
         {
             builder.AddContent(3, (MarkupString)this._Content);
         }
         else if (this.ChildContent != null)
         {
             builder.AddContent(4, ChildContent);
         }
         builder.CloseElement();
     }
 }