Пример #1
0
 internal static CustomFieldBuilder CustomField( Silanis.ESL.API.CustomField apiCustomField ) {
     CustomFieldBuilder result = new CustomFieldBuilder();
     result.WithId( apiCustomField.Id )
             .WithDefaultValue( apiCustomField.Value );
            
     foreach ( Silanis.ESL.API.Translation tran in apiCustomField.Translations ) {
         result.WithTranslation( TranslationBuilder.NewTranslation( tran ) );
     }
     return result;
 }
Пример #2
0
        internal static CustomFieldBuilder CustomField(Silanis.ESL.API.CustomField apiCustomField)
        {
            CustomFieldBuilder result = new CustomFieldBuilder();

            result.WithId(apiCustomField.Id)
            .WithDefaultValue(apiCustomField.Value);

            foreach (Silanis.ESL.API.Translation tran in apiCustomField.Translations)
            {
                result.WithTranslation(TranslationBuilder.NewTranslation(tran));
            }
            return(result);
        }
Пример #3
0
		public Silanis.ESL.SDK.CustomField ToSDKCustomField()
		{
			if (apiCustomField == null)
			{
				return sdkCustomField;
			}

			CustomFieldBuilder result = new CustomFieldBuilder();
			result.WithId(apiCustomField.Id)
				.WithDefaultValue(apiCustomField.Value)
				.IsRequired(apiCustomField.Required.Value);

			foreach(Silanis.ESL.API.Translation translation in apiCustomField.Translations)
			{
				result.WithTranslation(TranslationBuilder.NewTranslation(translation));
			}

			return result.Build();
		}