public int Test_Nested(Cls Nested_Cls) { int mi_RetCode = 100; ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// // ACCESS NESTED FIELDS/MEMBERS ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// ///////////////////////////////// // Test instance field access Nested_Cls.NestFldPubInst = 100; if (Nested_Cls.NestFldPubInst != 100) { mi_RetCode = 0; } Nested_Cls.NestFldAsmInst = 100; if (Nested_Cls.NestFldAsmInst != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test static field access Cls.NestFldPubStat = 100; if (Cls.NestFldPubStat != 100) { mi_RetCode = 0; } Cls.NestFldAsmStat = 100; if (Cls.NestFldAsmStat != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test instance method access if (Nested_Cls.NestMethPubInst() != 100) { mi_RetCode = 0; } if (Nested_Cls.NestMethAsmInst() != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test static method access if (Cls.NestMethPubStat() != 100) { mi_RetCode = 0; } if (Cls.NestMethAsmStat() != 100) { mi_RetCode = 0; } //////////////////////////////////////////// // Test access from within the nested class if (Nested_Cls.Test() != 100) { mi_RetCode = 0; } return(mi_RetCode); }
public int Test_Nested(Cls Nested_Cls) { int mi_RetCode = 100; ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// // ACCESS NESTED FIELDS/MEMBERS ///////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////// ///////////////////////////////// // Test instance field access Nested_Cls.NestFldPubInst = 100; if (Nested_Cls.NestFldPubInst != 100) { mi_RetCode = 0; } //@csharp - Note, CSharp won't allow access of family or private members of a nested class... //from it's enclosing class. Nested_Cls.NestFldAsmInst = 100; if (Nested_Cls.NestFldAsmInst != 100) { mi_RetCode = 0; } Nested_Cls.NestFldFoaInst = 100; if (Nested_Cls.NestFldFoaInst != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test static field access Cls.NestFldPubStat = 100; if (Cls.NestFldPubStat != 100) { mi_RetCode = 0; } //@csharp - See last @csharp Cls.NestFldAsmStat = 100; if (Cls.NestFldAsmStat != 100) { mi_RetCode = 0; } Cls.NestFldFoaStat = 100; if (Cls.NestFldFoaStat != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test instance method access if (Nested_Cls.NestMethPubInst() != 100) { mi_RetCode = 0; } //@csharp - See last @csharp if (Nested_Cls.NestMethAsmInst() != 100) { mi_RetCode = 0; } if (Nested_Cls.NestMethFoaInst() != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test static method access if (Cls.NestMethPubStat() != 100) { mi_RetCode = 0; } //@csharp - See last @csharp if (Cls.NestMethAsmStat() != 100) { mi_RetCode = 0; } if (Cls.NestMethFoaStat() != 100) { mi_RetCode = 0; } ///////////////////////////////// // Test virtual method access if (Nested_Cls.NestMethPubVirt() != 100) { mi_RetCode = 0; } //@csharp - See last @csharp if (Nested_Cls.NestMethAsmVirt() != 100) { mi_RetCode = 0; } if (Nested_Cls.NestMethFoaVirt() != 100) { mi_RetCode = 0; } //////////////////////////////////////////// // Test access from within the nested class if (Nested_Cls.Test() != 100) { mi_RetCode = 0; } return(mi_RetCode); }