开发者

C# custom property editor

I have the following custom property in my code:

public Dictionary<int, string> ServiceIdList
    {
        get
        {
            return ((Dictionary<int, string>)(GetValue(LoadSubscriptionList.ServiceIdListProperty)));
        }
        set
        {
            SetValue(LoadSubscriptionList.ServiceIdListProperty, value);
        }
 开发者_开发知识库   }

But the property editor for this (String Collection Editor) comes up disabled. Do I have to implement a custom UITypeEditor or can the getters and setters be improved as to provide 'hints' to the editor as to what types can be in an entry?

Thanks for any help!


I found this thread that may be of help to you: http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/f2ecec70-4e44-43bb-8a09-feb8a55b365c

It appears that generic Dictionary objects do not have an editor that works with them. You'd have to derive from the CollectionEditor and override a few functions, such as CreateNewItemTypes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜