private void ButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { object newObject; if (ConfigPublic.CreateNewAddonValue(ListType , true , out newObject)) { DataSetList.Element.AddElementRow(DataSetList.Element.Count, newObject); this.GridControlList.RefreshDataSource(); this.BindingSourceList.Position = BindingSourceList.Count - 1; SetControlStatus(); ModifyData(); } }
private void ButtonAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { object newObject; var inputKeyControl = new InputKeyControl(); if (WinFormPublic.ShowDialog(inputKeyControl) == DialogReturn.OK) { if (ConfigPublic.CreateNewAddonValue(ListType , true , out newObject)) { DataSetList.Element.AddElementRow(inputKeyControl.KeyValue, newObject); this.GridControlList.RefreshDataSource(); this.BindingSourceList.Position = BindingSourceList.Count - 1; SetControlStatus(); ModifyData(); } } }
private void ButtonCreate_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { object newObject = null; var editValue = EditValue; switch (EditMode) { case ObjectEditMode.Property: var propertyName = (string)Key; var property = ComponentObject.GetType().GetProperty(propertyName); if (ConfigPublic.CreateNewAddonValue(property.PropertyType , false , out newObject)) { EditValue = newObject; SetComponentPropertyValue(); ModifyData(); } break; case ObjectEditMode.Object: var objectType = ObjectType; if (objectType == null) { objectType = typeof(PaoObject); } if (ConfigPublic.CreateNewAddonValue(objectType , false , out newObject)) { EditValue = newObject; SetComponentPropertyValue(); ModifyData(); } break; default: break; } }