public virtual void InitializeComponent(Component component) { foreach (var propertyInfo in componentReflectionUtils.GetComponentProperties(component)) { var nestedCompnent = container.Create(propertyInfo.PropertyType); propertyInfo.SetValue(component, nestedCompnent); } }
private Component GetNestedComponent(Component component, string route) { var nestedComponent = componentReflectionUtils.GetComponentProperties(component) .Where(x => x.GetCustomAttributes <RouteAttribute>().SingleOrDefault()?.Route == route) .Select(x => (Component)x.GetValue(component) !) .SingleOrDefault(); if (nestedComponent == null) { throw new AutoTestFrameworkException("Router have not been able to find a nested component"); } return(nestedComponent); }
private IEnumerable <PropertyInfo> GetContentComponentProperties(Component component) { return(componentReflectionUtils.GetComponentProperties(component) .Where(x => x.GetCustomAttributes <ContentAttribute>().SingleOrDefault() != null)); }