具有动态填充下拉列表的域属性(包含与所选元素的关系的目标元素) [英] Domain Property with dynamically filled drop down list (which contains the target elements of a relationship to the selected element)
问题描述
你好,
让我们在图中说我有3个元素A,B和C. A通过参考连接与B和C的关系。
Let's say in a diagram I have 3 elements A, B and C. A is connected via reference relationships to both B and C.
元素A有一个域属性,用户应从下拉列表中选择B和C.
Element A has a Domain Property where the user should choose between B and C from a drop down list.
因此,我必须使用每个元素(此处为:B和C)动态填充该下拉列表,该元素充当与所选源(例如:A)的关系的目标。
So I would have to dynamically fill that drop down list with every element (here: B and C) that acts as a target for a relationship with the selected source (here: A).
我想我看过一个网站或博客,其中提出了我的问题的解决方案,或者至少有一个类似的解决方案,但我可以'找到那个了。也许这里有人知道更多...
I think I saw a website or a blog where a solution to my problem or at least a similar one was presented, but I can't find that one anymore. Maybe somebody here knows more...
如果没有人知道或我只记得错误地看到发布的地方,我想知道:
In case that nobody knows or I just remember wrongly seeing that posted somewhere, I would like to know:
如何从自定义UITypeEditor中获取对元素A的引用?那么我怎么能在UITypeEditor中知道它被调用哪个元素的属性?
How can I get a reference to element A from inside a custom UITypeEditor? So how can I know inside the UITypeEditor for which property of which element it was called?
提前致谢!
推荐答案
我可能错了(仍然在这里学习东西),但我相信你可以在EditValue中使用context参数
I could be wrong (still learning things here) but I believe you can use the context parameter in EditValue
http:// msdn.microsoft.com/en-us/library/yezs56kx.aspx
http://msdn.microsoft.com/en-us/library/yezs56kx.aspx
前往酒店。正在编辑对象整个属性的上下文的Instance属性。
to get to the property. The Instance property of context it looks like points to the object whole property is being edited.
这篇关于具有动态填充下拉列表的域属性(包含与所选元素的关系的目标元素)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!