internal async Task <FileListEntryImpl> ConvertToImageFileAsync(FileListEntryImpl file, string format, int maxWidth, int maxHeight)
        {
            FileListEntryImpl imageFile = await JSRuntime.BlazorInputFile_ToImageFile(inputFileElement, file.Id, format, maxWidth, maxHeight);

            // So that method invocations on the file can be dispatched back here
            imageFile.Owner = (FormInputFile)(object)this;

            return(imageFile);
        }
 public FileList(FileListEntryImpl file)
 {
     Id           = file.Id;
     Name         = file.Name;
     RelativePath = file.RelativePath;
 }
Beispiel #3
0
 public RemoteFileListEntryStream(IJSRuntime jsRuntime, ElementReference inputFileElement, FileListEntryImpl file, int maxMessageSize, int maxBufferSize)
     : base(jsRuntime, inputFileElement, file)
 {
     _maxMessageSize = maxMessageSize;
     _blockSequence  = new PreFetchingSequence <Block>(
         FetchBase64Block,
         (file.Size + _maxMessageSize - 1) / _maxMessageSize,
         Math.Max(1, maxBufferSize / _maxMessageSize)); // Degree of parallelism on fetch
     _currentBlockDecodingBuffer = new byte[_maxMessageSize];
 }
 public SharedMemoryFileListEntryStream(IJSRuntime jsRuntime, ElementReference inputFileElement, FileListEntryImpl file)
     : base(jsRuntime, inputFileElement, file)
 {
 }
Beispiel #5
0
 public FileListEntryStream(IJSRuntime jsRuntime, ElementReference inputFileElement, FileListEntryImpl file)
 {
     _jsRuntime        = jsRuntime;
     _inputFileElement = inputFileElement;
     _file             = file;
 }
 internal Stream OpenFileStream(FileListEntryImpl file)
 {
     return(SharedMemoryFileListEntryStream.IsSupported(JSRuntime)
                         ? (Stream) new SharedMemoryFileListEntryStream(JSRuntime, inputFileElement, file)
                         : new RemoteFileListEntryStream(JSRuntime, inputFileElement, file, MaxMessageSize, MaxBufferSize));
 }