protected override void InitField() { var obj = this.GetValue <IDictionary>(); var keys = obj.Keys; foreach (var item in keys) { EditorVerticalLayout vl = new EditorVerticalLayout(); this.AddField(vl); { var field = UIWidgetHelper.CreateWidget("Key", item); if (field != null) { vl.Add(field); } } { var field = UIWidgetHelper.CreateWidget("Value", obj[item]); if (field != null) { vl.Add(field); } } } }
protected override void InitField() { var obj = GetValue <IList>(); int i = 0; foreach (var item in obj) { var field = UIWidgetHelper.CreateWidget(string.Format("{0}", i), item); if (field != null) { this.AddField(field); } i++; } }
protected override void InitField() { var obj = this.Value; var fields = obj.GetType().GetFields(); foreach (var item in fields) { var field = UIWidgetHelper.CreateWidget(obj, item); if (field != null) { field.OnValueChanged = (object value) => { item.SetValue(obj, value); Value = obj; }; this.AddField(field); } } }