locked
WF Custom Editor RRS feed

  • Question

  • Would like to ask anyone familiar with using custom UI editor for a custom WF activity.

    I created my activity to have a collection property. I want to either use the built in property editor for collections in VS (just like the one in InvokeMethod activity) or use my own editor but somehow, the custom editor does not display.

    Here is how I wrote my code:

    public sealed class MyActivity : CodeActivity { private Collection<Argument> parameters; [Editor(typeof(MyEditor), typeof(UITypeEditor))] public Collection<Argument> Parameters { get { if (this.parameters == null) { this.parameters = new Collection<Argument>(); } return this.parameters; } } protected override void Execute(CodeActivityContext context) { } }

    and my custom editor:

    public class MyEditor : UITypeEditor
    	{
    		public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
    		{
    			System.Diagnostics.Debugger.Break();
     
    			MessageBox.Show("Editing!");
    			return base.EditValue(context, provider, value);
    		}
     
    		public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
    		{
    			return UITypeEditorEditStyle.Modal;
    		}
    	}

    The message box isn't even displaying. TIA!

             


    • Edited by AAP20 Thursday, March 19, 2015 1:42 AM
    Monday, March 16, 2015 7:00 AM

All replies