开发者

Functions with <>s and listing partial classes under a single file?

What 开发者_C百科are functions with <> called? I mean, I usually see them in defining lists like List<> SortedList<> etc. And they get value types into their parameters (as I've seen). (List<bool> etc.). Could I create a class that gets value types as parameters like that?

CustomClass<bool, int>(32, "asd") test;

Other question: Could I list seperated but partial classes under a single file (like Form's form.designer.cs and form.resx)


Generics

Other question: no afaik (if you talk about vs solution explorer) but you can put partial classes into single file.


In general, have multiple partial classes in the same file. The only limitation is that they are part of the same assembly.

However, the Form1.designer.cs and Form1.resx files are generated by VS's editing tools. If you try messing around with generated files, they just get generated again. Furthermore, the .resx file isn't even C# -- it's XML!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜