Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] UIType Editor help

Started by raydey Aug 18, 2009 at 11:46 AM 0 replies 850+ views
Original Post
raydey
raydey
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
raydey
raydey
Never mind, figured it out

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.