public static ExposeToWarpCoreApi GetRepositoryAttribute(this ISupportsCmsForms entity) { var entityType = entity.GetType(); var atr = (ExposeToWarpCoreApi)entityType.GetCustomAttribute(typeof(ExposeToWarpCoreApi)); return(atr); }
protected override void OnInit(EventArgs e) { base.OnInit(e); EnsureLayoutInitialized(); _activatedConfigurators = GetDescendantControls(surface, typeof(IConfiguratorControl)).Cast <IConfiguratorControl>().ToList(); //_dynamicFormRequest = Context.ToDynamicFormRequestContext(); _repo = RepositoryActivator.ActivateRepository <ISupportsCmsForms>(_cmsForm.RepositoryUid); var draft = GetDraft(); if (draft.IsNew) { var metadataRepo = new ContentTypeMetadataRepository(); var metadata = metadataRepo.GetContentType(draft.GetType()); FormTitleAdd.InnerText = $"Add {metadata.ContentNameSingular}"; FormTitleEdit.Visible = false; } else { FormTitleAdd.Visible = false; FormTitleEditName.InnerText = draft.Title; } //var d = draft.GetPropertyValues(ToolboxPropertyFilter.SupportsOrm); //var configuratorEditingContext = new ConfiguratorBuildArguments //{ // ClrType = draft.GetType(), // PropertyFilter = ToolboxPropertyFilter.SupportsOrm, // DefaultValues = d //}; //configuratorEditingContext.Events = CmsFormReadWriter.AddEventTracking(surface, configuratorEditingContext, _activatedConfigurators).Events; //CmsFormReadWriter.InitializeEditing(_activatedConfigurators, configuratorEditingContext); //SetConfiguratorEditingContextDefaultValuesFromUrl(configuratorEditingContext); //CmsFormReadWriter.SetDefaultValues(_activatedConfigurators, configuratorEditingContext); }