We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
我对 Eclipse 不熟悉,但无论如何我都会尝试回答......
.NET 中没有“包”的概念。有些程序集包含类,并且这些类在命名空间中组织。要添加程序集引用,请右键单击项目并选择“添加引用”。如果要自动导入包含正在使用的类的命名空间,请将脱字符号放在类名称上,然后键入 Ctrl + .。它将建议要导入的名称空间。
只需输入
override
并按Space,它就会建议要覆盖的方法列表(包括Equals
和ToString
)输入
try
并点击 Tab,它将完成try/catch 块(这称为代码片段)。无法自动捕获正确的异常,因为与 Java 不同,C# 方法不声明它们可以抛出哪些异常。您可以在此处找到所有 .NET Framework 类的参考(这是例如
Object
类)。恕我直言,它比 Java API 文档方便得多,但我想这是一个品味和习惯的问题...您还可以下载离线文档,它提供了类、成员、关键字等的索引。I'm not familiar with Eclipse, but I'll try to answer anyway...
There is no notion of "package" in .NET. There are assemblies that contain classes, and these classes are organized in namespaces. To add an assembly reference, right click on the project and select "Add reference". If you want to automatically import the namespace that contains a class you're using, put the caret on the class name and type Ctrl + .. It will suggest the namespace to import.
Just type
override
and hit Space, it will suggest a list of methods to override (includingEquals
andToString
)Type
try
and hit Tab, it will complete the try/catch block (this is known as a code snippet). There is no way to automatically catch the right exception, because unlike Java, C# methods don't declare what exceptions they can throw.You can find the reference for all .NET Framework classes here (here's the
Object
class for instance). IMHO it's much more convenient than the Java API documentation, but I guess it's a matter of taste and habit... You can also download the offline documentation, which provides an index of classes, members, keywords, etc.键盘快捷键,来自 MSDN。
我发现自己最常使用的是:
就文档而言,我实际上发现 MSDN 是一个很好的资源。有时,真正找到我要找的东西是最困难的部分,但谷歌很容易解决这个问题。然而,至少根据我的经验,写作通常是清晰而透彻的。如果您还没有看到这些,也许它们会有一些用处,特别是第二个链接。
MSDN - .NET Framework 4
MSDN - .NET Framework 类库
我知道您说过您不喜欢它,但是在我看来,这确实是最好的。
Keyboard shortcuts, via MSDN.
The ones I find myself using the most often are:
As far as documentation goes, I actually find MSDN to be a great resource. Sometimes actually finding what I'm looking for is the hardest part, but google solves that pretty easily. The writing, however, is typically clear and thorough, at least in my experience. If you haven't seen these, perhaps they will be of some use, particularly the 2nd link.
MSDN - .NET Framework 4
MSDN - .NET Framework Class Library
I know you said you don't love it, but it truly is the best available in my opinion.
Eclipse 中的
Ctrl+Shift+O
相当于Shift+Alt+F10
。对于 try-catch 生成,使用鼠标或 Shift 和箭头选择文本,然后按ctrl+k
然后按ctrl+s
。出现一个窗口,您可以在其中浏览代码块周围的内容,例如if
、try
等。The equivalent of
Ctrl+Shift+O
in Eclipse isShift+Alt+F10
. For the try-catch generation select the text using mouse or shift and arrows followed by thatctrl+k
thenctrl+s
. A window appears where you can browse what to surround your code block with likeif
,try
etc.