Code Clean-up and reorder type members

(on r#7.0)

I use the code clean-up feature a lot (every few minutes sometimes), and I have ‘reorder type members enabled’ as generally that’s what I want. Whoever, in some classes the order of properties is significant (i.e. when serializing). As my use of code clean-up is almost habitual I seldom think before I run it. As a result I often reorganise and therefore break classes used for serialisation. Is there an option to make a class or section of code as one that should not be re-ordered?

Comment actions Permalink

Try modifying this part:

  <!--Do not reorder COM interfaces and structs marked by StructLayout attribute-->
      <Or Weight="100">
          <Kind Is="interface"/>
            <HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"/>
            <HasAttribute CLRName="System.Runtime.InteropServices.ComImport"/>
        <HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"/>
    <HasAttribute CLRName="System.SerializableAttribute"/>

I haven't tested it, but wouldn't be surprised if it works. You may have to fiddle with it.

Comment actions Permalink

Thanks, that worked!


Please sign in to leave a comment.