Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DefaultHttpResponseHeader.cs
1using System.Collections.Generic;
2using System.Threading.Tasks;
4using Waher.Things;
7
9{
14 {
19 : base(null, null)
20 {
21 this.Name = string.Empty;
22 this.Value = string.Empty;
23 }
24
33 : base(Source, Parent)
34 {
35 this.Name = Name;
36 this.Value = Value;
37 }
38
42 [Page(7, "Configuration")]
43 [Header(110, "Name:")]
44 [ToolTip(111, "HTTP Header Name.")]
45 [Required]
46 public string Name { get; set; }
47
51 [Page(7, "Configuration")]
52 [Header(112, "Value:")]
53 [ToolTip(113, "HTTP Header Value.")]
54 [Text(TextPosition.AfterField, 63, "Note: Changes will take effect after broker has been restarted.")]
55 [Required]
56 public string Value { get; set; }
57
61 public override string NodeId => this.Name;
62
67 public override Task<string> GetTypeNameAsync(Language Language) => Language.GetStringAsync(typeof(GatewayConfigSource), 114, "Default HTTP Header");
68
74 public override Task<bool> AcceptsParentAsync(INode Parent)
75 {
76 return Task.FromResult(Parent is WebServer || Parent is FileFolder);
77 }
78
85 public override async Task<IEnumerable<Parameter>> GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
86 {
87 LinkedList<Parameter> Parameters = new LinkedList<Parameter>();
89
90 Parameters.AddLast(new StringParameter("Name", await Namespace.GetStringAsync(115, "Name"), this.Name));
91 Parameters.AddLast(new StringParameter("Value", await Namespace.GetStringAsync(116, "Value"), this.Value));
92
93 return Parameters;
94 }
95 }
96}
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
async Task< Namespace > GetNamespaceAsync(string Name)
Gets the namespace object, given its name, if available.
Definition: Language.cs:99
Contains information about a namespace in a language.
Definition: Namespace.cs:17
Task< LanguageString > GetStringAsync(int Id)
Gets the string object, given its ID, if available.
Definition: Namespace.cs:65
Abstract base class for gateway configuration nodes.
virtual INode Parent
Parent Node, or null if a root node.
GatewayConfigSource Source
Source hosting the node.
override Task< string > GetTypeNameAsync(Language Language)
Gets the type name of the node.
override async Task< IEnumerable< Parameter > > GetDisplayableParametersAsync(Language Language, RequestOrigin Caller)
Gets displayable parameters.
DefaultHttpResponseHeader(GatewayConfigSource Source, ConfigurationNode Parent, string Name, string Value)
References a port number.
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...
Tokens available in request.
Definition: RequestOrigin.cs:9
Interface for nodes that are published through the concentrator interface.
Definition: INode.cs:49
TextPosition
Where the instructions are to be place.
Definition: TextAttribute.cs:9