home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / IntroDev / CompTest / CompCS / CompCS.cs < prev    next >
Encoding:
Text File  |  2000-06-23  |  534 b   |  27 lines

  1. using System;
  2. namespace CompCS {
  3.     public class StringComponent {
  4.         private string[] StringsSet; 
  5.         
  6.         public StringComponent() {
  7.             StringsSet = new string[] {
  8.                 "C# String 0",
  9.                 "C# String 1",
  10.                 "C# String 2",
  11.                 "C# String 3"            
  12.             };
  13.         }
  14.         
  15.         public string GetString(int index) {
  16.             if ((index < 0) || (index >= StringsSet.Length)) {
  17.                 throw new IndexOutOfRangeException();
  18.             }            
  19.             return StringsSet[index];
  20.         }
  21.  
  22.         public int Count {
  23.             get { return StringsSet.Length; }
  24.         }    
  25.     }
  26. }
  27.