WIP Image imports and file access
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public record Activated
|
||||
{
|
||||
|
||||
@@ -7,4 +7,4 @@ public record Delete
|
||||
|
||||
public static DeleteEventArgs<TSender> As<TSender>() where TSender : new() =>
|
||||
new(new TSender());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public interface IFileProvider
|
||||
{
|
||||
Task<IReadOnlyCollection<string>> SelectFiles(FileFilter filter);
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public interface IFileSelector
|
||||
{
|
||||
Task<IEnumerable<string>> SelectFiles(FileFilter filter);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public static class IHostBuilderExtension
|
||||
IFileInfo? fileInfo = null;
|
||||
if (provider.GetService<IHostEnvironment>() is IHostEnvironment hostEnvironment)
|
||||
{
|
||||
IFileProvider fileProvider = hostEnvironment.ContentRootFileProvider;
|
||||
Microsoft.Extensions.FileProviders.IFileProvider fileProvider = hostEnvironment.ContentRootFileProvider;
|
||||
fileInfo = fileProvider.GetFileInfo(path);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public interface IImageDescriptor
|
||||
{
|
||||
public object Image { get; }
|
||||
|
||||
public int Width { get; }
|
||||
|
||||
public int Height { get; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public interface IImageProvider
|
||||
{
|
||||
Task<IImageDescriptor> Get(string filePath,
|
||||
int width,
|
||||
int height,
|
||||
bool maintainAspectRatio = false);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public record ImageDescriptor(object Image, int Width, int Height) :
|
||||
IImageDescriptor;
|
||||
@@ -1,3 +1,3 @@
|
||||
namespace Toolkit.Foundation;
|
||||
|
||||
public record RequestEventArgs<TValue>(TValue? Value = default);
|
||||
public record RequestEventArgs<TSender>(TSender? Sender = default);
|
||||
|
||||
Reference in New Issue
Block a user