private void BindDataValue <T>(ExpandoObject data, string key, RenderTreeBuilder builder, DynamicControl control)
        {
            var accessor = ((IDictionary <string, object>)data);

            object value = default(T);

            accessor.TryGetValue(key, out value);

            value = GetValue <T>(accessor, key);

            var valueChanged = RuntimeHelpers.TypeCheck(
                EventCallback.Factory.Create <T>(
                    this, EventCallback.Factory.CreateInferred(this, __value => accessor[key] = __value,
                                                               GetValue <T>(accessor, key))));

            var formElementReference = new ValueReference <T>()
            {
                Value        = (T)value,
                ValueChanged = valueChanged
            };

            var constantDropDown = Expression.Constant(formElementReference, typeof(ValueReference <T>));
            var exp = Expression.Property(constantDropDown, nameof(ValueReference <T> .Value));

            builder.AddAttribute(1, "Value", formElementReference.Value);
            builder.AddAttribute(3, "ValueChanged", formElementReference.ValueChanged);
            builder.AddAttribute(4, "ValueExpression", Expression.Lambda <Func <T> >(exp));
            builder.AddAttribute(6, "Placeholder", control.EmptyText ?? String.Empty);
        }
 public void AddGridViewComponent(ITableDataAdapter tableDataAdapter)
 {
     renderTreeBuilder.OpenComponent <GridView>(++sequence);
     renderTreeBuilder.AddAttribute(++sequence, "DataAdapter", RuntimeHelpers.TypeCheck(tableDataAdapter));
     renderTreeBuilder.AddAttribute(++sequence, "PageSize", RuntimeHelpers.TypeCheck(5));
     renderTreeBuilder.CloseComponent();
 }
        private void AddEventAttributes()
        {
            if (TableDataSet.GridViewEvents.SaveOperationFinished != null)
            {
                RendererTreeBuilder.AddAttribute(
                    nameof(ITableDataSet.GridViewEvents.SaveOperationFinished),
                    RuntimeHelpers.TypeCheck(TableDataSet.GridViewEvents.SaveOperationFinished));
            }

            if (TableDataSet.GridViewEvents.NewItemCreated != null)
            {
                RendererTreeBuilder.AddAttribute(
                    nameof(ITableDataSet.GridViewEvents.NewItemCreated),
                    RuntimeHelpers.TypeCheck(TableDataSet.GridViewEvents.NewItemCreated));
            }

            if (TableDataSet.GridViewEvents.OnItemClicked != null)
            {
                RendererTreeBuilder.AddAttribute(
                    nameof(ITableDataSet.GridViewEvents.OnItemClicked),
                    RuntimeHelpers.TypeCheck(TableDataSet.GridViewEvents.OnItemClicked));
            }

            if (TableDataSet.GridViewEvents.DeleteOperationFinished != null)
            {
                RendererTreeBuilder.AddAttribute(
                    nameof(ITableDataSet.GridViewEvents.DeleteOperationFinished),
                    RuntimeHelpers.TypeCheck(TableDataSet.GridViewEvents.DeleteOperationFinished));
            }
        }
 public void AddGridViewComponent(ITableDataAdapter tableDataAdapter)
 {
     RendererTreeBuilder.OpenComponent(typeof(GridViewGroup <>).MakeGenericType(tableDataAdapter.UnderlyingTypeOfItem));
     RendererTreeBuilder.AddAttribute("DataAdapter", RuntimeHelpers.TypeCheck(tableDataAdapter));
     RendererTreeBuilder.AddAttribute(nameof(ITableDataSet.PageableOptions.PageSize), GridConfiguration.GroupingOptions.GroupPageSize);
     RendererTreeBuilder.CloseComponent();
 }
Exemple #5
0
 protected override void ComposeTree(TreeComposer composer)
 {
     composer.Inject <Router>(new Dictionary <string, object>
     {
         { "AppAssembly", RuntimeHelpers.TypeCheck(typeof(App).Assembly) }
     });
 }
        public void AddDetailGridViewComponent(ITableDataAdapter tableDataAdapter)
        {
            if (tableDataAdapter is null)
            {
                return;
            }

            var masterDetailRelationship = GridConfiguration.FindRelationshipConfiguration(tableDataAdapter.UnderlyingTypeOfItem);
            var pageSize = RuntimeHelpers.TypeCheck(masterDetailRelationship.DetailGridViewPageSize(TableDataSet));

            RendererTreeBuilder.OpenComponent(typeof(GridViewGeneric <>).MakeGenericType(tableDataAdapter.UnderlyingTypeOfItem));
            RendererTreeBuilder.AddAttribute("DataAdapter", RuntimeHelpers.TypeCheck(tableDataAdapter));
            RendererTreeBuilder.AddAttribute(nameof(ITableDataSet.PageableOptions.PageSize), pageSize);

            RendererTreeBuilder.AddAttribute(
                nameof(ILazyTableDataSet.LazyLoadingOptions),
                new LazyLoadingOptions
            {
                DataUri    = masterDetailRelationship.DetailGridLazyLoadingUrl(),
                PutDataUri = masterDetailRelationship.DetailGridUpdateUrl(),
                DeleteUri  = masterDetailRelationship.DetailGridDeleteUrl()
            });

            AddEventAttributes();
            RendererTreeBuilder.CloseComponent();
        }
        /// <summary>
        /// Generate a randerable section for the given property information.
        /// </summary>
        /// <typeparam name="TValue">Property value type.</typeparam>
        /// <param name="builder">Render tree.</param>
        private void GenerateRenderTreeForInputField <TValue>(RenderTreeBuilder builder)
        {
            var componentType = GetComponentTypeToRenderForValueType <TValue>();

            if (componentType == default)
            {
                GenerateRenderTreeForChildInputFields <TValue>(builder);

                return;
            }

            var constant     = Expression.Constant(CascadedEditContext.Model, CascadedEditContext.Model.GetType());
            var exp          = Expression.Property(constant, PropertyInformation.Name);
            var lambda       = Expression.Lambda(exp);
            var castedLambda = (Expression <Func <TValue> >)lambda;
            var currentValue = (TValue)PropertyInformation.GetValue(CascadedEditContext.Model);

            builder.OpenComponent(0, componentType);
            builder.AddAttribute(1, "id", PropertyInformation.Name);
            builder.AddAttribute(2, nameof(InputBase <TValue> .Value), currentValue);
            builder.AddAttribute(3, nameof(InputBase <TValue> .ValueExpression), castedLambda);
            builder.AddAttribute(4, nameof(InputBase <TValue> .ValueChanged), RuntimeHelpers.TypeCheck(
                                     EventCallback.Factory.Create(
                                         this,
                                         EventCallback.Factory.CreateInferred(this, val => PropertyInformation.SetValue(CascadedEditContext.Model, val),
                                                                              (TValue)PropertyInformation.GetValue(CascadedEditContext.Model)))));
            builder.CloseComponent();
        }
Exemple #8
0
 public virtual RenderFragment CreateBuilder()
 {
     return((builder) =>
     {
         builder.OpenElement(0, "div");
         builder.OpenElement(1, "span");
         builder.AddContent(2, Caption);
         builder.CloseElement();
         builder.OpenComponent <DxTextBox>(3);
         builder.AddAttribute(4, "Text", PropertyValue == null ? "" : PropertyValue.ToString());
         builder.AddAttribute(5, "TextChanged", new Action <string>(value =>
         {
             PropertyValue = value;
             OnControlValueChanged();
         }));
         builder.AddAttribute(6, "TextExpression", RuntimeHelpers.TypeCheck <Expression <Func <string> > >(() =>
                                                                                                           PropertyValue == null ? "" : PropertyValue.ToString()
                                                                                                           ));
         builder.AddComponentReferenceCapture(7, (object obj) =>
         {
             TextBox = (DxTextBox)obj;
         });
         builder.CloseComponent();
         builder.CloseElement();
     });
 }
Exemple #9
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenComponent <Router>(0);
     builder.AddAttribute(1, "AppAssembly", RuntimeHelpers.TypeCheck(
                              typeof(Program).Assembly
                              ));
     builder.AddAttribute(2, "PreferExactMatches", RuntimeHelpers.TypeCheck(
                              true
                              ));
     builder.AddAttribute(3, "Found", (RenderFragment <RouteData>)(routeData => builder2 =>
     {
         builder2.OpenComponent <RouteView>(4);
         builder2.AddAttribute(5, "RouteData", RuntimeHelpers.TypeCheck(
                                   routeData
                                   ));
         builder2.CloseComponent();
     }
                                                                   ));
     builder.AddAttribute(7, "NotFound", (RenderFragment)(builder2 =>
     {
         builder2.OpenComponent <LayoutView>(8);
         builder2.AddAttribute(9, "ChildContent", (RenderFragment)(builder3 =>
         {
             builder3.AddMarkupContent(10, "<p>Sorry, there\'s nothing at this address.</p>");
         }
                                                                   ));
         builder2.CloseComponent();
     }
                                                          ));
     builder.CloseComponent();
 }
Exemple #10
0
 private void BuildRenderTreeForEndorsement(RenderTreeBuilder builder, Endorsement root)
 {
     builder.OpenComponent <InputEndorsement>();
     builder.AddAttribute("Value", RuntimeHelpers.TypeCheck(root));
     builder.AddAttribute("ValueChanged", RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this, RuntimeHelpers.CreateInferredEventCallback(this, __value => SwapRootEndorsment(root, __value), root))));
     builder.CloseComponent();
 }
Exemple #11
0
        public void AddDetailGridViewComponent(ITableDataAdapter tableDataAdapter)
        {
            if (tableDataAdapter is null)
            {
                return;
            }

            var masterDetailRelationship = GridConfiguration.FindRelationshipConfiguration(tableDataAdapter.UnderlyingTypeOfItem);
            var pageSize = RuntimeHelpers.TypeCheck(masterDetailRelationship.DetailGridViewPageSize(TableDataSet));

            renderTreeBuilder.OpenComponent(++sequence, typeof(GridViewGeneric <>).MakeGenericType(tableDataAdapter.UnderlyingTypeOfItem));
            renderTreeBuilder.AddAttribute(++sequence, "DataAdapter", RuntimeHelpers.TypeCheck(tableDataAdapter));
            renderTreeBuilder.AddAttribute(++sequence, nameof(ITableDataSet.PageableOptions.PageSize), pageSize);

            var lazyLoadingUrl = masterDetailRelationship.DetailGridLazyLoadingUrl();

            if (!string.IsNullOrEmpty(lazyLoadingUrl))
            {
                renderTreeBuilder.AddAttribute(++sequence, nameof(ILazyTableDataSet.LazyLoadingOptions), new LazyLoadingOptions {
                    DataUri = lazyLoadingUrl
                });
            }

            renderTreeBuilder.CloseComponent();
        }
 private void AddEventAttributes()
 {
     if (TableDataSet.GridViewEvents.SaveOperationFinished != null)
     {
         renderTreeBuilder.AddAttribute(++sequence,
                                        nameof(ITableDataSet.GridViewEvents.SaveOperationFinished),
                                        RuntimeHelpers.TypeCheck(TableDataSet.GridViewEvents.SaveOperationFinished));
     }
 }
Exemple #13
0
        public void AddGridViewComponent(ITableDataAdapter tableDataAdapter)
        {
            if (tableDataAdapter is null)
            {
                return;
            }

            renderTreeBuilder.OpenComponent(++sequence, typeof(GridViewGeneric <>).MakeGenericType(tableDataAdapter.UnderlyingTypeOfItem));
            renderTreeBuilder.AddAttribute(++sequence, "DataAdapter", RuntimeHelpers.TypeCheck(tableDataAdapter));
            renderTreeBuilder.AddAttribute(++sequence, nameof(ITableDataSet.PageableOptions.PageSize), RuntimeHelpers.TypeCheck(TableDataSet.PageableOptions.PageSize));
            renderTreeBuilder.CloseComponent();
        }
Exemple #14
0
 protected override void BuildRenderTree(RenderTreeBuilder builder)
 {
     builder.OpenElement(0, Tag);
     builder.AddAttribute(1, "class", ClassMapper.AsString());
     builder.AddAttribute(2, "style", StyleMapper.AsString());
     builder.AddMultipleAttributes(3,
                                   RuntimeHelpers.TypeCheck <IEnumerable <KeyValuePair <string, object> > >(Attributes));
     builder.AddAttribute(4, "Id", Id);
     builder.AddElementReferenceCapture(5, (__value) => { Ref = __value; });
     builder.AddContent(7, ChildContent);
     builder.CloseElement();
 }
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            //EnabledRender = false;

            base.BuildRenderTree(builder);


            int k = -1;

            builder.OpenComponent <CompBlazorScrollbar>(k++);
            builder.AddAttribute(k++, "bsbSettings", RuntimeHelpers.TypeCheck <BsbSettings>(bvgScroll.bsbSettings));
            builder.AddAttribute(k++, "OnPositionChange", new Action <double>(onscroll));
            builder.AddComponentReferenceCapture(k++, (c) =>
            {
                bvgScroll.compBlazorScrollbar = c as CompBlazorScrollbar;
            });

            builder.CloseComponent();
        }
        private void RenderGrid(RenderTreeBuilder builder, int seq)
        {
            var constructed = oxGrid.GetType();

            builder.AddMarkupContent(seq++, "\r\n            ");
            builder.OpenComponent(seq++, constructed);
            builder.AddAttribute(seq++, "AllowButtons", RuntimeHelpers.TypeCheck <System.Boolean>(true));
            builder.AddAttribute(seq++, "AllowPrint", RuntimeHelpers.TypeCheck <System.Boolean>(true));
            builder.AddAttribute(seq++, "OnAdd", RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this, (value) => viewEdit.ShowDialog(null, OxActionModel.New))));
            builder.AddAttribute(seq++, "OnEdit", RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this, (value) => viewEdit.ShowDialog(value, OxActionModel.Edit))));
            builder.AddAttribute(seq++, "OnDelete", RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this, (value) => viewEdit.ShowDialog(value, OxActionModel.Delete))));
            builder.AddComponentReferenceCapture(seq++, (value) =>
            {
                var getRef = TypeHelper.ConvertTo(value, constructed);
                oxGrid     = getRef;
            });
            builder.CloseComponent();
            builder.AddMarkupContent(seq++, "\r\n        ");
        }
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            var sequenceGenerator = new SequenceGenerator();

            builder.OpenComponent <CascadingValue <NavigationBar> >(sequenceGenerator.GetNextValue());
            builder.AddAttribute(sequenceGenerator.GetNextValue(), nameof(CascadingValue <NavigationBar> .Value), RuntimeHelpers.TypeCheck(this));
            builder.AddAttribute(sequenceGenerator.GetNextValue(), nameof(CascadingValue <NavigationBar> .ChildContent), (RenderFragment)(b => base.BuildRenderTree(b)));
            builder.CloseComponent();
        }
        public RenderFragment CreateComponent <T>(T data, EditContext context) => builder =>
        {
            var proList = typeof(T).GetProperties();
            foreach (var prp in proList.Where(p => p.Name != "Id"))
            {
                if (prp.GetCustomAttributes(typeof(DataTypeAttribute), false).Length != 0)
                {
                    var attrList =
                        (DataTypeAttribute)prp.GetCustomAttributes(typeof(DataTypeAttribute), false).FirstOrDefault();
                    var displayLabel =
                        (DisplayAttribute)prp.GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault();
                    // Get the initial property value
                    var propInfo = typeof(T).GetProperty(prp.Name);
                    // Create an expression to set the ValueExpression-attribute.
                    var constant = Expression.Constant(data, typeof(T));
                    var exp      = Expression.Property(constant, prp.Name);
                    switch (attrList.DataType)
                    {
                    case DataType.Text:
                    case DataType.EmailAddress:
                    case DataType.PhoneNumber:
                    case DataType.MultilineText:
                    {
                        builder.OpenComponent(0, typeof(InputText));
                        // Create the handler for ValueChanged. I use reflection to the value.
                        builder.AddAttribute(3, "ValueChanged",
                                             RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this,
                                                                                                   EventCallback.Factory.CreateInferred(this,
                                                                                                                                        _value =>
                            {
                                propInfo.SetValue(data, _value);
                                context.NotifyFieldChanged(new FieldIdentifier(data, prp.Name));
                            },
                                                                                                                                        (string)propInfo.GetValue(data)))));
                        builder.AddAttribute(4, "ValueExpression", Expression.Lambda <Func <string> >(exp));
                        if (attrList.DataType == DataType.MultilineText)
                        {
                            builder.AddAttribute(5, "Multiline", true);
                        }
                        if (attrList.DataType == DataType.EmailAddress)
                        {
                            builder.AddAttribute(5, "InputType", InputType.Email);
                        }

                        break;
                    }

                    case DataType.Date:
                        builder.OpenComponent(0, typeof(InputDate <DateTime?>));
                        var dateValue = propInfo.GetValue(data);
                        builder.AddAttribute(2, "Style", "date-picker-test");
                        builder.AddAttribute(3, "ValueChanged",
                                             RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this,
                                                                                                   EventCallback.Factory.CreateInferred(this,
                                                                                                                                        __value => propInfo.SetValue(data, __value),
                                                                                                                                        (DateTime?)propInfo.GetValue(data)))));
                        builder.AddAttribute(4, "ValueExpression", Expression.Lambda <Func <DateTime?> >(exp));
                        break;

                    default:
                        Console.WriteLine($"No Component for DataType: {attrList?.DataType}");
                        continue;
                    }

                    try
                    {
                        var defaultValue = propInfo.GetValue(data);
                        builder.AddAttribute(1, "Value", defaultValue);
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }
                    finally
                    {
                        builder.AddAttribute(6, "Placeholder", displayLabel?.Description ?? String.Empty);
                        builder.CloseComponent();
                    }
                }
            }
        };
        public RenderFragment CreateComponent <T>(T data, EditContext context) => builder =>
        {
            var proList = typeof(T).GetProperties();
            foreach (var prp in proList.Where(p => p.Name != "Id"))
            {
                if (prp.GetCustomAttributes(typeof(DataTypeAttribute), false).Length != 0)
                {
                    var attrList =
                        (DataTypeAttribute)prp.GetCustomAttributes(typeof(DataTypeAttribute), false).FirstOrDefault();
                    var displayLabel =
                        (DisplayAttribute)prp.GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault();
                    // Get the initial property value
                    var propInfoValue = typeof(T).GetProperty(prp.Name);
                    // Create an expression to set the ValueExpression-attribute.
                    var constant = Expression.Constant(data, typeof(T));
                    var exp      = Expression.Property(constant, prp.Name);
                    switch (attrList.DataType)
                    {
                    case DataType.Text:
                    case DataType.EmailAddress:
                    case DataType.PhoneNumber:
                    case DataType.MultilineText:
                    {
                        builder.OpenComponent(0, typeof(MudTextField <string>));
                        builder.AddAttribute(3, "ValueChanged",
                                             RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this,
                                                                                                   EventCallback.Factory.CreateInferred(this,
                                                                                                                                        __value =>
                            {
                                propInfoValue.SetValue(data, __value);
                                context.NotifyFieldChanged(new FieldIdentifier(data, prp.Name));
                            },
                                                                                                                                        (string)propInfoValue.GetValue(data)))));
                        builder.AddAttribute(4, "ValueExpression", Expression.Lambda <Func <string> >(exp));
                        if (attrList.DataType == DataType.MultilineText)
                        {
                            builder.AddAttribute(5, "Multiline", true);
                        }
                        if (attrList.DataType == DataType.EmailAddress)
                        {
                            builder.AddAttribute(5, "InputType", InputType.Email);
                        }

                        break;
                    }

                    case DataType.Date:
                        builder.OpenComponent(0, typeof(MudDatePicker));
                        var dateValue = propInfoValue.GetValue(data);
                        builder.AddAttribute(1, "Date", dateValue);
                        builder.AddAttribute(3, "DateChanged",
                                             RuntimeHelpers.TypeCheck(EventCallback.Factory.Create(this,
                                                                                                   EventCallback.Factory.CreateInferred(this,
                                                                                                                                        __value => propInfoValue.SetValue(data, __value),
                                                                                                                                        (DateTime?)propInfoValue.GetValue(data)))));
                        builder.AddAttribute(4, "ValueExpression", Expression.Lambda <Func <DateTime?> >(exp));
                        break;

                    case DataType.Custom:
                        var options = new HashSet <string>
                        {
                            "Blazor",
                            "Angular",
                            ".NET Core"
                        };
                        builder.OpenComponent(0, typeof(MudSelect <string>));
                        var selectValues = propInfoValue.GetValue(data);
                        builder.AddAttribute(1, "Value", selectValues);
                        builder.AddAttribute(2, "SelectedValues", options);
                        builder.AddAttribute(4, "ChildContent",
                                             (RenderFragment)((builder2) =>
                        {
                            foreach (var option in options)
                            {
                                builder2.AddMarkupContent(5, "\r\n    ");
                                builder2.OpenComponent <MudSelectItem <string> >(6);
                                builder2.AddAttribute(1, "Value", option);
                                builder2.AddAttribute(2, "InnerHTML", option);
                                builder2.CloseComponent();
                                builder2.AddMarkupContent(9, "\r\n");
                            }
                        }));
                        builder.AddAttribute(4, "ValueExpression", Expression.Lambda <Func <string> >(exp));
                        break;

                    default:
                        Console.WriteLine($"No Component for DataType: {attrList?.DataType}");
                        break;
                    }

                    try
                    {
                        var defaultValue = propInfoValue.GetValue(data);
                        if (attrList.DataType != DataType.Date)
                        {
                            builder.AddAttribute(1, "Value", defaultValue);
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine(e.Message);
                    }
                    finally
                    {
                        builder.AddAttribute(6, "Label", displayLabel?.Description ?? String.Empty);
                        builder.CloseComponent();
                    }
                }
            }
        };
        private int WriteLayout(RenderTreeBuilder builder, XmlReader reader, int globalSeq)
        {
            int localSeq = globalSeq;

            if (reader.NodeType == XmlNodeType.Element)
            {
                //Console.WriteLine(globalSeq + " element " + reader.Name);

                if (reader.LocalName.StartsWith("wc-child-"))
                {
                    var position = Convert.ToInt32(reader.LocalName.Substring("wc-child-".Length));
                    var toRender = DesignNodeCollection[position];

                    builder.OpenComponent <PageDesignerChild>(localSeq++);
                    builder.AddAttribute(localSeq++, nameof(PageDesignerChild.DesignNode), RuntimeHelpers.TypeCheck <BlazorComponents.Shared.PreviewNode>(toRender));
                    builder.AddAttribute(localSeq++, nameof(PageDesignerChild.Dispatcher), RuntimeHelpers.TypeCheck <PagePreview>(Dispatcher));

                    var justElements = DesignNodeCollection.Where(x => x.Type != NodeType.Html).ToList();

                    var childPosition = ChildPosition.Middle;
                    if (justElements.First() == toRender)
                    {
                        childPosition = ChildPosition.First;
                    }

                    if (justElements.Last() == toRender)
                    {
                        childPosition = ChildPosition.Last;
                    }

                    builder.AddAttribute(localSeq++, nameof(PageDesignerChild.Position), RuntimeHelpers.TypeCheck <ChildPosition>(childPosition));

                    builder.CloseComponent();
                    return(localSeq);
                }
                else
                {
                    //Console.WriteLine(globalSeq + " BLAZOR OPEN EL");
                    builder.OpenElement(localSeq++, reader.Name.ToString());


                    if (reader.HasAttributes)
                    {
                        //Console.WriteLine(reader.Name + " Attribute");
                        for (int i = 0; i < reader.AttributeCount; i++)
                        {
                            reader.MoveToAttribute(i);
                            //Console.WriteLine(localSeq + " attr " + reader.Name + ", " + reader.Value);
                            //Console.WriteLine(localSeq + " BLAZOR ADD ATTR");
                            builder.AddAttribute(localSeq++, reader.Name, reader.Value);
                        }
                        reader.MoveToElement();
                    }


                    if (reader.IsEmptyElement)
                    {
                        //Console.WriteLine(localSeq + " BLAZOR CLOSE EL *EMPTY*");
                        builder.CloseElement();
                    }

                    return(localSeq);
                }
            }

            if (reader.NodeType == XmlNodeType.Text)
            {
                // Console.WriteLine(globalSeq + " text " + reader.Value);
                //Console.WriteLine(globalSeq + " BLAZOR ADD MARKUP");
                builder.AddMarkupContent(localSeq++, reader.Value?.ToString());
                return(localSeq);
            }

            if (reader.NodeType == XmlNodeType.EndElement)
            {
                //Console.WriteLine(globalSeq + " end-element " + reader.Name);
                //Console.WriteLine(globalSeq + " BLAZOR CLOSE EL");
                builder.CloseElement();
                return(localSeq);
            }


            return(localSeq);
        }