有关 .NET CollectionEditor 类型的问题
谁能用通俗易懂的语言告诉我CollectionEditor的内部工作机制?
我已经实现了每个虚拟函数并逐步执行了每个函数。仍然不知道其预期的算法。我在网上搜索并发现了大量有关 CollectionEditor 类型的抱怨,甚至 错误。
我认为 CollectionEditor 完全是一团糟。
Who can tell me the internal working mechanism of a CollectionEditor in plain English?
I have implemented every virtual function and step into each of them. Still got no clue of its intended algorithm. I searched the web and found tons of compaints about the CollectionEditor type, and even bugs.
I am kind of thinking of the CollectionEditor as a total mess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看如何使用 CollectionEditor 编辑和保留集合
作者:Daniel Zaharia,本文演示了如何使用 CollectionEditor 编辑和保留集合。 http://www.codeproject.com/KB/cs/dzcollectioneditor.aspx。我发现它是一个很好的资源。另一个很好的例子是在 http://dotnetrix.co.uk 创建一个 PanelManager /custom.htm。
我在使用
CollectionEditor
时没有遇到任何问题。这是相当简单的。起初,我在使用我创建的ExpandableObjectConverter
时确实遇到了麻烦,因为我不明白它的用途。 MSDN Library 是一个很好的资源。有关“如何:实现类型转换器”的另一个参考和实际示例,请参阅 MSDN:http://msdn.microsoft.com/en-us/library/ayybcxe5.aspx。为什么想了解“内部运作”?您的具体问题是什么?您是编辑器还是类型转换器有问题?您可以下载 Microsoft 的 .NET Framework 源代码或使用 .NET Reflector 检查 CollectionEditor。当我查看代码时,它确实对我没有帮助。
根据我有限的理解,
CollectionEditor
使用TypeConverter
创建设计器生成的表单代码中使用的构造函数代码。关于您的 NullReference,调试设计时控件将找到您的问题。请参阅<演练:在设计时调试自定义 Windows 窗体控件,网址为 http://msdn.microsoft.com/en-us/library/5ytx0z24(VS.80).aspx。
Check out How to Edit and Persist Collections with CollectionEditor
By Daniel Zaharia, The article demonstrates how to edit and persist collections with CollectionEditor. http://www.codeproject.com/KB/cs/dzcollectioneditor.aspx. I found it a good resource. Another good example is Create a PanelManager at http://dotnetrix.co.uk/custom.htm.
I have had no problem using the
CollectionEditor
. It is fairly straight forward. I did have trouble at first with theExpandableObjectConverter
that I created because I didn't understand it purpose. The MSDN Library is a good source for this. For another reference and actual example of "How to: Implement a Type Converter", see MSDN: http://msdn.microsoft.com/en-us/library/ayybcxe5.aspx.Why do you want to know the "internal workings"? What is your specific trouble? Is your trouble with the editor or the type converter? You can download Microsoft's source code for the .NET Framework or inspect the CollectionEditor using .NET Reflector. When I reviewed the code, it really didn't help me.
From my limited understanding, the
CollectionEditor
uses theTypeConverter
to create the constructor code used in the designer-generated form code.Regarding your NullReference, debugging design-time controls will find your problem. See Walkthrough: Debugging Custom Windows Forms Controls at Design Time at http://msdn.microsoft.com/en-us/library/5ytx0z24(VS.80).aspx.