Page 12 - CSharp/C#
P. 12

Syntax                                                                                             181
          Examples                                                                                           181


            Checked and Unchecked                                                                            181
            Checked and Unchecked as a scope                                                                 181

        Chapter 32: CLSCompliantAttribute                                                                   182


          Syntax                                                                                             182

          Parameters                                                                                         182

          Remarks                                                                                            182

          Examples                                                                                           182

            Access Modifier to which CLS rules apply                                                         182

            Violation of CLS rule: Unsigned types / sbyte                                                    183
            Violation of CLS rule: Same naming                                                               184

            Violation of CLS rule: Identifier _                                                              184

            Violation of CLS rule: Inherit from non CLSComplaint class                                       185

        Chapter 33: Code Contracts                                                                          186

          Syntax                                                                                             186


          Remarks                                                                                            186
          Examples                                                                                           186


            Preconditions                                                                                    186
            Postconditions                                                                                   187

            Invariants                                                                                       187

            Defining Contracts on Interface                                                                  188

        Chapter 34: Code Contracts and Assertions                                                           191

          Examples                                                                                           191

            Assertions to check logic should always be true                                                  191

        Chapter 35: Collection Initializers                                                                 192


          Remarks                                                                                            192

          Examples                                                                                           192

            Collection initializers                                                                          192
            C# 6 Index Initializers                                                                          192


        Dictionary Initialization                                                                           193

          Collection initializers in custom classes                                                          194
   7   8   9   10   11   12   13   14   15   16   17