ConvertResult <ICollection <string> > IConverter <ItemModel, ICollection <string> > .Convert(ItemModel source)
        {
            if (!base.IsSupportedItem(source))
            {
                return(ConvertResult <ICollection <string> > .NegativeResult(this.FormatMessageForNegativeResult(source, "The source item is not supported by this converter.", Array.Empty <string>())));
            }

            var stringSet = new HashSet <string>();

            var childItemModels = this.GetChildItemModels(source);

            if (childItemModels != null)
            {
                foreach (var itemModel in childItemModels)
                {
                    var path = this.GetStringValue(itemModel, TokenValueAccessorItemModel.PathExpression);
                    if (!string.IsNullOrWhiteSpace(path) && this.GetBoolValue(itemModel, CommonItemModel.Enabled))
                    {
                        stringSet.Add(path);
                    }
                }
            }

            return(ConvertResult <ICollection <string> > .PositiveResult(stringSet));
        }
 protected override ConvertResult <CustomMappingSet> ConvertSupportedItem(ItemModel source)
 {
     return(ConvertResult <CustomMappingSet> .PositiveResult(_instance));
 }
Beispiel #3
0
 protected override ConvertResult <Endpoint> ConvertSupportedItem(ItemModel source)
 {
     return(ConvertResult <Endpoint> .PositiveResult(EndpointConverter.Endpoint));
 }