Пример #1
0
 public override int GetAvatarId(ImageList avatarImageList)
 {
     if (AvatarId.HasValue) return AvatarId.Value;
     var gravatarService = new GravatarService();
     if (!string.IsNullOrEmpty(AvatarImageName)) 
         return gravatarService.LoadAvatarFromFile(AvatarImageName, avatarImageList);
     return gravatarService.DownloadGravatarFromEmailAndAddToImageList(Email, avatarImageList);
 }
Пример #2
0
        private int GetAvatarId(NewSosOnlineNotificationArgs args, ImageList avatarImageList)
        {
            var gravatarService = new GravatarService();
            int avatarId;

            try
            {
                avatarId = gravatarService.DownloadImageFromWebAndAddToImageList(args.ImageUrl, avatarImageList);
            } catch (Exception ex)
            {
                _log.Error("Error retrieving gravatar for " + args.DisplayName, ex);
                avatarId = SirenOfShameSettings.GenericSosOnlineAvatarId;
            }
            return(avatarId);
        }
Пример #3
0
 private int GetAvatarId(NewSosOnlineNotificationArgs args, ImageList avatarImageList)
 {
     var gravatarService = new GravatarService();
     int avatarId;
     try
     {
         avatarId = gravatarService.DownloadImageFromWebAndAddToImageList(args.ImageUrl, avatarImageList);
     } catch (Exception ex)
     {
         _log.Error("Error retrieving gravatar for " + args.DisplayName, ex);
         avatarId = SirenOfShameSettings.GenericSosOnlineAvatarId;
     }
     return avatarId;
 }
Пример #4
0
        private void PreviewButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(emailTextbox.Text)) return;

            var gravatarService = new GravatarService();
            var avatarId = gravatarService.DownloadGravatarFromEmailAndAddToImageList(emailTextbox.Text, _avatarImageList);
            _gravatar.SetImage(avatarId, _avatarImageList);
        }