如何获得另一个项目的形式? [英] how to get a form of another project?

查看:84
本文介绍了如何获得另一个项目的形式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何获得另一个项目的表格?

在同一解决方案中有2个项目.project1引用了第二个项目(以便我可以从project2中访问project1的表单)

但是我需要从project1访问project2的形式?因为我已经准备好给定project1对project2的引用,所以我不允许在这些项目之间创建另一个引用.

请帮我解决这个问题!
-thank you-

How can i get a form of another project?

There are 2 projects in the same solution.project1 is referenced to the 2nd project(so that i can access forms of project1 from project2)

But i need to access the forms of project2 from project1?since i have all ready given the reference of project1 to project2 it does not allow me to create another reference between those projects.

Please help me to solve this problem!!

-thank you-

推荐答案

您似乎在这里有一个设计问题.
如果您的表单必须在多个项目之间共享,则只需在一个项目中创建它们,然后在其他项目中引用即可.
您绝对不能交叉引用项目;您必须重新设计解决方案,并将共享对象放在一个地方,而不是到处.
You seem to have a design-issue here.
If your forms must be shared amongst several projects, just create them in one project that you will reference in other projects.
You definitely can''t cross-reference projects ; you have to redesign your solution and place shared objects in one place, not everywhere.


这肯定表明您的高级设计是错误的.如果这两个项目真的如此交织在一起,以至于它们需要双向引用,那么应该将它们合并为一个.您更有可能需要执行一些利益分离,并确定代表您在较低级别项目中实际需要的接口.

在项目之间共享UI元素(尤其是表单)是一个很大的危险信号.如果您想在两个项目之间双向进行,那么这两个项目几乎肯定是其中一个部分.
This is a sure sign that your high level design is wrong. If those two projects are really so intertwined that they need two way references, then they should probably be rolled into one. More likely, you need to perform some separation of interests and determine interfaces that represent what you actually need within the lower level project.

Sharing UI elements (particularly forms) between projects is a big red flag. If you think you want that in both directions between two projects, those two projects are almost certainly really part of one.


您正在遇到两个项目之间的循环依赖.您可以通过将两个项目都需要引用的所有内容放在一个单独的第三个项目中来对此进行补救.
You''re running into a circular dependency between the two projects. You can remedy this by putting everything that needs to be referenced by both projects int a separate third project.


这篇关于如何获得另一个项目的形式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆