Henry's profileUtterances on Software E...PhotosBlogLists Tools Help
    August 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.”

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    Weblogs that reference this entry
    • None