コード例 #1
0
        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();
                }
            }
        }
コード例 #2
0
 private void DeleteChildViewButtonClick(object sender, EventArgs e)
 {
     if (GridViewChildViews.FocusedRowHandle >= 0)
     {
         ChildViews.RemoveAt(GridViewChildViews.FocusedRowHandle);
         GridViewChildViews.RefreshData();
     }
 }
コード例 #3
0
        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();
        }
コード例 #4
0
 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();
 }