Ejemplo n.º 1
0
        public static bool BuildIndex(string folder, string[,] tickfiles, out HistSimIndex hsi, bool start, bool saveindex, int interval, DebugDelegate debug)
        {
            hsi = new HistSimIndex(folder, tickfiles, interval);
            if (debug != null)
            {
                hsi.GotDebug += new DebugDelegate(debug);
            }
            bool ok = true;

            if (start)
            {
                hsi.Start();
            }
            if (start && saveindex)
            {
                bool save = ToFile(hsi, idxfold(folder), debug);
                if (debug != null)
                {
                    debug(save ? ("Saved index: " + folder) : "Saving index failed.");
                }
                ok &= save;
            }
            ok &= start ? hsi.isComplete : hsi.TOC.Length > 0;
            return(ok);
        }
Ejemplo n.º 2
0
 public static bool BuildIndex(string folder, string[,] tickfiles, out HistSimIndex hsi, bool start, bool saveindex, int interval, DebugDelegate debug)
 {
     hsi = new HistSimIndex(folder,tickfiles,interval);
     if (debug!=null)
         hsi.GotDebug+=new DebugDelegate(debug);
     bool ok = true;
     if (start)
         hsi.Start();
     if (start && saveindex)
     {
         bool save = ToFile(hsi, idxfold(folder), debug);
         if (debug != null)
             debug(save ? ("Saved index: " + folder) : "Saving index failed.");
         ok &= save;
     }
     ok &= start ? hsi.isComplete : hsi.TOC.Length > 0;
     return ok;
 }