Wolfringo Wolfringo
Wolfringo Wolfringo
Wolfringo (c) 2020 TehGM
DocFX, DiscordFX theme.
Search Results for

    Class AvatarUtilities

    Utilities for getting avatar.

    Inheritance
    System.Object
    AvatarUtilities
    Namespace: TehGM.Wolfringo.Utilities
    Assembly: Wolfringo.Utilities.dll
    Syntax
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static class AvatarUtilities

    Methods

    | Improve this Doc View Source

    DownloadAvatarAsync(WolfGroup, HttpClient, UInt32, CancellationToken)

    Downloads bytes of group avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static Task<byte[]> DownloadAvatarAsync(this WolfGroup group, HttpClient client, uint size = 500U, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WolfGroup group

    Group to download avatar of.

    System.Net.Http.HttpClient client

    Http Client to request avatar bytes with.

    System.UInt32 size

    Size of the avatar to request.

    System.Threading.CancellationToken cancellationToken

    Token to cancel the request.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    Bytes of group avatar. Null if group of avatar not found.

    | Improve this Doc View Source

    DownloadAvatarAsync(WolfGroup, UInt32, CancellationToken)

    Downloads bytes of group avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static async Task<byte[]> DownloadAvatarAsync(this WolfGroup group, uint size = 500U, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WolfGroup group

    Group to download avatar of.

    System.UInt32 size

    Size of the avatar to request.

    System.Threading.CancellationToken cancellationToken

    Token to cancel the request.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    Bytes of group avatar. Null if group of avatar not found.

    Remarks

    This method creates a temporary HttpClient just for the request. This might be performance heavy, and therefore it's recommended to provide your own client from own cache, or using a client factory.

    | Improve this Doc View Source

    DownloadAvatarAsync(WolfUser, HttpClient, UInt32, CancellationToken)

    Downloads bytes of user avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static Task<byte[]> DownloadAvatarAsync(this WolfUser user, HttpClient client, uint size = 500U, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WolfUser user

    User to download avatar of.

    System.Net.Http.HttpClient client

    Http Client to request avatar bytes with.

    System.UInt32 size

    Size of the avatar to request.

    System.Threading.CancellationToken cancellationToken

    Token to cancel the request.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    Bytes of user avatar. Null if user of avatar not found.

    | Improve this Doc View Source

    DownloadAvatarAsync(WolfUser, UInt32, CancellationToken)

    Downloads bytes of user avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static async Task<byte[]> DownloadAvatarAsync(this WolfUser user, uint size = 500U, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    WolfUser user

    User to download avatar of.

    System.UInt32 size

    Size of the avatar to request.

    System.Threading.CancellationToken cancellationToken

    Token to cancel the request.

    Returns
    Type Description
    System.Threading.Tasks.Task<System.Byte[]>

    Bytes of user avatar. Null if user of avatar not found.

    Remarks

    This method creates a temporary HttpClient just for the request. This might be performance heavy, and therefore it's recommended to provide your own client from own cache, or using a client factory.

    | Improve this Doc View Source

    GetAvatarURL(WolfGroup, UInt32)

    Gets URL for retrieving group avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static string GetAvatarURL(this WolfGroup group, uint size = 500U)
    Parameters
    Type Name Description
    WolfGroup group

    Group to get avatar URL for.

    System.UInt32 size

    Size of the avatar to retrieve.

    Returns
    Type Description
    System.String

    URL to group's avatar.

    Remarks

    This method will return URL to group avatar. You can use this URL with System.Net.Http.HttpClient to download the avatar, or use for any other purpose.

    size is only a requested size of the avatar. It is not guaranteed that URL will contain avatar with this size.

    | Improve this Doc View Source

    GetAvatarURL(WolfUser, UInt32)

    Gets URL for retrieving user avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static string GetAvatarURL(this WolfUser user, uint size = 500U)
    Parameters
    Type Name Description
    WolfUser user

    User to get avatar URL for.

    System.UInt32 size

    Size of the avatar to retrieve.

    Returns
    Type Description
    System.String

    URL to user's avatar.

    Remarks

    This method will return URL to user avatar. You can use this URL with System.Net.Http.HttpClient to download the avatar, or use for any other purpose.

    size is only a requested size of the avatar. It is not guaranteed that URL will contain avatar with this size.

    | Improve this Doc View Source

    GetGroupAvatarURL(UInt32, Nullable<Int32>, UInt32)

    Gets URL for retrieving group avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static string GetGroupAvatarURL(uint groupID, int? iconID = null, uint size = 500U)
    Parameters
    Type Name Description
    System.UInt32 groupID

    ID of the group.

    System.Nullable<System.Int32> iconID

    Icon ID

    System.UInt32 size

    Size of the avatar to retrieve.

    Returns
    Type Description
    System.String

    URL to group's avatar.

    Remarks

    This method will return URL to group avatar. You can use this URL with System.Net.Http.HttpClient to download the avatar, or use for any other purpose.

    size is only a requested size of the avatar. It is not guaranteed that URL will contain avatar with this size.

    Currently, changing iconID to an invalid value seems to not cause error when the URL is used. However it is not guaranteed to always be the case, so a valid WolfGroup.Icon value is recommended.

    | Improve this Doc View Source

    GetUserAvatarURL(UInt32, Nullable<Int32>, UInt32)

    Gets URL for retrieving user avatar.

    Declaration
    [Obsolete("Current implementation returns old, unsupported URLs. This class will be redesigned in an upcoming update.")]
    public static string GetUserAvatarURL(uint userID, int? iconID = null, uint size = 500U)
    Parameters
    Type Name Description
    System.UInt32 userID

    ID of the user.

    System.Nullable<System.Int32> iconID

    Icon ID

    System.UInt32 size

    Size of the avatar to retrieve.

    Returns
    Type Description
    System.String

    URL to user's avatar.

    Remarks

    This method will return URL to user avatar. You can use this URL with System.Net.Http.HttpClient to download the avatar, or use for any other purpose.

    size is only a requested size of the avatar. It is not guaranteed that URL will contain avatar with this size.

    Currently, changing iconID to an invalid value seems to not cause error when the URL is used. However it is not guaranteed to always be the case, so a valid WolfUser.Icon value is recommended.