OneDrive/Extensions/ItemExtensionMethods.cs
/// <summary>
/// Returns the default thumbnail for a particular size
/// </summary>
/// <param name="item"></param>
/// <param name="connnection"></param>
/// <param name="size"></param>
/// <returns></returns>
Returns the default thumbnail for a particular size
Returns the default thumbnail for a particular size
public static async Task<ODThumbnail> GetDefaultThumbnailUrlAsync(this ODItem item, ODConnection connnection, string size)
        {
            if (item.Thumbnails == null)
            {
                item.Thumbnails = await connnection.GetThumbnailsForItemAsync(item.ItemReference(), ThumbnailRetrievalOptions.Default);
            }
            if (null != item.Thumbnails && item.Thumbnails.Length > 0)
            {
                return item.Thumbnails[0].ThumbnailForSize(size);
            }
            return null;
        }
public static async Task < ODThumbnail > GetDefaultThumbnailUrlAsync ( this ODItem item , ODConnection connnection , string size ) { if ( item . Thumbnails == null ) { item . Thumbnails = await connnection . GetThumbnailsForItemAsync ( item . ItemReference ( ) , ThumbnailRetrievalOptions . Default ) ; } if ( null != item . Thumbnails && item . Thumbnails . Length > 0 ) { return item . Thumbnails [ 0 ] . ThumbnailForSize ( size ) ; } return null ; }
Returns the default thumbnail for a particular size
Returns the default thumbnail for a particular size
// Item wasn't loaded with thumbnails, so do that now
None
ODItem
this
connnection
ODConnection
None
size
string
None
item
None