private object GetComponent(IComponentBuilder builder)
 {
     object component;
     if (builder == null)
     {
         component = null;
     }
     else
     {
         component = builder.BuildComponent();
     }
     return component;
 }
Ejemplo n.º 2
0
        private object GetComponent(IComponentBuilder builder)
        {
            object component;

            if (builder == null)
            {
                component = null;
            }
            else
            {
                component = builder.BuildComponent();
            }
            return(component);
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            int i = 0;

            foreach (var propertyInfo in this.GetProperties())
            {
                IComponentBuilder componentBuilder = null;
                try
                {
                    componentBuilder = Builders.FirstOrDefault(b => b.CanBuildComponent(propertyInfo));
                    if (componentBuilder != null)
                    {
                        i = componentBuilder.BuildComponent(this.Context.Model, propertyInfo, builder, i);
                    }
                }
                catch (Exception ex)
                {
                    Log.Error($"Error building component for property {this.Context.Model.GetType().Name}.{propertyInfo.Name} with component builder {componentBuilder}: {ex.Message}{Environment.NewLine}{ex.StackTrace}", ex);
                }
            }
        }