Added initial file system bookmark
This commit is contained in:
parent
0c3d866d45
commit
813e6f09f3
|
|
@ -0,0 +1,23 @@
|
|||
using Elsa.Bookmarks;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Elsa.Activities.File.Bookmarks
|
||||
{
|
||||
public record FileSystemChangedBookmark(WatcherChangeTypes ChangeType, string Directory) : IBookmark
|
||||
{ }
|
||||
|
||||
public class FileSystemChangedBookmarkProvider : BookmarkProvider<FileSystemChangedBookmark, WatchDirectory>
|
||||
{
|
||||
public override async ValueTask<IEnumerable<IBookmark>> GetBookmarksAsync(BookmarkProviderContext<WatchDirectory> context, CancellationToken cancellationToken) => new[]
|
||||
{
|
||||
new FileSystemChangedBookmark(
|
||||
ChangeType: await context.Activity.GetPropertyValueAsync(x => x.ChangeType),
|
||||
Directory: await context.Activity.GetPropertyValueAsync(x => x.Directory))
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue