Beispiel #1
0
        private void repositoryItemButtonEditSource_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            var dataSource = _parameters.ElementAt(GridViewParameters.FocusedRowHandle).Parameter as IPropertiesProvider;

            if (dataSource != null)
            {
                var form             = new PropertiesForm();
                var simpleProperties = dataSource.GetSimpleProperties();
                form.SetSimpleProperties(simpleProperties);
                var collectionProperties = dataSource.GetCollections();
                form.SetCollectionProperties(collectionProperties);
                form.SetValidationRules(dataSource.GetValidationRules());
                form.SetPropertyEditors(_repository.Editors);

                if (form.ShowDialog() == DialogResult.OK)
                {
                    dataSource.ApplySimpleProperties();
                    dataSource.ApplyCollections();
                    GridViewParameters.HideEditor();
                    GridViewParameters.RefreshData();
                }
                else
                {
                    form.RevertChanges();
                }
            }
        }
Beispiel #2
0
 private void DeleteScriptButton_Click(object sender, EventArgs e)
 {
     if (GridViewParameters.FocusedRowHandle >= 0)
     {
         _parameters.RemoveAt(GridViewParameters.FocusedRowHandle);
         GridViewParameters.RefreshData();
     }
 }
Beispiel #3
0
        private void AddScriptButton_Click(object sender, EventArgs e)
        {
            var parameterObject = new ParameterObject();

            _parameters.Add(parameterObject);
            parameterObject.Parameter = new Parameter();
            GridViewParameters.RefreshData();
        }
Beispiel #4
0
        public void ProcessJson(dynamic value)
        {
            _parameters.Clear();
            foreach (var source in value)
            {
                var parameterObject = new ParameterObject();

                var parameter = new Parameter();
                parameter.LoadProperties(source);
                parameterObject.Parameter = parameter;

                _parameters.Add(parameterObject);
            }
            GridViewParameters.RefreshData();
        }
Beispiel #5
0
 public void Clear()
 {
     _parameters.Clear();
     GridViewParameters.RefreshData();
 }