private void PropertyGrid_CollectionEditorOpening(object sender, CollectionEditorOpeningEventArgs e)
        {
            //Restrict collection editor window opening
            e.Cancel = true;

            if (sender is PropertyGrid pg)
            {
                var selectedProperty = pg.SelectedPropertyItem;
                var prop             = selectedProperty.Value;

                if (prop is IRedArray editableVariable)
                {
                    // open custom collection editor
                    var collectionEditor = new RedCollectionEditor(editableVariable);
                    var r = collectionEditor.ShowDialog();
                    if (r ?? true)
                    {
                        //TODO
                    }
                }
                else
                {
                    throw new ArgumentException(nameof(editableVariable));
                }
            }
        }
Beispiel #2
0
        private void PropertyGrid_CollectionEditorOpening(object sender, CollectionEditorOpeningEventArgs e)
        {
            //Enable or disabe the collection property as readonly
            e.IsReadonly = enableReadOnlyMode;

            //Allow or Restrict the CollectionEditor Opening
            e.Cancel = restrictCollectionEditorOpening;
        }
 private void PropertyGrid_CollectionEditorOpening(object sender, CollectionEditorOpeningEventArgs e)
 {
     //Enable or disabe the collection property as readonly
     e.IsReadonly = enableReadOnlyMode;
 }
 private void PropertyGrid_CollectionEditorOpening(object sender, CollectionEditorOpeningEventArgs e)
 {
     e.Cancel     = this.RestrictOpening;
     e.IsReadonly = this.IsReadOnly;
 }