private void cGUI_eUIDataChange(string sTypeName, string sPropertyName, string sText) { string sChangedTypeName; dynamic instance = null; Type type = null; PropertyInfo property = null; // swap if (sTypeName == _cHuman.GetType().Name) { instance = _cStudy; } else if (sTypeName == _cStudy.GetType().Name) { instance = _cHuman; } type = instance.GetType(); property = type.GetProperty(sPropertyName); if (property == null) { return; } property.SetValue(instance, sText); sChangedTypeName = type.Name; _cGUI.Description(sTypeName, sChangedTypeName, sPropertyName, sText); }
private GUI PropertyBinding(GUI cGUI) { _cHuman = new Human(); List <string> cHumanPropertyName = _cHuman.GetType().GetProperties().AsEnumerable().Select(item => item.Name).ToList(); cGUI.HumanStackAdd(_cHuman, cHumanPropertyName); _cStudy = new Study(); List <string> cStudyPropertyName = _cStudy.GetType().GetProperties().AsEnumerable().Select(item => item.Name).ToList(); cGUI.StudyStackAdd(_cStudy, cStudyPropertyName); return(cGUI); }