C#具有VB的“with”和“命令? [英] C# has VB's "with" command?

查看:69
本文介绍了C#具有VB的“with”和“命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#有VB'的和命令?


我喜欢VB的命令,为什么不知道C#有没有?

解决方案

''''是VB中的语句。它本来是C#的一个很好的补充,但它现在不是这样的
。您必须完全限定C#中的Object.Proporties
http://msdn.microsoft.com/library/de...rdsptozvba.asp
http://msdn.microsoft .com / library / de ... eywords_pg.asp


" abc my vclass" <我******** @ myclass.com>在消息中写道

news:e6 ************** @ TK2MSFTNGP11.phx.gbl ...

C#有VB'' s" with命令?

我喜欢VB的命令,为什么不知道C#有没有?



我不同意这个声明,它将是

语言的一个很好的补充。查看以下询问设计师关于MS

网站的部分,了解更多关于它被遗漏的原因:

http://msdn.microsoft.com/vcsharp/pr...t/default.aspx


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C#MVP]

- < a href =mailto:mv*@spam.guard.caspershouse.com> mv*@spam.guard.caspershouse.com


news:ec ************* @ TK2MSFTNGP10.phx.gbl ...

''with''是VB中的声明。它本来是C#的一个很好的补充,但现在不是这样。您必须完全限定C#中的Object.Proporties
http://msdn.microsoft.com/library/de...rdsptozvba.asp
http://msdn.microsoft .com / library / de ... eywords_pg.asp


" abc my vclass" <我******** @ myclass.com>在消息中写道
新闻:e6 ************** @ TK2MSFTNGP11.phx.gbl ...

C#有VB'的带和;命令?

我喜欢VB的命令,为什么不知道C#有没有?




链接上给出的理由实际上并不比我想要它,因为它很容易让我像这样工作。 MS从不担心制作复杂的东西。只有可能有一些逻辑的东西IMHO才是C ++关系。 C#

在C / C ++类中更多。但是,这是正确的,拥有With并不是很大的打字和可读性的好处,但有时当设置吨
属性时它可能很容易,但ctrl + v工作很好。


Nicholas Paldino [.NET / C#MVP]" < mv*@spam.guard.caspershouse.com>写在

消息新闻:ul ************** @ TK2MSFTNGP11.phx.gbl ...

我不同意声明它将是
语言的一个很好的补充。查看以下询问设计师 MS
网站上有关其原因的更多信息:

http://msdn.microsoft.com/vcsharp/pr...t/default.aspx

希望这会有所帮助。

-
- Nicholas Paldino [.NET / C#MVP]
- mv*@spam.guard.caspershouse.com

Pohihihi <无***** @ hotmail.com>在消息中写道
新闻:ec ************* @ TK2MSFTNGP10.phx.gbl ...

''''是VB中的一个语句。它本来是C#的一个很好的补充,但现在不是这样。您必须完全限定C#中的Object.Proporties
http://msdn.microsoft.com/library/de...rdsptozvba.asp
http://msdn.microsoft .com / library / de ... eywords_pg.asp


" abc my vclass" <我******** @ myclass.com>在消息中写道
新闻:e6 ************** @ TK2MSFTNGP11.phx.gbl ...

C#有VB'的带和;命令?

我喜欢VB的命令,为什么不知道C#有没有?





C# has VB''s "with" command?

I like VB''s with command, why don''t know C# has it or not?

解决方案

''With'' is a statement in VB. It would have been a nice addition to C# but it
is not so for now. You have to fully qualify Object.Proporties in C#

http://msdn.microsoft.com/library/de...rdsptozvba.asp
http://msdn.microsoft.com/library/de...eywords_pg.asp


"abc my vclass" <my********@myclass.com> wrote in message
news:e6**************@TK2MSFTNGP11.phx.gbl...

C# has VB''s "with" command?

I like VB''s with command, why don''t know C# has it or not?



I disagree with the statement that it would be a nice addition to the
language. Check out the following "ask a designer" section on the MS
website for more information on why it was left out:

http://msdn.microsoft.com/vcsharp/pr...t/default.aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pohihihi" <no*****@hotmail.com> wrote in message
news:ec*************@TK2MSFTNGP10.phx.gbl...

''With'' is a statement in VB. It would have been a nice addition to C# but
it is not so for now. You have to fully qualify Object.Proporties in C#

http://msdn.microsoft.com/library/de...rdsptozvba.asp
http://msdn.microsoft.com/library/de...eywords_pg.asp


"abc my vclass" <my********@myclass.com> wrote in message
news:e6**************@TK2MSFTNGP11.phx.gbl...

C# has VB''s "with" command?

I like VB''s with command, why don''t know C# has it or not?




Reasons given on the link are actually no better than "I want it cause it is
easy for me to work like that". MS was never worried about making things
complex. Only thing that might have some logic IMHO is of C++ relation. C#
is more in the class of C/C++. But yes that is right that having With is not
a big typing and readability benefit but still sometimes when setting tons
of properties it might have been easy, but ctrl + v works just fine.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ul**************@TK2MSFTNGP11.phx.gbl...

I disagree with the statement that it would be a nice addition to the
language. Check out the following "ask a designer" section on the MS
website for more information on why it was left out:

http://msdn.microsoft.com/vcsharp/pr...t/default.aspx

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Pohihihi" <no*****@hotmail.com> wrote in message
news:ec*************@TK2MSFTNGP10.phx.gbl...

''With'' is a statement in VB. It would have been a nice addition to C# but
it is not so for now. You have to fully qualify Object.Proporties in C#

http://msdn.microsoft.com/library/de...rdsptozvba.asp
http://msdn.microsoft.com/library/de...eywords_pg.asp


"abc my vclass" <my********@myclass.com> wrote in message
news:e6**************@TK2MSFTNGP11.phx.gbl...

C# has VB''s "with" command?

I like VB''s with command, why don''t know C# has it or not?





这篇关于C#具有VB的“with”和“命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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