
@foreach (DialogControl control in Controls)
{
    if (control.Visible)
    {
        if (control is ButtonControl button)
        {
            <ButtonComponent Control="button" WebReport="WebReport" />
        }
        else if (control is LabelControl label)
        {
            <LabelComponent Control="label" WebReport="WebReport" />
        }
        else if (control is TextBoxControl textBox)
        {
            <TextBoxComponent Control="textBox" WebReport="WebReport" />
        }
        else if (control is CheckBoxControl checkBox)
        {
            <CheckBoxComponent Control="checkBox" WebReport="WebReport" />
        }
        else if (control is RadioButtonControl radioButton)
        {
            <RadioButtonComponent Control="radioButton" WebReport="WebReport" />
        }
        else if (control is ComboBoxControl comboBox)
        {
            <ComboBoxComponent Control="comboBox" WebReport="WebReport" />
        }
        else if (control is ListBoxControl listBox)
        {
            <ListBoxComponent Control="listBox" WebReport="WebReport" />
        }
        else if (control is CheckedListBoxControl checkedListBox)
        {
            <CheckedListBoxComponent Control="checkedListBox" WebReport="WebReport" />
        }
        else if (control is DateTimePickerControl dateTimePicker)
        {
            <DateTimePickerComponent Control="dateTimePicker" WebReport="WebReport"/>
        }
        else if (control is MonthCalendarControl monthCalendar)
        {
            <MonthCalendarComponent Control="monthCalendar" WebReport="WebReport"/>
        }
        else if (control is GroupBoxControl groupBox)
        {
            <GroupBoxComponent Control="groupBox" WebReport="WebReport"/>
        }
        else if (control is PictureBoxControl pictureBox)
        {
            <PictureBoxComponent Control="pictureBox" WebReport="WebReport"/>
        }
    }
}

@code {
    [Parameter]
    public DialogComponentCollection Controls { get; set; }

    [Parameter]
    public WebReport WebReport { get; set; }
}
