public static object JObjectTOObject(JObject obj)
        {
            if (obj == null)
            {
                return(null);
            }
            switch ((e_Type)Enum.Parse(typeof(e_Type), obj[nameof(ElementBase.Type)].ToString(), true))
            {
            case e_Type.DROPDOWNLIST:
                return(obj.ToObject <DropDownHtml>());

            case e_Type.TEXTBOX:
                return(obj.ToObject <TextBoxHtml>());

            case e_Type.RADIOBUTTONLIST:
                return(obj.ToObject <RadioButtonListHtml>());

            case e_Type.CHECKBOXLIST:
                return(obj.ToObject <CheckBoxListHtml>());

            case e_Type.CHECKBOX:
                return(obj.ToObject <CheckBoxHtml>());

            case e_Type.IMAGE:
                return(obj.ToObject <ImageHtml>());

            case e_Type.LINK:
                return(obj.ToObject <LinkHtml>());

            case e_Type.CAPTCHA:
                return(obj.ToObject <CaptchaHtml>());

            case e_Type.TITLE:
                return(obj.ToObject <TitleHtml>());

            case e_Type.DATEPICKER:
                return(obj.ToObject <DatePickerHtml>());

            case e_Type.CKEDITOR:
                return(obj.ToObject <CkeditorHtml>());

            case e_Type.HTMLCODE:
                return(obj.ToObject <HtmlCodeHtml>());

            case e_Type.FILEUPLOAD:
                return(obj.ToObject <FileUploadHtml>());

            case e_Type.BUTTON:
                return(obj.ToObject <ButtonHtml>());

            case e_Type.DOWNLOADLINK:
                return(obj.ToObject <DownloadLinkHtml>());

            case e_Type.COMBOSEARCH:
                return(obj.ToObject <ComboSearchHtml>());

            case e_Type.DATAGRID:
                return(obj.ToObject <DataGridHtml>());

            case e_Type.FORM:
                FormHtml formHtml = obj.ToObject <FormHtml>();
                formHtml.ContentHtml.ConvertChildrenToObject();
                return(formHtml);

            case e_Type.ROW:
                return(obj.ToObject <RowHtml>());

            case e_Type.ACCORDION:
                return(obj.ToObject <AccordionHtml>());

            case e_Type.CARD:
                return(obj.ToObject <CardHtml>());

            case e_Type.CHART:
                return(obj.ToObject <ChartHtml>());

            case e_Type.WORDCAPTCHA:
                return(obj.ToObject <WordCaptchaHtml>());

            default: return(null);
            }
        }
        public static object GetElement(JObject obj, HtmlElementHelperModel _helper, Guid dynamicFormId, bool isFormReadOnly)
        {
            object element = null;

            switch ((e_Type)Enum.Parse(typeof(e_Type), obj["type"].ToString(), true))
            {
            case e_Type.DROPDOWNLIST:
                element = new DropDownHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.TEXTBOX:
                element = new TextBoxHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.RADIOBUTTONLIST:
                element = new RadioButtonListHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.CHECKBOXLIST:
                element = new CheckBoxListHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.CHECKBOX:
                element = new CheckBoxHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.IMAGE:
                element = new ImageHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.LINK:
                element = new LinkHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.CAPTCHA:
                element = new CaptchaHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.TITLE:
                element = new TitleHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.DATEPICKER:
                element = new DatePickerHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.CKEDITOR:
                element = new CkeditorHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.HTMLCODE:
                element = new HtmlCodeHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.FILEUPLOAD:
                element = new FileUploadHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.BUTTON:
                element = new ButtonHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                if (!((ElementBase)element).CheckAccess())
                {
                    element = null;
                }
                break;

            case e_Type.DOWNLOADLINK:
                element = new DownloadLinkHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.COMBOSEARCH:
                element = new ComboSearchHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.DATAGRID:
                element = new DataGridHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.FORM:
                element = new FormHtml(obj, _helper, obj["formId"].ToGuidObj(), isFormReadOnly);
                break;

            case e_Type.ACCORDION:
                element = new AccordionHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.CARD:
                element = new CardHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.ROW:
                element = new RowHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.CHART:
                element = new ChartHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;

            case e_Type.WORDCAPTCHA:
                element = new WordCaptchaHtml(obj, _helper, dynamicFormId, isFormReadOnly);
                break;
            }
            return(element);
        }