|
|
От: |
Sulik
|
http://nickpasko.blogspot.com |
| Дата: | 17.04.04 08:10 | ||
| Оценка: | |||
А> private object GetObject(string typeName, string value)
А> {
А> Type type = Type.GetType(typeName);
А> MethodInfo mi = type.GetMethod("Parse", new Type[]{typeof(string)});
А> if(mi == null || !mi.IsStatic)
А> return null;
А> object result = Activator.CreateInstance(Type.GetType(typeName));
А> result = mi.Invoke(result, new object[]{value});
А> return result;
А> }
А>