Esempio n. 1
0
 private static void OnInitializeEditView(IDataSource childDataSource, PropertyEditorItem editPropertyItem)
 {
     childDataSource.SuspendUpdate();
     childDataSource.SetEditMode();
     childDataSource.ResumeUpdate();
     childDataSource.SetSelectedItem(editPropertyItem.Item);
 }
Esempio n. 2
0
        private bool DeleteProperty(PropertyEditorItem propertyItem)
        {
            var propertyEditor = propertyItem.Editor;

            var deletePropertyFunc = IsCollectionProperty(propertyEditor)
                ? DeleteCollectionProperty(_propertyItems, propertyEditor)
                : DeleteScalarProperty(_propertyItems, propertyEditor);

            return(deletePropertyFunc(propertyItem));
        }
Esempio n. 3
0
        private bool UpdateProperty(PropertyEditorItem oldPropertyItem, PropertyEditorItem newPropertyItem)
        {
            var propertyEditor = newPropertyItem.Editor;

            var updatePropertyFunc = IsCollectionProperty(propertyEditor)
                ? UpdateCollectionProperty(_propertyItems, propertyEditor)
                : UpdateScalarProperty(_propertyItems, propertyEditor);

            return(updatePropertyFunc(oldPropertyItem, newPropertyItem));
        }
Esempio n. 4
0
        private bool InsertProperty(PropertyEditorItem propertyItem)
        {
            var propertyEditor = propertyItem.Editor;

            var insertPropertyFunc = IsCollectionProperty(propertyEditor)
                ? InsertCollectionProperty(_propertyItems, propertyEditor)
                : InsertScalarProperty(_propertyItems, propertyEditor);

            return(insertPropertyFunc(propertyItem));
        }
Esempio n. 5
0
        private void OnAcceptedEditView(bool isNewPropertyItem, PropertyEditorItem propertyItem,
                                        PropertyEditorItem editPropertyItem)
        {
            var isEditValueChanged = isNewPropertyItem
                ? InsertProperty(editPropertyItem)
                : UpdateProperty(propertyItem, editPropertyItem);

            if (isEditValueChanged)
            {
                InvokeEditValueChanged(EditValue, EditValue);
            }
        }
Esempio n. 6
0
        private void AddOrEditProperty(PropertyEditorItem propertyItem, bool isNewPropertyItem)
        {
            if (propertyItem != null)
            {
                var editPropertyItem = isNewPropertyItem ? propertyItem : propertyItem.Clone();

                ViewHelper.ShowView(propertyItem,
                                    () => propertyItem.Editor.EditView,
                                    childDataSource => OnInitializeEditView(childDataSource, editPropertyItem),
                                    childDataSource => OnAcceptedEditView(isNewPropertyItem, propertyItem, editPropertyItem));
            }
        }
Esempio n. 7
0
 private void SetSelectedProperty(PropertyEditorItem propertyItem)
 {
     Editor.EditValue = propertyItem;
 }
Esempio n. 8
0
 private void EditProperty(PropertyEditorItem propertyItem)
 {
     AddOrEditProperty(propertyItem, false);
 }