public static string GetPropertyValue(IAutoviewDto autoviewDto, PropertyInfo propertyInfo) { var propertyValue = propertyInfo.GetValue(obj: autoviewDto); if (propertyValue is null) { return(default);
public static void Dropdown (this IAutoviewDto autoviewDto, string propertyName, List <SelectListItem> selectListItems, string displayName = default, string cssId = default, string cssClass = default) { string propertyValue = Extensions.GetPropertyValue(autoviewDto, propertyName); var dropdownInstance = new Elements.Dropdown.Dropdown(propertyName, propertyValue, selectListItems, displayName, cssId, cssClass); autoviewDto.InitalElement(element: dropdownInstance); }
public static void Textbox (this IAutoviewDto autoviewDto, string propertyName, string displayName = default, string cssId = default, string cssClass = default) { string propertyValue = Extensions.GetPropertyValue(autoviewDto, propertyName); var textboxInstance = new Elements.Inputs.Textbox(propertyName, propertyValue, displayName, cssId, cssClass); autoviewDto.InitalElement(element: textboxInstance); }
public Mainboard InitialElements(IAutoviewDto dto) { dto.InitialDto(); dto.Textbox(nameof(FullName)); dto.Dropdown(propertyName: nameof(Dropdown), selectListItems: DropdownItems()); return(Initializer.Return()); }
public static PropertyInfo GetPropertyInfoOfDtoByName(IAutoviewDto autoviewDto, string propertyName) { var getPropertyInfoFromDto = Extensions.GetPropertyInfoByName(autoviewDto, propertyName); if (getPropertyInfoFromDto is null) { throw new Exception("property info not found"); } return(getPropertyInfoFromDto); }
public static Property InitProperty(IAutoviewDto autoviewDto, AElement element, ModelStateDictionary modelstate) { PropertyInfo getPropertyInfo = GetPropertyInfoOfDtoByName(autoviewDto, propertyName: element.Name); string getPropertyValue = Extensions.GetPropertyValue(autoviewDto, propertyInfo: getPropertyInfo); var newProperty = new Property(propertyValue: getPropertyValue, element, propertyInfo: getPropertyInfo); InitPropertyErrors(property: ref newProperty, modelstate); newProperty.Element = newProperty.Element.InitialElement(property: newProperty); return(newProperty); }
public static void InitalElement(this IAutoviewDto autoviewDto, AElement element) { Mainboard.Elements.Add(item: element); }
public static void InitialDto(this IAutoviewDto autoviewDto) { Mainboard = new Mainboard(autoviewDto: autoviewDto); }
public static void CheckPropertyAndAddToTempList(ref List <Property> listOfProperties, IAutoviewDto autoviewDto, AElement element, ModelStateDictionary modelstate) { try { listOfProperties.Add(item: InitProperty(autoviewDto, element, modelstate)); } catch { } }
public static PropertyInfo GetPropertyInfoByName(IAutoviewDto autoviewDto, string propertyName) { return(autoviewDto.GetType().GetProperty(name: propertyName)); }
public static PropertyInfo[] ArrayOfPropertyInfos(IAutoviewDto autoviewDto) { return(autoviewDto.GetType().GetProperties()); }
public Mainboard(IAutoviewDto autoviewDto) { AutoviewDto = autoviewDto; Elements = new List <AElement>(); }