1 | #Region "Microsoft.VisualBasic::c5bfdb761234128d2e3e414b308dbf11, Microsoft.VisualBasic.Core\ApplicationServices\VBDev\XmlDoc\Serialization\Models\Member.vb" |
2 | |
3 | ' Author: |
4 | ' |
5 | ' asuka (amethyst.asuka@gcmodeller.org) |
6 | ' xie (genetics@smrucc.org) |
7 | ' xieguigang (xie.guigang@live.com) |
8 | ' |
9 | ' Copyright (c) 2018 GPL3 Licensed |
10 | ' |
11 | ' |
12 | ' GNU GENERAL PUBLIC LICENSE (GPL3) |
13 | ' |
14 | ' |
15 | ' This program is free software: you can redistribute it and/or modify |
16 | ' it under the terms of the GNU General Public License as published by |
17 | ' the Free Software Foundation, either version 3 of the License, or |
18 | ' (at your option) any later version. |
19 | ' |
20 | ' This program is distributed in the hope that it will be useful, |
21 | ' but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 | ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23 | ' GNU General Public License for more details. |
24 | ' |
25 | ' You should have received a copy of the GNU General Public License |
26 | ' along with this program. If not, see <http://www.gnu.org/licenses/>. |
27 | |
28 | |
29 | |
30 | ' /********************************************************************************/ |
31 | |
32 | ' Summaries: |
33 | |
34 | ' Class member |
35 | ' |
36 | ' Properties: memberRef, name, param, remarks, returns |
37 | ' summary, typeparam |
38 | ' |
39 | ' Function: ToString |
40 | ' |
41 | ' Structure memberName |
42 | ' |
43 | ' Properties: Name, Type |
44 | ' |
45 | ' Function: RefParser, ToString |
46 | ' |
47 | ' Enum memberTypes |
48 | ' |
49 | ' |
50 | ' |
51 | ' |
52 | ' |
53 | ' |
54 | ' Class param |
55 | ' |
56 | ' Properties: name, text |
57 | ' |
58 | ' Function: ToString |
59 | ' |
60 | ' Class typeparam |
61 | ' |
62 | ' |
63 | ' |
64 | ' Structure CrossReferred |
65 | ' |
66 | ' Properties: cref |
67 | ' |
68 | ' |
69 | ' /********************************************************************************/ |
70 | |
71 | #End Region |
72 | |
73 | Imports System.ComponentModel |
74 | Imports System.Xml.Serialization |
75 | Imports Microsoft.VisualBasic.Serialization.JSON |
76 | |
77 | Namespace ApplicationServices.Development.XmlDoc.Serialization |
78 | |
79 | Public Class member : Implements IMember |
80 | |
81 | <XmlAttribute> Public Property name As String Implements IMember.name |
82 | Get |
83 | Return _name |
84 | End Get |
85 | Set(value As String) |
86 | _name = value |
87 | _memberRef = memberName.RefParser(value) |
88 | End Set |
89 | End Property |
90 | Public Property summary As String |
91 | Public Property typeparam As typeparam |
92 | Public Property param As param() |
93 | Public Property returns As String |
94 | Public Property remarks As String |
95 | |
96 | Dim _name As String |
97 | |
98 | Public ReadOnly Property memberRef As memberName |
99 | |
100 | Public Overrides Function ToString() As String |
101 | Return Me.GetJson |
102 | End Function |
103 | End Class |
104 | |
105 | Public Structure memberName |
106 | |
107 | Public Property Type As memberTypes |
108 | Public Property Name As String |
109 | |
110 | Public Overrides Function ToString() As String |
111 | Return Me.GetJson |
112 | End Function |
113 | |
114 | Public Shared Function RefParser(name As String) As memberName |
115 | Dim type As Char = name.First |
116 | name = Mid(name, 3) |
117 | Return New memberName With { |
118 | .Name = name, |
119 | .Type = APIExtensions.Types(type) |
120 | } |
121 | End Function |
122 | End Structure |
123 | |
124 | Public Enum memberTypes |
125 | ''' <summary> |
126 | ''' T |
127 | ''' </summary> |
128 | <Description("T")> Type |
129 | ''' <summary> |
130 | ''' F |
131 | ''' </summary> |
132 | <Description("F")> Filed |
133 | ''' <summary> |
134 | ''' M |
135 | ''' </summary> |
136 | <Description("M")> Method |
137 | ''' <summary> |
138 | ''' P |
139 | ''' </summary> |
140 | <Description("P")> [Property] |
141 | ''' <summary> |
142 | ''' E |
143 | ''' </summary> |
144 | <Description("E")> [Event] |
145 | End Enum |
146 | |
147 | Public Class param : Implements IMember |
148 | |
149 | <XmlAttribute> Public Property name As String Implements IMember.name |
150 | <XmlText> Public Property text As String |
151 | |
152 | Public Overrides Function ToString() As String |
153 | Return $"{name} = {text}" |
154 | End Function |
155 | End Class |
156 | |
157 | Public Class typeparam : Inherits param |
158 | End Class |
159 | |
160 | Public Structure CrossReferred |
161 | <XmlAttribute> Public Property cref As String |
162 | End Structure |
163 | End Namespace |