Datei: NDOEnhancer/ILCode/ILCustomElement.cs

Last Commit (6531db8)
1 //
2 // Copyright (c) 2002-2016 Mirko Matytschak
3 // (www.netdataobjects.de)
4 //
5 // Author: Mirko Matytschak
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
8 // documentation files (the "Software"), to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
10 // Software, and to permit persons to whom the Software is furnished to do so, subject to the following
11 // conditions:
12
13 // The above copyright notice and this permission notice shall be included in all copies or substantial portions
14 // of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
21
22
23 using System;
24 using System.Globalization;
25 using System.Diagnostics;
26 using System.Reflection;
27
28 // using com.poet.util;
29
30 namespace ILCode
31 {
32 ····/// <summary>
33 ····/// Summary description for ILCustomElement.
34 ····/// </summary>
35 ····internal class ILCustomElement : ILElement
36 ····{
37 ········public ILCustomElement()
38 ············: base( false )
39 ········{
40 ········}
41
42 ········public ILCustomElement( string firstLine, ILElement owner )
43 ············: base( firstLine, owner )
44 ········{
45 ········}
46 /*
47 ········public ILCustomElement(string typeName, object[] parameters)
48 ············: base ( false )
49 ········{
50 ············string param = makeParameters(parameters);
51 ············//this.addLine
52 ········}
53 */
54 ········internal class ILCustomElementType : ILElementType
55 ········{
56 ············public ILCustomElementType()
57 ················: base( ".custom", typeof (ILCustomElement) )
58 ············{
59 ············}
60 ········}
61
62 ········internal class Iterator : ILElementIterator
63 ········{
64 ············public Iterator( ILElement element )
65 ················: base( element, typeof (ILCustomElement) )
66 ············{
67 ············}
68
69 ············public new ILCustomElement
70 ················getNext()
71 ············{
72 ················return base.getNext() as ILCustomElement;
73 ············}
74 ········}
75
76 ········private static ILElementType········m_elementType = new ILCustomElementType();
77 ········
78 ········public static void
79 ············initialize()
80 ········{
81 ········}
82
83 ········public static ILCustomElement.Iterator
84 ············getIterator( ILElement element )
85 ········{
86 ············return new Iterator( element );
87 ········}
88
89 ········public bool
90 ············isAttribute( Type type )
91 ········{
92 ············if ( null == type )
93 ················return false;
94
95 ············string firstLine = getLine( 0 );
96
97 ············return (-1 < firstLine.IndexOf( type.FullName ));
98 ········}
99
100 /*
101 ········private string
102 ············makeParameters(object[] parameters)
103 ········{
104 ············return null;
105 ········}
106 */
107 ········private object
108 ············readParam( byte[] bytes, Type type, ref int pos )
109 ········{
110 ············if ( type.FullName == "System.String" || type.FullName == "System.Type")
111 ············{
112 ················string para;
113 ················int len = PackedLength.Read(bytes, ref pos);
114 ················if (len == -1)
115 ····················para = null;
116 ················else
117 ····················para = new System.Text.UTF8Encoding().GetString(bytes, pos + 1, len);
118 ················//string para = new string( chars, pos + 1, bytes[pos]);
119 ················pos += 1 + bytes[pos];
120 ················if (para != null && para != string.Empty)
121 ················{
122 ····················if (para[para.Length - 1] == '\0')
123 ························para = para.Substring(0, para.Length - 1);
124 ················}
125 ················return para;
126 ············}
127 ············else if ( type == typeof(System.Boolean) )
128 ············{
129 ················bool para = Convert.ToBoolean( bytes[pos] );
130 ················pos += 1;
131 ················return para;
132 ············}
133 ············else if ( type == typeof(System.Char) )
134 ············{
135 ················char para = Convert.ToChar( bytes[pos+1] * 256 + bytes[pos] );
136 ················pos += 2;
137 ················return para;
138 ············}
139 ············else if ( type == typeof(System.Int16) )
140 ············{
141 ················short para = Convert.ToInt16( bytes[pos+1] * 256 + bytes[pos] );
142 ················pos += 2;
143 ················return para;
144 ············}
145 ············else if ( type == typeof(System.Int32) )
146 ············{
147 ················int para = ((bytes[pos+3] * 256 + bytes[pos+2]) * 256 + bytes[pos+1]) * 256 + bytes[pos];
148 ················pos += 4;
149 ················return para;
150 ············}
151 ············else if ( type.FullName == "NDO.RelationInfo" )
152 ············{
153 ················short para = Convert.ToInt16( bytes[pos+1] * 256 + bytes[pos] );
154 ················pos += 2;
155 ················return (NDO.RelationInfo) para;
156 ············}
 
 
 
 
 
 
157 ············
158 NDOEnhancer. MessageAdapter ma = new NDOEnhancer. MessageAdapter( ) ;
159 ma. ShowError( "Unknown type in attribute parameter list: " + type. FullName ) ;
160 ············
161 ············return null;
162 ········}
163
164
165 ········internal class AttributeInfo
166 ········{
167 ············public string Name;
168 ············public string AssemblyName;
169 ············public string[] ParamTypeNames = new string[]{};
170 ············public object[] ParamValues = new object[]{};
171 ········}
172
173
174 ········public AttributeInfo
175 ············getAttributeInfo()
176 ········{
177 ············string text = "";
178
179 ············for ( int i=0; i<getLineCount(); i++ )
180 ············{
181 ················string line = getLine( i );
182 ················
183 ················int cmt = line.IndexOf( "//" );
184 ················if ( -1 < cmt )
185 ····················line = line.Substring( 0, cmt ).Trim();
186 ················
187 ················text += " " + line;
188 ············}
189
190 ············int start, end;
191
192 ············// assembly name
193
194 ············start = text.IndexOf( "[" ) + 1;
195 ············end·· = text.IndexOf( "]", start );
196 ············string assName = stripComment( text.Substring( start, end - start ) );
197
198 ············// type name
199
200 ············start = text.IndexOf( "]" ) + 1;
201 ············end······= text.IndexOf( "::", start );
202 ············string typeName = stripComment( text.Substring( start, end - start ) );
203
204 ············// constructor signature
205
206 ············start = text.IndexOf( "(" ) + 1;
207 ············end······= text.IndexOf( ")", start );
208 ············string signature = stripComment( text.Substring( start, end - start ) );
209
210 ············// parameter bytes
211
212 ············start = text.IndexOf( "= (" ) + 3;
213 ············end······= text.IndexOf( ")", start );
214 ············string byteText····= text.Substring( start, end - start ).Trim();
215
216 ············char[]·· spc········ = { ' ' };
217 ············string[] byteStrings = byteText.Split( spc );
218 ············byte[]·· bytes········ = new byte[byteStrings.Length];
219 ············//············char[]···· chars········ = new char[byteStrings.Length];
220
221 ············for ( int i=0; i<byteStrings.Length; i++ )
222 ············{
223 ················bytes[i] = Byte.Parse( byteStrings[i], NumberStyles.HexNumber );
224 ················//················chars[i] = Convert.ToChar( bytes[i] );
225 ············}
226
227 //············char[] chars = new System.Text.UTF8Encoding().GetChars(bytes);
228 ············
229 ············//············Type attributeType = Type.GetType( typeName + ", " + assName );
230 ············//············if ( null == attributeType )
231 ············//················return null;
232
233 ············char·· comma =··',';
234 ············string[] paramTypeNames = new string[]{};
235 ············object[] paramValues = new object[]{};
236 ············Type[] paramTypes = new Type[]{};
237 ············//CustomAttrib starts with a Prolog – an unsigned int16, with value 0x0001
238 ············int pos = 2;
239 ············if (signature != "")
240 ············{
241 ················paramTypeNames = signature.Split( comma );
242 ················paramTypes······ = new Type[paramTypeNames.Length];
243 ················paramValues······ = new Object[paramTypeNames.Length];
244
245 ················for ( int i=0; i<paramTypeNames.Length; i++ )
246 ················{
247 ····················string paramTypeName = paramTypeNames[i].Trim();
248 ····················if ( paramTypeName == "string" || paramTypeName.IndexOf("System.String") > -1)
249 ····················{
250 ························paramTypeNames[i] = "System.String";
251 ························paramTypes[i] = typeof(string);
252 ····················}
253 ····················else if ( paramTypeName == "bool" )
254 ····················{
255 ························paramTypes[i] = typeof(bool);
256 ························paramTypeNames[i] = "System.Boolean";
257 ····················}
258 ····················else if ( paramTypeName == "char" )
259 ····················{
260 ························paramTypes[i] = typeof(char);
261 ························paramTypeNames[i] = "System.Char";
262 ····················}
263 ····················else if ( paramTypeName == "short" || paramTypeName == "int16" )
264 ····················{
265 ························paramTypeNames[i] = "System.Int16";
266 ························paramTypes[i] = typeof(System.Int16);
267 ····················}
268 ····················else if ( paramTypeName == "int" || paramTypeName == "int32")
269 ····················{
270 ························paramTypeNames[i] = "System.Int32";
271 ························paramTypes[i] = typeof(System.Int32);
272 ····················}
273 ························// Achtung: System.Type wird als string abgespeichert!!!
274 ····················else if ( paramTypeName.IndexOf("[mscorlib") > -1 && paramTypeName.IndexOf("System.Type") > -1 )
275 ····················{
276 ························paramTypes[i] = typeof(System.String);
277 ························paramTypeNames[i] = "System.Type";························
278 ····················}
279 ····················else if ( paramTypeName == "valuetype [NDO]NDO.RelationInfo" )
280 ····················{
281 ························paramTypes[i] = typeof(NDO.RelationInfo);
282 ························paramTypeNames[i] = "NDO.RelationInfo, NDO";························
 
 
 
 
 
 
 
 
 
283 ····················}
284 ····················else
285 throw new Exception( "Relation Attribute: Unknown type in attribute parameter list: " + paramTypeName) ;
 
286
287 ····················//paramTypes[i]··= Type.GetType( paramTypeNames[i] );
288 ····················paramValues[i] = readParam( bytes, paramTypes[i], ref pos );
289 ················}
290 ············}
291 ············//············ConstructorInfo ci···· = attributeType.GetConstructor( paramTypes );
292 ············AttributeInfo····attr = new AttributeInfo();
293 ············attr.Name = typeName;
294 ············attr.AssemblyName = assName;
295 ············attr.ParamTypeNames = paramTypeNames;
296 ············attr.ParamValues = paramValues;
297
298 ············//TODO: sollten jemals benannte Parameter dazukommen
299 ············//TODO: müssten wir hier einigen Code hinzufügen
300
301 ············//············short count = (short) readParam( bytes, chars, Type.GetType( "System.Int16" ), ref pos );
302 ············//
303 ············//············for ( short i=0; i<count; i++ )
304 ············//············{
305 ············//················pos += 2;
306 ············//
307 ············//················string propName = readParam( bytes, chars, Type.GetType( "System.String" ), ref pos ) as string;
308 ············//
309 ············//················PropertyInfo pi = attributeType.GetProperty( propName );
310 ············//
311 ············//················object propVal = readParam( bytes, chars, pi.PropertyType, ref pos );
312 ············//
313 ············//················pi.SetValue( attr, propVal, null );
314 ············//············}
315
316 ············return attr;
317 ········}
318
319 ········public void
320 ············replaceLines( string firstLine )
321 ········{
322 ············clearLines();
323
324 ············addLine( firstLine );
325 ········}
326
327 ····
328 ····}
329 }
330
New Commit (83b2245)
1 //
2 // Copyright (c) 2002-2016 Mirko Matytschak
3 // (www.netdataobjects.de)
4 //
5 // Author: Mirko Matytschak
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
8 // documentation files (the "Software"), to deal in the Software without restriction, including without limitation
9 // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
10 // Software, and to permit persons to whom the Software is furnished to do so, subject to the following
11 // conditions:
12
13 // The above copyright notice and this permission notice shall be included in all copies or substantial portions
14 // of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
17 // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
19 // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 // DEALINGS IN THE SOFTWARE.
21
22
23 using System;
24 using System.Globalization;
25 using System.Diagnostics;
26 using System.Reflection;
27
28 // using com.poet.util;
29
30 namespace ILCode
31 {
32 ····/// <summary>
33 ····/// Summary description for ILCustomElement.
34 ····/// </summary>
35 ····internal class ILCustomElement : ILElement
36 ····{
37 ········public ILCustomElement()
38 ············: base( false )
39 ········{
40 ········}
41
42 ········public ILCustomElement( string firstLine, ILElement owner )
43 ············: base( firstLine, owner )
44 ········{
45 ········}
46 /*
47 ········public ILCustomElement(string typeName, object[] parameters)
48 ············: base ( false )
49 ········{
50 ············string param = makeParameters(parameters);
51 ············//this.addLine
52 ········}
53 */
54 ········internal class ILCustomElementType : ILElementType
55 ········{
56 ············public ILCustomElementType()
57 ················: base( ".custom", typeof (ILCustomElement) )
58 ············{
59 ············}
60 ········}
61
62 ········internal class Iterator : ILElementIterator
63 ········{
64 ············public Iterator( ILElement element )
65 ················: base( element, typeof (ILCustomElement) )
66 ············{
67 ············}
68
69 ············public new ILCustomElement
70 ················getNext()
71 ············{
72 ················return base.getNext() as ILCustomElement;
73 ············}
74 ········}
75
76 ········private static ILElementType········m_elementType = new ILCustomElementType();
77 ········
78 ········public static void
79 ············initialize()
80 ········{
81 ········}
82
83 ········public static ILCustomElement.Iterator
84 ············getIterator( ILElement element )
85 ········{
86 ············return new Iterator( element );
87 ········}
88
89 ········public bool
90 ············isAttribute( Type type )
91 ········{
92 ············if ( null == type )
93 ················return false;
94
95 ············string firstLine = getLine( 0 );
96
97 ············return (-1 < firstLine.IndexOf( type.FullName ));
98 ········}
99
100 /*
101 ········private string
102 ············makeParameters(object[] parameters)
103 ········{
104 ············return null;
105 ········}
106 */
107 ········private object
108 ············readParam( byte[] bytes, Type type, ref int pos )
109 ········{
110 ············if ( type.FullName == "System.String" || type.FullName == "System.Type")
111 ············{
112 ················string para;
113 ················int len = PackedLength.Read(bytes, ref pos);
114 ················if (len == -1)
115 ····················para = null;
116 ················else
117 ····················para = new System.Text.UTF8Encoding().GetString(bytes, pos + 1, len);
118 ················//string para = new string( chars, pos + 1, bytes[pos]);
119 ················pos += 1 + bytes[pos];
120 ················if (para != null && para != string.Empty)
121 ················{
122 ····················if (para[para.Length - 1] == '\0')
123 ························para = para.Substring(0, para.Length - 1);
124 ················}
125 ················return para;
126 ············}
127 ············else if ( type == typeof(System.Boolean) )
128 ············{
129 ················bool para = Convert.ToBoolean( bytes[pos] );
130 ················pos += 1;
131 ················return para;
132 ············}
133 ············else if ( type == typeof(System.Char) )
134 ············{
135 ················char para = Convert.ToChar( bytes[pos+1] * 256 + bytes[pos] );
136 ················pos += 2;
137 ················return para;
138 ············}
139 ············else if ( type == typeof(System.Int16) )
140 ············{
141 ················short para = Convert.ToInt16( bytes[pos+1] * 256 + bytes[pos] );
142 ················pos += 2;
143 ················return para;
144 ············}
145 ············else if ( type == typeof(System.Int32) )
146 ············{
147 ················int para = ((bytes[pos+3] * 256 + bytes[pos+2]) * 256 + bytes[pos+1]) * 256 + bytes[pos];
148 ················pos += 4;
149 ················return para;
150 ············}
151 ············else if ( type.FullName == "NDO.RelationInfo" )
152 ············{
153 ················short para = Convert.ToInt16( bytes[pos+1] * 256 + bytes[pos] );
154 ················pos += 2;
155 ················return (NDO.RelationInfo) para;
156 ············}
157 ············else if (typeof(System.Enum).IsAssignableFrom( type ) )
158 ············{
159 ················int para = ((bytes[pos+3] * 256 + bytes[pos+2]) * 256 + bytes[pos+1]) * 256 + bytes[pos];
160 ················pos += 4;
161 ················return Enum.ToObject( type, para );
162 ············}
163
164 MessageAdapter ma = new MessageAdapter( ) ;
165 ma. ShowError( $"Relation Attribute: Unknown type in attribute parameter list: { type. FullName} , owner type: { ( this. Owner as ILClassElement ) ?. Name ?? "-"} " ) ;
166
167 ············return null;
168 ········}
169
170
171 ········internal class AttributeInfo
172 ········{
173 ············public string Name;
174 ············public string AssemblyName;
175 ············public string[] ParamTypeNames = new string[]{};
176 ············public object[] ParamValues = new object[]{};
177 ········}
178
179
180 ········public AttributeInfo
181 ············getAttributeInfo()
182 ········{
183 ············string text = "";
184
185 ············for ( int i=0; i<getLineCount(); i++ )
186 ············{
187 ················string line = getLine( i );
188 ················
189 ················int cmt = line.IndexOf( "//" );
190 ················if ( -1 < cmt )
191 ····················line = line.Substring( 0, cmt ).Trim();
192 ················
193 ················text += " " + line;
194 ············}
195
196 ············int start, end;
197
198 ············// assembly name
199
200 ············start = text.IndexOf( "[" ) + 1;
201 ············end·· = text.IndexOf( "]", start );
202 ············string assName = stripComment( text.Substring( start, end - start ) );
203
204 ············// type name
205
206 ············start = text.IndexOf( "]" ) + 1;
207 ············end······= text.IndexOf( "::", start );
208 ············string typeName = stripComment( text.Substring( start, end - start ) );
209
210 ············// constructor signature
211
212 ············start = text.IndexOf( "(" ) + 1;
213 ············end······= text.IndexOf( ")", start );
214 ············string signature = stripComment( text.Substring( start, end - start ) );
215
216 ············// parameter bytes
217
218 ············start = text.IndexOf( "= (" ) + 3;
219 ············end······= text.IndexOf( ")", start );
220 ············string byteText····= text.Substring( start, end - start ).Trim();
221
222 ············char[]·· spc········ = { ' ' };
223 ············string[] byteStrings = byteText.Split( spc );
224 ············byte[]·· bytes········ = new byte[byteStrings.Length];
225 ············//············char[]···· chars········ = new char[byteStrings.Length];
226
227 ············for ( int i=0; i<byteStrings.Length; i++ )
228 ············{
229 ················bytes[i] = Byte.Parse( byteStrings[i], NumberStyles.HexNumber );
230 ················//················chars[i] = Convert.ToChar( bytes[i] );
231 ············}
232
233 //············char[] chars = new System.Text.UTF8Encoding().GetChars(bytes);
234 ············
235 ············//············Type attributeType = Type.GetType( typeName + ", " + assName );
236 ············//············if ( null == attributeType )
237 ············//················return null;
238
239 ············char·· comma =··',';
240 ············string[] paramTypeNames = new string[]{};
241 ············object[] paramValues = new object[]{};
242 ············Type[] paramTypes = new Type[]{};
243 ············//CustomAttrib starts with a Prolog – an unsigned int16, with value 0x0001
244 ············int pos = 2;
245 ············if (signature != "")
246 ············{
247 ················paramTypeNames = signature.Split( comma );
248 ················paramTypes······ = new Type[paramTypeNames.Length];
249 ················paramValues······ = new Object[paramTypeNames.Length];
250
251 ················for ( int i=0; i<paramTypeNames.Length; i++ )
252 ················{
253 ····················string paramTypeName = paramTypeNames[i].Trim();
254 ····················if ( paramTypeName == "string" || paramTypeName.IndexOf("System.String") > -1)
255 ····················{
256 ························paramTypeNames[i] = "System.String";
257 ························paramTypes[i] = typeof(string);
258 ····················}
259 ····················else if ( paramTypeName == "bool" )
260 ····················{
261 ························paramTypes[i] = typeof(bool);
262 ························paramTypeNames[i] = "System.Boolean";
263 ····················}
264 ····················else if ( paramTypeName == "char" )
265 ····················{
266 ························paramTypes[i] = typeof(char);
267 ························paramTypeNames[i] = "System.Char";
268 ····················}
269 ····················else if ( paramTypeName == "short" || paramTypeName == "int16" )
270 ····················{
271 ························paramTypeNames[i] = "System.Int16";
272 ························paramTypes[i] = typeof(System.Int16);
273 ····················}
274 ····················else if ( paramTypeName == "int" || paramTypeName == "int32")
275 ····················{
276 ························paramTypeNames[i] = "System.Int32";
277 ························paramTypes[i] = typeof(System.Int32);
278 ····················}
279 ························// Achtung: System.Type wird als string abgespeichert!!!
280 ····················else if ( paramTypeName.IndexOf("[mscorlib") > -1 && paramTypeName.IndexOf("System.Type") > -1 )
281 ····················{
282 ························paramTypes[i] = typeof(System.String);
283 ························paramTypeNames[i] = "System.Type";························
284 ····················}
285 ····················else if ( paramTypeName == "valuetype [NDO]NDO.RelationInfo" )
286 ····················{
287 ························paramTypes[i] = typeof(NDO.RelationInfo);
288 ························paramTypeNames[i] = "NDO.RelationInfo, NDO";························
289 ····················}
290 ····················else
291 ····················{
292 ························var paramTypeString = paramTypeName.Substring(paramTypeName.IndexOf(']') + 1);
293 ························var t = Type.GetType( paramTypeString );
294 ························if (t != null)
295 ························{
296 ····························paramTypes[i] = t;
297 ····························paramTypeNames[i] = "paramTypeString";
298 ························}
299 ························else
300 throw new Exception( $"Relation Attribute: Unknown type in attribute parameter list: { paramTypeName} , type: { ( this. Owner as ILClassElement ) ?. Name ?? ""} " ) ;
301 ····················}
302
303 ····················//paramTypes[i]··= Type.GetType( paramTypeNames[i] );
304 ····················paramValues[i] = readParam( bytes, paramTypes[i], ref pos );
305 ················}
306 ············}
307 ············//············ConstructorInfo ci···· = attributeType.GetConstructor( paramTypes );
308 ············AttributeInfo····attr = new AttributeInfo();
309 ············attr.Name = typeName;
310 ············attr.AssemblyName = assName;
311 ············attr.ParamTypeNames = paramTypeNames;
312 ············attr.ParamValues = paramValues;
313
314 ············//TODO: sollten jemals benannte Parameter dazukommen
315 ············//TODO: müssten wir hier einigen Code hinzufügen
316
317 ············//············short count = (short) readParam( bytes, chars, Type.GetType( "System.Int16" ), ref pos );
318 ············//
319 ············//············for ( short i=0; i<count; i++ )
320 ············//············{
321 ············//················pos += 2;
322 ············//
323 ············//················string propName = readParam( bytes, chars, Type.GetType( "System.String" ), ref pos ) as string;
324 ············//
325 ············//················PropertyInfo pi = attributeType.GetProperty( propName );
326 ············//
327 ············//················object propVal = readParam( bytes, chars, pi.PropertyType, ref pos );
328 ············//
329 ············//················pi.SetValue( attr, propVal, null );
330 ············//············}
331
332 ············return attr;
333 ········}
334
335 ········public void
336 ············replaceLines( string firstLine )
337 ········{
338 ············clearLines();
339
340 ············addLine( firstLine );
341 ········}
342
343 ····
344 ····}
345 }
346