private void repositoryItemButtonEditSource_ButtonClick(object sender, ButtonPressedEventArgs e) { var childVIew = ChildViews.ElementAt(GridViewChildViews.FocusedRowHandle).ChildView as IPropertiesProvider; if (childVIew != null) { var form = new PropertiesForm(); var validationRules = childVIew.GetValidationRules(); form.SetValidationRules(validationRules); var propertyEditors = childVIew.GetPropertyEditors(); form.SetPropertyEditors(propertyEditors); var simpleProperties = childVIew.GetSimpleProperties(); form.SetSimpleProperties(simpleProperties); var collectionProperties = childVIew.GetCollections(); form.SetCollectionProperties(collectionProperties); if (form.ShowDialog() == DialogResult.OK) { childVIew.ApplySimpleProperties(); childVIew.ApplyCollections(); GridViewChildViews.HideEditor(); GridViewChildViews.RefreshData(); } else { form.RevertChanges(); } } }
private void DeleteChildViewButtonClick(object sender, EventArgs e) { if (GridViewChildViews.FocusedRowHandle >= 0) { ChildViews.RemoveAt(GridViewChildViews.FocusedRowHandle); GridViewChildViews.RefreshData(); } }
private void AddChildViewButtonClick(object sender, EventArgs e) { var childViewObject = new ChildViewObject(); ChildViews.Add(childViewObject); var childView = new ChildView(); childViewObject.ChildView = childView; childView.ObjectInspector = ObjectInspector; GridViewChildViews.RefreshData(); }
public void ProcessJson(dynamic childViews) { ChildViews.Clear(); foreach (var source in childViews) { var viewObject = new ChildViewObject(); var childView = new ChildView(); childView.ObjectInspector = ObjectInspector; childView.LoadProperties(source); viewObject.ChildView = childView; ChildViews.Add(viewObject); } GridViewChildViews.RefreshData(); }