Henry 的个人资料Utterances on Software E...照片日志列表 工具 帮助
8月17日

The type '<class name>' is made of several partial classes in the same file

Practical Software Masochism™ has hit a new bottom:

http://msdn.microsoft.com/en-us/library/bb129230.aspx

Some errors are not likely to happen. I mean, why on earth would someone try to create multiple partial class declarations in the same file?

http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis

SA1201: ElementsMustAppearInTheCorrectOrder

When implementing an interface, it is sometimes desirable to group all members of the interface next to one another. This will sometimes require violating this rule, if the interface contains elements of different types. This problem can be solved through the use of partial classes.

1. Add the partial attribute to the class, if the class is not already partial.

2. Add a second partial class with the same name. It is possible to place this in the same file, just below the original class, or within a second file.

3. Move the interface inheritance and all members of the interface implementation to the second part of the class.

Well, I guess I have to use multiple files then. But I’m not sure how that could possibly

“increase the readability and maintainability of the file and encourage code reuse.”

8月9日

Want to be a manager in the software business?

Look at this video with Scott Hanselman and Chris Sells.

Keep in mind also that this is about Microsoft and not some company where software isn’t the heart and soul of most things they do.

Then, think again.