public GridMetadataDrop(IPortalLiquidContext portalLiquidContext, GridMetadata gridMetadata, int languageCode) : base(portalLiquidContext) { if (gridMetadata == null) { return; } CssClass = gridMetadata.CssClass; GridCssClass = gridMetadata.GridCssClass; GridColumnWidthStyle = gridMetadata.GridColumnWidthStyle == null ? null : gridMetadata.GridColumnWidthStyle.GetValueOrDefault(EntityGridExtensions.GridColumnWidthStyle.Percent).ToString(); ColumnOverrides = gridMetadata.ColumnOverrides != null?gridMetadata.ColumnOverrides.Select(c => new ViewColumnDrop(portalLiquidContext, c)) : null; _viewActions = new Lazy <IEnumerable <ActionDrop> >(() => gridMetadata.ViewActions != null ? gridMetadata.ViewActions.Select(a => CreateActionDrop(portalLiquidContext, a, languageCode)) : null, LazyThreadSafetyMode.None); _itemActions = new Lazy <IEnumerable <ActionDrop> >(() => gridMetadata.ItemActions != null ? gridMetadata.ItemActions.Select(a => CreateActionDrop(portalLiquidContext, a, languageCode)) : null, LazyThreadSafetyMode.None); _loadingMessage = Localization.CreateLazyLocalizedString(gridMetadata.LoadingMessage, languageCode); _errorMessage = Localization.CreateLazyLocalizedString(gridMetadata.ErrorMessage, languageCode); _accessDeniedMessage = Localization.CreateLazyLocalizedString(gridMetadata.AccessDeniedMessage, languageCode); _emptyMessage = Localization.CreateLazyLocalizedString(gridMetadata.EmptyMessage, languageCode); _detailsFormModal = new Lazy <DetailsFormModalDrop>(() => new DetailsFormModalDrop(portalLiquidContext, gridMetadata.DetailsFormDialog, languageCode), LazyThreadSafetyMode.None); _editFormModal = new Lazy <EditFormModalDrop>(() => new EditFormModalDrop(portalLiquidContext, gridMetadata.EditFormDialog, languageCode), LazyThreadSafetyMode.None); _createFormModal = new Lazy <CreateFormModalDrop>(() => new CreateFormModalDrop(portalLiquidContext, gridMetadata.CreateFormDialog, languageCode), LazyThreadSafetyMode.None); _deleteModal = new Lazy <DeleteModalDrop>(() => new DeleteModalDrop(portalLiquidContext, gridMetadata.DeleteDialog, languageCode), LazyThreadSafetyMode.None); _errorModal = new Lazy <ErrorModalDrop>(() => new ErrorModalDrop(portalLiquidContext, gridMetadata.ErrorDialog, languageCode), LazyThreadSafetyMode.None); _lookupModal = new Lazy <LookupModalDrop>(() => new LookupModalDrop(portalLiquidContext, gridMetadata.LookupDialog, languageCode), LazyThreadSafetyMode.None); _createRecordModal = new Lazy <CreateRelatedRecordModalDrop>(() => new CreateRelatedRecordModalDrop(portalLiquidContext, gridMetadata.CreateRelatedRecordDialog, languageCode), LazyThreadSafetyMode.None); }
public Grid() { GridMetadata = new GridMetadata(); GridMetadata.StateHasChanged += OnGridMetadataStateHasChanged; }