added validation to some nodes

This commit is contained in:
reven
2021-11-24 17:55:27 +13:00
parent 962fe7959c
commit 599ee1700e
20 changed files with 24 additions and 220 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ namespace FileFlows.BasicNodes.Functions
using Jint.Native.Object;
using Jint;
using System.Text;
using System.ComponentModel.DataAnnotations;
public class Function : Node
{
@@ -15,9 +16,10 @@ namespace FileFlows.BasicNodes.Functions
public override string Icon => "fas fa-code";
[DefaultValue(1)]
[NumberIntAttribute(1)]
[NumberInt(1)]
public new int Outputs { get; set; }
[Required]
[DefaultValue("// VideoFile object contains info about the video file\n\n// return 0 to complete the flow.\n// return -1 to signal an error in the flow\n// return 1+ to indicate which output to process next\n\n return 0;")]
[Code(2)]
public string Code { get; set; }
+2
View File
@@ -7,6 +7,7 @@ namespace FileFlows.BasicNodes.Functions
using Jint.Native.Object;
using Jint;
using System.Text;
using System.ComponentModel.DataAnnotations;
public class Log : Node
{
@@ -19,6 +20,7 @@ namespace FileFlows.BasicNodes.Functions
public LogType LogType { get; set; }
[TextArea(2)]
[Required]
public string Message { get; set; }
public override int Execute(NodeParameters args)
{
+2
View File
@@ -1,6 +1,7 @@
namespace FileFlows.BasicNodes.Functions
{
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.RegularExpressions;
using FileFlows.Plugin;
using FileFlows.Plugin.Attributes;
@@ -13,6 +14,7 @@ namespace FileFlows.BasicNodes.Functions
[DefaultValue("")]
[Text(1)]
[Required]
public string Pattern { get; set; }
public override int Execute(NodeParameters args)