Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
FileNode.cs
1using System.Threading.Tasks;
3using Waher.Script;
6
7namespace Waher.Things.Files
8{
13 {
17 public FileNode()
18 {
19 }
20
24 [Page(2, "File System", 100)]
25 [Header(13, "File:")]
26 [ToolTip(14, "Full path to file (on host).")]
27 [Text(TextPosition.AfterField, 19, "The file path can be accessible in the FileName variable from associated script.")]
28 public string FolderPath { get; set; }
29
33 public override string LocalId => FolderNode.GetLocalName(this.FolderPath);
34
40 public override Task<string> GetTypeNameAsync(Language Language)
41 {
42 return Language.GetStringAsync(typeof(FolderNode), 15, "File reference");
43 }
44
50 public override Task<bool> AcceptsChildAsync(INode Child)
51 {
52 return Task.FromResult(false);
53 }
54
60 public override Task<bool> AcceptsParentAsync(INode Parent)
61 {
62 return Task.FromResult(Parent is FolderNode || Parent is SubFolderNode);
63 }
64
70 {
71 Variables["FileName"] = this.FolderPath;
72
73 base.PopulateVariables(Variables);
74 }
75
76 }
77}
Contains information about a language.
Definition: Language.cs:17
Task< string > GetStringAsync(Type Type, int Id, string Default)
Gets the string value of a string ID. If no such string exists, a string is created with the default ...
Definition: Language.cs:209
Collection of variables.
Definition: Variables.cs:25
Represents a file in the file system.
Definition: FileNode.cs:13
override string LocalId
If provided, an ID for the node, but unique locally between siblings. Can be null,...
Definition: FileNode.cs:33
FileNode()
Represents a file in the file system.
Definition: FileNode.cs:17
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
Definition: FileNode.cs:40
string FolderPath
Full path to folder.
Definition: FileNode.cs:28
override void PopulateVariables(Variables Variables)
Populates a variable collection with variables before script execution.
Definition: FileNode.cs:69
override Task< bool > AcceptsParentAsync(INode Parent)
If the node accepts a presumptive parent, i.e. can be added to that parent (if that parent accepts th...
Definition: FileNode.cs:60
override Task< bool > AcceptsChildAsync(INode Child)
If the node accepts a presumptive child, i.e. can receive as a child (if that child accepts the node ...
Definition: FileNode.cs:50
Represents a file folder in the file system.
Definition: FolderNode.cs:44
Represents a subfolder in the file system.
Node referencing a script node.
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49
INode Parent
Parent Node, or null if a root node.
Definition: INode.cs:116
TextPosition
Where the instructions are to be place.
Definition: TextAttribute.cs:9