Exemple #1
0
        public async Task DownloadFileAsync(StorageFile storageFile, string fileId)
        {
            string url    = WtFileHelper.GetS3FileUrl(fileId);
            var    buffer = await WtHttpClient.GetByteBufferAsync(url);

            await FileIO.WriteBufferAsync(storageFile, buffer);
        }
Exemple #2
0
 public static void ForShowEntity(this Entity entity)
 {
     entity.Avatar = new TethysAvatar
     {
         DisplayName = entity.CreatedBy.DisplayName,
         Background  = AvatarHelper.GetColorBrush(entity.CreatedBy.DisplayName),
         Source      = AvatarHelper.GetAvatarBitmap(entity.CreatedBy.Avatar, AvatarSize.X40, FromType.User)
     };
     entity.Icon             = WtFileHelper.GetFileIcon(entity.Addition.Ext);
     entity.IsEnableDelete   = entity.CreatedBy.Uid == DataSource.ApiUserMeData.Me.Uid;
     entity.IsEnableDownload = entity.Addition.Path != null && !(entity.Addition.Path.StartsWith("http://") || entity.Addition.Path.StartsWith("https://")) && (entity.Type == MessageType.File || entity.Type == MessageType.Image);
 }