+
+ PropertyInfo[] properties = current.GetProperties ();
+
+ System.Object output = Activator.CreateInstance (current);
+
+ foreach (string key in widgets.Keys) {
+ PropertyInfo p = current.GetProperty (key);
+ Entry e = (Entry)widgets[key];
+ Console.WriteLine ("{0} = {1}", key, e.Text);
+ if (p.PropertyType.Equals (typeof(string)))
+ p.SetValue (output, e.Text, null);
+ if (p.PropertyType.Equals (typeof(int)))
+ p.SetValue (output, Int32.Parse (e.Text), null);
+ if (p.PropertyType.Equals (typeof(float))) {
+ p.SetValue (output, (float)Double.Parse (e.Text), null);
+ }
+ }