public static StringBuilder AppendRequest(this StringBuilder stringBuilder, XpoImageUrlRequest request) { var americanCulture = new CultureInfo("en-US"); stringBuilder .Append(EntityName, HttpUtility.UrlEncode(request.PrimaryKey)) .Append(Width, request.Width) .Append(BackgroundColor, request.BackgroundColor) .Append(Caching, request.Caching) .Append(Debug, request.Debug) .Append(Height, request.Height) .Append(DesignCaching, request.DesignCaching) .Append(ResizeMethod, request.ResizeMethod) .Append(OutputQuality, ConvertNumberToCultureNumber(request.OutputQuality, americanCulture)) .Append(ImageType, request.ImageType) .Append(IsEntity, request.IsEntity) .Append(TransparencyColor, request.TransparencyColor) .Append(SceneThumbnailObjectNumber, request.SceneThumbnailObjectNumber) .Append(HighlightObject, request.HighlightObject) .Append(AllColor, request.AllColor) .Append(PrefillCaching, request.PrefillCaching) .Append(SessionId, request.SessionId) .Append(Overlays, request.Overlays.OrderBy(x => x.Index).Select(x => x.OverlayName).ToArray().Join(",")) .Append(TemplateName, request.TemplateName) .AppendDictionary(request.CustomParameters); foreach (var templateParameter in request.TemplateParameters) { stringBuilder.Append(templateParameter.Index, TemeplateParameter, templateParameter.Value); } return(stringBuilder); }
public static StringBuilder AppendRequest(this StringBuilder stringBuilder, XpoImageUrlRequest request) { var americanCulture = new CultureInfo("en-US"); stringBuilder .Append(EntityName, HttpUtility.UrlEncode(request.PrimaryKey)) .Append(Width, request.Width) .Append(BackgroundColor, request.BackgroundColor) .Append(Caching, request.Caching) .Append(Debug, request.Debug) .Append(Height, request.Height) .Append(DesignCaching, request.DesignCaching) .Append(ResizeMethod, request.ResizeMethod) .Append(OutputQuality, ConvertNumberToCultureNumber(request.OutputQuality, americanCulture)) .Append(ImageType, request.ImageType) .Append(IsEntity, request.IsEntity) .Append(TransparencyColor, request.TransparencyColor) .Append(SceneThumbnailObjectNumber, request.SceneThumbnailObjectNumber) .Append(HighlightObject, request.HighlightObject) .Append(AllColor, request.AllColor) .Append(PrefillCaching, request.PrefillCaching) .Append(SessionId, request.SessionId) .Append(Overlays, request.Overlays.OrderBy(x => x.Index).Select(x => x.OverlayName).ToArray().Join(",")) .Append(TemplateName, request.TemplateName) .AppendDictionary(request.CustomParameters); foreach (var templateParameter in request.TemplateParameters) { stringBuilder.Append(templateParameter.Index, TemeplateParameter, templateParameter.Value); } return stringBuilder; }
public string GetUrl(XpoImageUrlRequest request) { var baseUri = GetXpoBaseUrl(request); var stringBuilder = new StringBuilder(baseUri); stringBuilder .Append(request.PrimaryKey) .AppendRequest(request) .AppendColors(request.Objects.Where(x => x.Color != null)) .AppendDesigns(request.Objects.Where(x => x.Design != null)) .AppendTexts(request.Objects.Where(x => x.Text != null)) .AppendOverlays(request.Overlays); return(stringBuilder.ToString()); }
public XpoUrlParts GetUrlParts(XpoImageUrlRequest request) { var baseUri = GetXpoBaseUrl(request); if (baseUri == "/") { baseUri = ""; } var stringBuilder = new StringBuilder(baseUri); stringBuilder .AppendRequest(request) .AppendColors(request.Objects.Where(x => x.Color != null)) .AppendDesigns(request.Objects.Where(x => x.Design != null)) .AppendTexts(request.Objects.Where(x => x.Text != null)) .AppendOverlays(request.Overlays); return(new XpoUrlParts(request.PrimaryKey, stringBuilder.ToString())); }
public string GetUrl(XpoImageUrlRequest request) { var baseUri = GetXpoImageUrl(request); var stringBuilder = new StringBuilder(baseUri); stringBuilder .AppendFormat("{0}={1}", GeneralKeys.EntityType, (int)request.FileType) .AppendRequest(request); foreach (var xpoUrlObject in request.Objects) { var index = xpoUrlObject.Index; stringBuilder .Append(index, xpoUrlObject.Design) .Append(index, xpoUrlObject.Color) .Append(index, xpoUrlObject.Text); } return stringBuilder.ToString(); }
public string GetUrl(XpoImageUrlRequest request) { var baseUri = GetXpoImageUrl(request); var stringBuilder = new StringBuilder(baseUri); stringBuilder .AppendFormat("{0}={1}", GeneralKeys.EntityType, (int)request.FileType) .AppendRequest(request); foreach (var xpoUrlObject in request.Objects) { var index = xpoUrlObject.Index; stringBuilder .Append(index, xpoUrlObject.Design) .Append(index, xpoUrlObject.Color) .Append(index, xpoUrlObject.Text); } return(stringBuilder.ToString()); }
private string GetXpoImageUrl(XpoImageUrlRequest imageRequest) { return(EnsureXpoImageUrl(GetXpoBaseUrl(imageRequest))); }
public XpoUrlParts GetUrlParts(XpoImageUrlRequest request) { throw new NotImplementedException("Cannot get URL parts for the XPO V1 implementation"); }
private string GetXpoImageUrl(XpoImageUrlRequest imageRequest) { return EnsureXpoImageUrl(GetXpoBaseUrl(imageRequest)); }