Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
McpParameterAttribute.cs
1
using
System
;
2
using
System.Collections.Generic
;
3
using
Waher.Content.Markdown
;
4
5
namespace
Waher.Networking.HTTP.Mcp.Model.Attributes
6
{
10
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue |
11
AttributeTargets.Property | AttributeTargets.Field,
12
Inherited =
true
, AllowMultiple =
false
)]
13
public
class
McpParameterAttribute
: Attribute
14
{
20
public
McpParameterAttribute
(
string
?
Title
,
string
?
Description
)
21
{
22
this.Title =
Title
;
23
this.Description =
Description
;
24
}
25
29
public
string
?
Title
{
get
; }
30
34
public
string
?
Description
{
get
; }
35
40
public
virtual
void
Annotate
(Dictionary<string, object?> Schema)
41
{
42
if
(!
string
.IsNullOrEmpty(this.
Title
))
43
Schema[
"title"
] = this.
Title
;
44
45
if
(!
string
.IsNullOrEmpty(this.
Description
))
46
Schema[
"description"
] = this.
Description
;
47
}
48
52
public
virtual
string
AnnotatedDescription
=>
MarkdownDocument
.
Encode
(
53
this.
Description
?? this.
Title
??
string
.Empty);
54
59
public
virtual
void
GetHtmlInputAttributes
(Dictionary<string, string> Attributes)
60
{
61
if
(!
string
.IsNullOrEmpty(this.
Description
))
62
Attributes[
"title"
] = this.
Description
;
63
}
64
70
public
virtual
string
GetHtmlAttributeValue
(
object
Value)
71
{
72
return
Value?.ToString() ??
string
.Empty;
73
}
74
}
75
}
Waher.Content.Markdown.MarkdownDocument
Contains a markdown document. This markdown document class supports original markdown,...
Definition:
MarkdownDocument.cs:52
Waher.Content.Markdown.MarkdownDocument.Encode
static string Encode(string s)
Encodes all special characters in a string so that it can be included in a markdown document without ...
Definition:
MarkdownDocument.cs:5926
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute
Provides meta-data about a parameter.
Definition:
McpParameterAttribute.cs:14
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.Annotate
virtual void Annotate(Dictionary< string, object?> Schema)
Annotates a schema object with information in the attribute.
Definition:
McpParameterAttribute.cs:40
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.Title
string? Title
Title of parameter.
Definition:
McpParameterAttribute.cs:29
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.GetHtmlInputAttributes
virtual void GetHtmlInputAttributes(Dictionary< string, string > Attributes)
Gets HTML input attributes for the parameter, if any.
Definition:
McpParameterAttribute.cs:59
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.Description
string? Description
Description of parameter.
Definition:
McpParameterAttribute.cs:34
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.AnnotatedDescription
virtual string AnnotatedDescription
Annotated description of parameter.
Definition:
McpParameterAttribute.cs:52
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.GetHtmlAttributeValue
virtual string GetHtmlAttributeValue(object Value)
Gets the HTML attribute value for a parameter, if any.
Definition:
McpParameterAttribute.cs:70
Waher.Networking.HTTP.Mcp.Model.Attributes.McpParameterAttribute.McpParameterAttribute
McpParameterAttribute(string? Title, string? Description)
Provides meta-data about a parameter.
Definition:
McpParameterAttribute.cs:20
System.Collections.Generic
Definition:
ImplTypes.g.cs:4970
System
Definition:
Adapters.g.cs:58
Waher.Content.Markdown
Definition:
ConsolidatedTable.cs:11
Waher.Networking.HTTP.Mcp.Model.Attributes
Definition:
McpDateParameterAttribute.cs:6
IoTGateway
Networking
Waher.Networking.HTTP.Mcp
Model
Attributes
McpParameterAttribute.cs
Generated by
1.9.5