Ejemplo n.º 1
0
        private string Flatten(string subDir, string[] files, string mediaType, PreviewType previewType)
        {
            StringBuilder sb = new StringBuilder();

            if (previewType == PreviewType.Flash)
            {
                sb.Append("F,,");
            }
            else
            {
                sb.Append("A,,");
            }

            foreach (string file in files)
            {
                sb.Append("/ViewMedia.aspx?mediaType=");
                sb.Append(mediaType);
                sb.Append("&previewType=");
                sb.Append(previewType.ToString());
                sb.Append("&fileName=");
                sb.Append(file);
                sb.Append("&subDir=");
                sb.Append(subDir);
                sb.Append("||");
            }

            return(sb.Remove(sb.Length - 2, 2).ToString());
        }
 public string GetResourcePreviewUrl(string apiKey, ChiliResource.ResourceType resourceType, string id, PreviewType previewType)
 {
     return(GetResourceDownloadUrl(apiKey, resourceType, id, previewType.ToString()));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the preview URL.
        /// </summary>
        /// <param name="previewType">Type of the preview.</param>
        /// <param name="url">The URL.</param>
        /// <returns></returns>
        public static string GetPreviewUrl(PreviewType previewType, string url)
        {
            const string previewUrl = SkyDriveBaseUrl + SkyDriveConstants.GetItemPreview + "?type={0}&url={1}";

            return(string.Format(previewUrl, previewType.ToString().ToLower(), Uri.EscapeDataString(url)));
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the preview URL.
 /// </summary>
 /// <param name="previewType">Type of the preview.</param>
 /// <param name="url">The URL.</param>
 /// <returns></returns>
 public static string GetPreviewUrl(PreviewType previewType, string url)
 {
     const string previewUrl = SkyDriveBaseUrl + SkyDriveConstants.GetItemPreview + "?type={0}&url={1}";
     return string.Format(previewUrl, previewType.ToString().ToLower(), Uri.EscapeDataString(url));
 }