如何设计一个大型.NET项目 - 重用组件 [英] How to design a large .NET Project - Reuse Components

查看:63
本文介绍了如何设计一个大型.NET项目 - 重用组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在计划一个更好的.NET应用程序系统(WindowsForms)和

Visual Studio 2005.


我的一个问题是,如何设计对象,他们可以

重复使用。


例如我有一个表格(带有衍生文本框),应该在

几个项目中使用。


我试图将表格复制到另一个项目 - 没有成功。

添加为链接组件也不起作用。


我是否必须使用UserControls和dll?更新怎么样。


谁有这方面的经验。


感谢您的帮助

aaapaul

解决方案

2007年10月18日消息

< 11 ********* ************@i38g2000prf.googlegroups。 comaaapaul写道:


>我试图将表单复制到另一个项目 - 没有成功。
添加为链接组件不起作用,太。



这些方法中的任何一个*应该*工作,链接可能更好,因为

你只需要修改/更新一次表单。


它是每个应用程序中的主要表单吗?如果是这样你应该删除''Form1''

VS自动添加并将你的表单设置为启动表格。

-

杰夫盖恩斯


谢谢杰夫,但我不明白你的答案。


让我给你更详细的信息。 />

在VB6中,可以在几个项目中使用相同的表格:


样本

c:\ vb6 \\ \\ p1 \

c:\ vb6 \p2 \

c:\ vb6 \ commmon


我有一个frmUni in c:\vb6 \ common,我可以在p1和p2中使用它 - 我将

简单地添加到项目中。


不是这还有可能在.NET吗?


外部解决方案?


谢谢


" aaapaul" < lv **** @ gmx.netwrote in message

news:11 ********************* @ i38g2000prf.googlegro ups .com ...

我们计划使用

Visual Studio 2005来构建更强大的.NET应用程序系统(WindowsForms)。


我的一个问题是,如何设计物体,它们可以重复使用。


Eg我有一个表格(带有衍生文本框),应该在

几个项目中使用。


我试图将表格复制到另一个项目 - 没有成功。

添加为链接组件也不起作用。


我是否必须使用UserControls和dll?更新怎么样。


谁有这方面的经验。


感谢您的帮助

aaapaul

表格是否可以在同一解决方案中的项目中重复使用,还是在不同的解决方案中是否为


如果项目是在共同的解决方案中复制很简单,半自动就是
(选择< formname> .vb进行复制,支持文件也是自动复制的
),并添加链接到另一个项目也是

直接(右键点击解决方案资源管理器中的项目 - >添加

参考...)。

如果你有单独的解决方案,这是另一回事。


We are planning a greater .NET Application-System (WindowsForms) with
Visual Studio 2005.

One of my problem is, how to design the objects, that they can be
reused.

E.g. I have a form (with derived textboxes) that should be used in
several Projects.

I tried to copy the form to the other project - with no success.
Adding as a linked component didn′t work, too.

Do I have to work with UserControls and dlls? How about updates.

Who has experience in such things.

Thanks for help
aaapaul

解决方案

On 18/10/2007 in message
<11*********************@i38g2000prf.googlegroups. comaaapaul wrote:

>I tried to copy the form to the other project - with no success.
Adding as a linked component didn′t work, too.

Either of those approaches *should* work, linking is probably better since
you only have to modify/update the form once.

Is it the main form in each app? If so you should delete the ''Form1'' that
VS automatically adds and set your form as the startup form.
--
Jeff Gaines


Thanks Jeff, but I don′t understand your answer.

Let me give you more details.

In VB6 ist was possible to use the same form in several projects:

sample
c:\vb6\p1\
c:\vb6\p2\
c:\vb6\common

I had a frmUni in c:\vb6\common and I could use it in p1 and p2 - I
simple added it to the projects.

Isnt′t this possible in .NET any more?

Outer solutions?

Thanks


"aaapaul" <lv****@gmx.netwrote in message
news:11*********************@i38g2000prf.googlegro ups.com...
We are planning a greater .NET Application-System (WindowsForms) with
Visual Studio 2005.

One of my problem is, how to design the objects, that they can be
reused.

E.g. I have a form (with derived textboxes) that should be used in
several Projects.

I tried to copy the form to the other project - with no success.
Adding as a linked component didn′t work, too.

Do I have to work with UserControls and dlls? How about updates.

Who has experience in such things.

Thanks for help
aaapaul
Are the forms to be reused in projects within the same solution, or are they
in different solutions?
If the projects are in a common solution copying is simple and
semi-automatic (select the <formname>.vb to copy and the support files are
automatically copied as well), and adding a link to another project is also
straight forward (right-click on project in solution explorer->Add
reference...).
If you have separate solutions that''s a different matter.


这篇关于如何设计一个大型.NET项目 - 重用组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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