Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
McpParameterAttribute.cs
1using System;
4
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
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}
Contains a markdown document. This markdown document class supports original markdown,...
static string Encode(string s)
Encodes all special characters in a string so that it can be included in a markdown document without ...
virtual void Annotate(Dictionary< string, object?> Schema)
Annotates a schema object with information in the attribute.
virtual void GetHtmlInputAttributes(Dictionary< string, string > Attributes)
Gets HTML input attributes for the parameter, if any.
virtual string AnnotatedDescription
Annotated description of parameter.
virtual string GetHtmlAttributeValue(object Value)
Gets the HTML attribute value for a parameter, if any.
McpParameterAttribute(string? Title, string? Description)
Provides meta-data about a parameter.