/[eiffelstudio]/branches/eth/eve/eweasel/tests/dotnet111/test1_rev1.e
ViewVC logotype

Contents of /branches/eth/eve/eweasel/tests/dotnet111/test1_rev1.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 83441 - (show annotations)
Sat Jun 5 13:52:53 2010 UTC (9 years, 7 months ago) by jasonw
File size: 3949 byte(s)
Renamed branch eve3 to eve. The eve branch serves as the new branch for the EVE project.
1 indexing
2 assembly_metadata:
3 create {DESCRIPTION_ATTRIBUTE}.make ("assembly: on assembly") end
4
5 class_metadata:
6 create {DESCRIPTION_ATTRIBUTE}.make ("on class") end
7
8 interface_metadata:
9 create {DESCRIPTION_ATTRIBUTE}.make ("on interface") end
10
11 metadata:
12 create {DESCRIPTION_ATTRIBUTE}.make ("on class and interface") end
13
14 class
15 TEST1
16
17 inherit
18 TEST2
19
20 create {TEST1}
21 default_create
22
23 create
24 make
25
26 feature {NONE} -- Initialization
27
28 make is
29 local
30 l_so: SYSTEM_OBJECT
31 l_type: SYSTEM_TYPE
32 l_type_impl: SYSTEM_TYPE
33 do
34 print ("Assembly%N")
35 -- Print assembly
36 print_descriptions ({ASSEMBLY}.get_executing_assembly)
37
38 print ("%NInterface%N")
39 -- Print interface
40 l_type := {TEST1}
41 print_descriptions (l_type)
42 print_member_descriptions (l_type.get_members)
43
44 print ("%NImplementation%N")
45 -- Print implementation
46 l_so ?= (create {TEST1})
47 l_type_impl := l_so.get_type
48 print_descriptions (l_so.get_type)
49 print_member_descriptions (l_type_impl.get_members)
50 end
51
52 print_descriptions (a_provider: ICUSTOM_ATTRIBUTE_PROVIDER)
53 -- Print descriptions
54 require
55 a_provider_attached: a_provider /= Void
56 local
57 l_attributes: NATIVE_ARRAY [SYSTEM_OBJECT]
58 l_attribute: DESCRIPTION_ATTRIBUTE
59 l_descriptions: NATIVE_ARRAY [SYSTEM_STRING]
60 l_member_info: MEMBER_INFO
61 l_type: SYSTEM_TYPE
62 l_sb: STRING_BUILDER
63 l_count, i: INTEGER
64 do
65 l_attributes := a_provider.get_custom_attributes ({DESCRIPTION_ATTRIBUTE}, False)
66 if l_attributes /= Void then
67 l_count := l_attributes.count
68
69 l_member_info ?= a_provider
70 if l_member_info /= Void then
71 l_type ?= l_member_info
72 if l_type = Void then
73 l_type := l_member_info.declaring_type
74 end
75 end
76
77 create l_descriptions.make (l_count)
78 from i :=0 until i = l_count loop
79 l_attribute ?= l_attributes.item (i)
80 create l_sb.make (100)
81 if l_member_info /= Void then
82
83 if l_type/= Void then
84 l_sb := l_sb.append (l_type.full_name)
85 end
86 l_sb := l_sb.append ("(")
87 l_sb := l_sb.append (l_member_info.name)
88 l_sb := l_sb.append ("): ")
89 end
90 l_sb := l_sb.append (l_attribute.description)
91 l_descriptions.put (i, l_sb.to_string)
92 i := i + 1
93 end
94
95 {SYSTEM_ARRAY}.sort (l_descriptions)
96 from i :=0 until i = l_count loop
97 print (l_descriptions.item (i))
98 print ("%N")
99 i := i + 1
100 end
101 end
102 end
103
104 print_member_descriptions (a_members: NATIVE_ARRAY [MEMBER_INFO])
105 require
106 a_members_attached: a_members /= Void
107 local
108 l_count, i: INTEGER
109 do
110 l_count := a_members.count
111 from i := 0 until i = l_count loop
112 print_descriptions (a_members.item (i))
113 i := i + 1
114 end
115 end
116
117 feature -- Tests
118
119 method: SYSTEM_STRING is
120 indexing
121 class_metadata:
122 create {DESCRIPTION_ATTRIBUTE}.make ("on class") end
123
124 interface_metadata:
125 create {DESCRIPTION_ATTRIBUTE}.make ("on interface") end
126
127 metadata:
128 create {DESCRIPTION_ATTRIBUTE}.make ("on class and interface") end
129 do
130 end
131
132 property: SYSTEM_STRING assign set_property
133 indexing
134 property: auto
135 class_metadata:
136 create {DESCRIPTION_ATTRIBUTE}.make ("on class attribute") end
137
138 interface_metadata:
139 create {DESCRIPTION_ATTRIBUTE}.make ("on interface attribute") end
140
141 metadata:
142 create {DESCRIPTION_ATTRIBUTE}.make ("on class and interface attribute") end
143
144 property_metadata:
145 create {DESCRIPTION_ATTRIBUTE}.make ("on property") end
146
147 -- Currently not supported
148 -- attribute_metadata:
149 -- create {DESCRIPTION_ATTRIBUTE}.make ("on attribute") end
150 end
151
152 set_property (a_property: like property)
153 indexing
154 class_metadata:
155 create {DESCRIPTION_ATTRIBUTE}.make ("on class") end
156
157 interface_metadata:
158 create {DESCRIPTION_ATTRIBUTE}.make ("on interface") end
159
160 metadata:
161 create {DESCRIPTION_ATTRIBUTE}.make ("on class and interface") end
162 do
163 end
164
165 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23