Esempio n. 1
0
#pragma warning disable MA0102 // Make member readonly
        internal UploadOptions ToOptions(FileParameter file, AssetsClient client)
#pragma warning restore MA0102 // Make member readonly
        {
            var result = new UploadOptions
            {
                FileId = FileId
            };

            var metadata = new Dictionary <string, string>();

            if (!string.IsNullOrWhiteSpace(Id))
            {
                metadata[nameof(Id)] = Id !;
            }

            if (!string.IsNullOrWhiteSpace(ParentId))
            {
                metadata[nameof(ParentId)] = ParentId !;
            }

            if (Duplicate != null)
            {
                metadata[nameof(Duplicate)] = Duplicate.Value.ToString();
            }

            if (metadata.Count > 0)
            {
                result.Metadata = metadata;
            }

            if (ProgressHandler != null)
            {
                result.ProgressHandler = new ProgressHandlerAdapter(ProgressHandler, client);
            }

            return(result);
        }
 public ProgressHandlerAdapter(IAssetProgressHandler inner, AssetsClient client)
 {
     this.inner  = inner;
     this.client = client;
 }