예제 #1
0
 public void PriceUpdateStatus(FilePriceSource source, SrcStatus status)
 {
     try
     {
         if (status == SrcStatus.ended)
         {
             if (source.RepeatOnEnd)
             {
                 // just reopen
                 source.Stop();
                 source.Start(source.FilePath);
             }
             else
             {
                 // we are done
             }
         }
     }
     catch (Exception myE)
     {
         log.Error("PriceUpdateStatus", myE);
     }
 }
예제 #2
0
 public void AddPriceFile(string mnemonic, string filePath, int interval, bool runRealTime, bool repeatOnEnd, bool playOnSubscribe)
 {
     try
     {
         FilePriceSource pxSrc = new FilePriceSource(this);
         _filePrices.Add(mnemonic, pxSrc);
         pxSrc.PriceUpdate += this.PriceUpdate;
         pxSrc.PriceUpdateStatus += this.PriceUpdateStatus;
         pxSrc.Interval = interval;
         pxSrc.RunRealTime = runRealTime;
         pxSrc.RepeatOnEnd = repeatOnEnd;
         pxSrc.FilePath = filePath;
         if (!playOnSubscribe)
         {
             pxSrc.Start(filePath);
         }
         else
         {
             pxSrc.SetUpProductNoRun(filePath);
         }
     }
     catch (Exception myE)
     {
         log.Error("AddPriceFile", myE);
     }
 }