1 #Region "Microsoft.VisualBasic::9178b8b649c7d16a2fbbfa294c987c05, Microsoft.VisualBasic.Core\Serialization\ConfigMappings\Attributes.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 MappingsIgnored
35     
36     
37     
38     '     Class UseCustomMapping
39     
40     
41     
42     '     Structure NodeMapping
43     
44     '         FunctionToString
45     
46     
47     ' /********************************************************************************/
48
49 #End Region
50
51 Imports System.Reflection
52
53 Namespace Serialization
54
55     ''' <summary>
56     ''' 这个属性或者方法不会被用于映射
57     ''' </summary>
58     ''' <remarks></remarks>
59     <AttributeUsage(AttributeTargets.Property Or AttributeTargets.Method, AllowMultiple:=False, Inherited:=False)>
60     Public Class MappingsIgnored : Inherits Attribute
61     End Class
62
63     ''' <summary>
64     ''' 不会使用系统自带的映射方法进行映射
65     ''' </summary>
66     ''' <remarks></remarks>
67     <AttributeUsage(AttributeTargets.Property, AllowMultiple:=False, Inherited:=False)>
68     Public Class UseCustomMapping : Inherits Attribute
69     End Class
70
71     Public Structure NodeMapping
72
73         ''' <summary>
74         ''' 映射的文本文件源
75         ''' </summary>
76         ''' <remarks></remarks>
77         Dim Source As PropertyInfo
78         ''' <summary>
79         ''' 映射操作的目标数据模型
80         ''' </summary>
81         ''' <remarks></remarks>
82         Dim Mapping As PropertyInfo
83         ''' <summary>
84         ''' 从源映射到数据模型的类型转换
85         ''' </summary>
86         ''' <remarks></remarks>
87         Dim SourceToMappingCasting As IStringParser
88         ''' <summary>
89         ''' 从数据模型映射到源的类型转换
90         ''' </summary>
91         ''' <remarks></remarks>
92         Dim MappingToSourceCasting As IStringBuilder
93
94         Public Overrides Function ToString() As String
95             Return Source.Name & "   --->  " & Mapping.PropertyType.FullName
96         End Function
97     End Structure
98 End Namespace