public static void SetCustomPropertyValue(this IAcSmComponent comp, string propName, object value) { var prop = comp.GetProperty(propName); if (prop == null) { throw new KeyNotFoundException($"Не найден параметр '{propName}'"); } prop.SetValue(value); }
public static object GetCustomPropertyValue(this IAcSmComponent comp, string propName) { var prop = comp.GetProperty(propName); return(prop?.GetValue()); }