Exemplo n.º 1
0
 public static bool Exists <T>(TypedFile <T> typedfile, TestDelegate <T> testDelegate)
 {
     typedfile.Reset();
     while (!typedfile.Eof)
     {
         if (testDelegate(typedfile.Read()))
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
 public static bool CheckForAll <T>(TypedFile <T> typedfile, TestDelegate <T> testDelegate)
 {
     typedfile.Reset();
     while (!typedfile.Eof)
     {
         T t = typedfile.Read();
         if (!testDelegate(t))
         {
             return(false);
         }
     }
     return(true);
 }
Exemplo n.º 3
0
        public static T[] Read <T>(TypedFile <T> typedfile)
        {
            typedfile.Reset();
            T[] record = new T[typedfile.FileSize];
            int i      = 0;

            //typedfile.Reset();
            while (!typedfile.Eof)
            {
                record[i++] = typedfile.Read();
            }

            return(record);
        }