home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / IntroDev / CompTest / CompVC / CompVC.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  677 b   |  29 lines

  1. #using <mscorlib.dll>
  2. using namespace System;
  3.  
  4. namespace CompVC {
  5.     __gc public class StringComponent {
  6.     private:
  7.         String* StringsSet[];
  8.     
  9.     public:
  10.         StringComponent() {
  11.             StringsSet = new String*[4]; 
  12.             StringsSet[0] = new String(S"VC String 0");
  13.             StringsSet[1] = new String(S"VC String 1");
  14.             StringsSet[2] = new String(S"VC String 2");
  15.             StringsSet[3] = new String(S"VC String 3");
  16.         }
  17.     
  18.         String* GetString(int index) {
  19.             if ((index < 0) || (index >= StringsSet->Length)) {
  20.                 throw new IndexOutOfRangeException();
  21.             }            
  22.             return StringsSet[index];
  23.         }
  24.  
  25.         __property int get_Count() { return StringsSet->Length; }
  26.     };
  27.  
  28. };
  29.