コード例 #1
0
        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);
        }
コード例 #2
0
 public FileList(FileListEntryImpl file)
 {
     Id           = file.Id;
     Name         = file.Name;
     RelativePath = file.RelativePath;
 }
コード例 #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];
 }
コード例 #4
0
 public SharedMemoryFileListEntryStream(IJSRuntime jsRuntime, ElementReference inputFileElement, FileListEntryImpl file)
     : base(jsRuntime, inputFileElement, file)
 {
 }
コード例 #5
0
 public FileListEntryStream(IJSRuntime jsRuntime, ElementReference inputFileElement, FileListEntryImpl file)
 {
     _jsRuntime        = jsRuntime;
     _inputFileElement = inputFileElement;
     _file             = file;
 }
コード例 #6
0
 internal Stream OpenFileStream(FileListEntryImpl file)
 {
     return(SharedMemoryFileListEntryStream.IsSupported(JSRuntime)
                         ? (Stream) new SharedMemoryFileListEntryStream(JSRuntime, inputFileElement, file)
                         : new RemoteFileListEntryStream(JSRuntime, inputFileElement, file, MaxMessageSize, MaxBufferSize));
 }