Sign in to follow this  
raydey

[.net] UIType Editor help

Recommended Posts

Hey guys, This is my first UI Type editor and I'm not too experienced with C#, so some help would be appreciated. I am in the process of creating a tree control (similar to TreeView, but it allows nodes to be any control the user wants). I've got a Nodes property in my control and decided to do a modal UIType Editor for it. I've got it done, all I want to know is how to save and load values using it. I'm relatively sure my returning code is correct, using the overridden EditValue function, if I understand correctly:
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            // Access the property browser's UI display service
            IWindowsFormsEditorService editorService =
                (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (editorService != null)
            {
                ExTreeNodeEditorForm treeNodeEditorForm = new ExTreeNodeEditorForm();


                // Display the editor
                if (editorService.ShowDialog(treeNodeEditorForm) == DialogResult.OK)
                {
                    return treeNodeEditorForm.m_Nodes;
                }
            }

            return base.EditValue(context, provider, value);

        }

I just want to know how to then load the returned values when I next load up my UIType Editor. I hope that made at least a bit of sense. Any help is greatly appreciated. Cheers Ray

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this