internal void setProperties(CallProperties props) { Type type = this.GetType(); PropertyInfo[] pi = type.GetProperties(); foreach (PropertyInfo prop in pi) { if (props.ContainsKey(prop.Name)) { try { prop.SetValue(this, props[prop.Name], null); } catch (Exception e) { throw new ArgumentException("Could not convert value of type " + props[prop.Name].GetType().ToString() + " to " + prop.PropertyType.ToString() + ". (Property name = " + prop.Name + ")\n" + e.Message); } } } }