forked from PeterWaher/IoTGateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUPnPArgument.cs
More file actions
94 lines (80 loc) · 1.78 KB
/
UPnPArgument.cs
File metadata and controls
94 lines (80 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace Waher.Networking.UPnP
{
/// <summary>
/// Direction of action arguments.
/// </summary>
public enum ArgumentDirection
{
/// <summary>
/// Input variable
/// </summary>
In,
/// <summary>
/// Output variable
/// </summary>
Out
}
/// <summary>
/// Contains information about an argument.
/// </summary>
public class UPnPArgument
{
private XmlElement xml;
private string name;
private ArgumentDirection direction;
private bool returnValue;
private string relatedStateVariable;
internal UPnPArgument(XmlElement Xml)
{
this.xml = Xml;
foreach (XmlNode N in Xml.ChildNodes)
{
switch (N.LocalName)
{
case "name":
this.name = N.InnerText;
break;
case "direction":
if (N.InnerText.ToLower() == "out")
this.direction = ArgumentDirection.Out;
else
this.direction = ArgumentDirection.In;
break;
case "retval":
this.returnValue = true;
break;
case "relatedStateVariable":
this.relatedStateVariable = N.InnerText;
break;
}
}
}
/// <summary>
/// Underlying XML definition.
/// </summary>
public XmlElement Xml
{
get { return this.xml; }
}
/// <summary>
/// Argument Name
/// </summary>
public string Name { get { return this.name; } }
/// <summary>
/// Argument Direction
/// </summary>
public ArgumentDirection Direction { get { return this.direction; } }
/// <summary>
/// If the argument is the return value
/// </summary>
public bool ReturnValue { get { return this.returnValue; } }
/// <summary>
/// Related State Variable
/// </summary>
public string RelatedStateVariable { get { return this.relatedStateVariable; } }
}
}