Exemple #1
0
 public WriteTextComponent(ResolvedField field) : base(field)
 {
     Elements = new AbstractElement[] {
         new TextElement
         {
             Element = new Reference
             {
                 Codename = "field_details__name"
             },
             Value = field.Name
         },
         new TextElement
         {
             Element = new Reference
             {
                 Codename = "field_details__comment"
             },
             Value = field.Comment
         },
         new RichTextElement
         {
             Element = new Reference
             {
                 Codename = "default_text"
             },
             Value = field.DefaultText
         }
     };
 }
Exemple #2
0
 protected AbstractComponent(ResolvedField field)
 {
     Type = new Reference
     {
         Codename = field.Type
     };
 }
Exemple #3
0
 public UploadFileComponent(ResolvedField field) : base(field)
 {
     Elements = new AbstractElement[] {
         new TextElement
         {
             Element = new Reference
             {
                 Codename = "field_details__name"
             },
             Value = field.Name
         },
         new TextElement
         {
             Element = new Reference
             {
                 Codename = "field_details__comment"
             },
             Value = field.Comment
         }
     };
 }
Exemple #4
0
        public string?Resolve(Field field)
        {
            var resolvedField = new ResolvedField
            {
                Name     = field.FieldDetailsName,
                Codename = field.System.Codename,
                Comment  = field.FieldDetailsComment,
                Type     = field.System.Type
            };

            switch (field.System.Type)
            {
            case download_asset:
                resolvedField.Assets = field.Assets;
                break;

            case write_text:
                resolvedField.DefaultText = field.DefaultText;
                break;
            }

            return(CoreHelper.Serialize(resolvedField));
        }