部分类C#2.0 [英] Partial classes C# 2.0

查看:71
本文介绍了部分类C#2.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我知道我们可以在项目中使用C#中的

关键字''Partial''在多个源文件上定义一个类。我们可以使用''Patial''关键字在多个项目中定义类吗?我知道VB.Net不允许这样的b $ b,但是想知道它是否''可能使用C#?


Madhuri Mittal

Hi,

I know that we can define a class over multiple source files using the
keyword ''Partial'' in C# within a project. Can we define the class over
multiple projects using the ''Patial'' keyword- I know VB.Net does not allow
it, however was wondering if it''s possible using C#?

Madhuri Mittal

推荐答案




一个简单的测试将为您提供答案。 (我可以这样做,因为我没有

办公室里有VS2005)


AFAIK这是不可能的。你只能在同一个组装中这样做。


干杯,


-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局


" Madhuri Mittal" <马*********** @ discussions.microsoft.com>在消息中写道

新闻:E8 ********************************** @ microsof t.com ...
Hi,

A simple test will give you the answer to this. ( I can;t do it as I do not
have VS2005 in the office )

AFAIK this is not possible. you can only do this inside the same assembly.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Madhuri Mittal" <Ma***********@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...


我知道我们可以使用C#中的
关键字''Partial''在多个源文件上定义一个类在一个项目中。我们可以使用''Patial''关键字在多个项目中定义类 - 我知道VB.Net不允许它,但是想知道它是否可以使用C#?

Madhuri Mittal
Hi,

I know that we can define a class over multiple source files using the
keyword ''Partial'' in C# within a project. Can we define the class over
multiple projects using the ''Patial'' keyword- I know VB.Net does not allow
it, however was wondering if it''s possible using C#?

Madhuri Mittal



你绝对不能这样做,因为每个项目都编译成一个单独的程序集,类型的范围是一个程序集。换句话说,在运动时,棒组件中的Foo被认为是与Foo不同的类型是Quuz组件


问候


Richard Blewett - DevelopMentor
http://www.dotnetconsult.co。英国/博客
http://www.dotnetconsult.co.uk





简单的测试将为您提供答案。 (我可以这样做,因为我没有

办公室里有VS2005)


AFAIK这是不可能的。你只能在同一个组装中这样做。


干杯,


-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州交通局


" Madhuri Mittal" <马*********** @ discussions.microsoft.com>在消息中写道

新闻:E8 ********************************** @ microsof t.com ...
You definitely can''t do it as each project compiles into a separate assembly and types are scoped to an assembly. in other words, Foo in the Bar assembly is considered, by the runtime, to be a different type to Foo is the Quuz assembly

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

Hi,

A simple test will give you the answer to this. ( I can;t do it as I do not
have VS2005 in the office )

AFAIK this is not possible. you can only do this inside the same assembly.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Madhuri Mittal" <Ma***********@discussions.microsoft.com> wrote in message
news:E8**********************************@microsof t.com...


我知道我们可以使用C#中的
关键字''Partial''在多个源文件上定义一个类在一个项目中。我们可以使用''Patial''关键字在多个项目中定义类 - 我知道VB.Net不允许它,但是想知道它是否可以使用C#?

Madhuri Mittal
Hi,

I know that we can define a class over multiple source files using the
keyword ''Partial'' in C# within a project. Can we define the class over
multiple projects using the ''Patial'' keyword- I know VB.Net does not allow
it, however was wondering if it''s possible using C#?

Madhuri Mittal




[microsoft.public.dotnet.languages.csharp]



[microsoft.public.dotnet.languages.csharp]


这篇关于部分类C#2.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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