Ejemplo n.º 1
0
        private Crate <StandardFileListCM> PackDropboxFileListCrate(IEnumerable <string> fileList)
        {
            var descriptionList = new List <StandardFileDescriptionCM>();

            foreach (var filePath in fileList)
            {
                var fileDesc = new StandardFileDescriptionCM()
                {
                    Filename = Path.GetFileName(filePath),
                    Filetype = Path.GetExtension(filePath)
                };
                var fileSharedUrl = _dropboxService.GetFileSharedUrl(AuthorizationToken, filePath);

                fileDesc.DirectUrl = fileSharedUrl;
                descriptionList.Add(fileDesc);
            }

            return(Crate <StandardFileListCM> .FromContent(
                       RuntimeCrateLabel,
                       new StandardFileListCM
            {
                FileList = descriptionList
            }));
        }