예제 #1
0
 public static BetfairE.Runner FindRunner(BetfairE.Market market, int selectionId)
 {
     if (market == null)
     {
         return(null);
     }
     foreach (BetfairE.Runner runner in market.runners)
     {
         if (runner.selectionId == selectionId)
         {
             return(runner);
         }
     }
     return(null);
 }
예제 #2
0
        public static string GetMarketName(BetfairE.Market market)
        {
            string prefix = string.Empty;

            if (market.menuPath.IndexOf('\\') != -1)
            {
                string[] parts = market.menuPath.Split('\\');
                prefix = parts[parts.Length - 1] + " - ";
            }
            else if (market.menuPath.Length > 0)
            {
                prefix = market.menuPath + " - ";
            }
            if (market.marketDisplayTime > DateTime.MinValue)
            {
                return(string.Format("{0}{1:HH:mm} {2}", prefix, market.marketDisplayTime.ToLocalTime(), market.name));
            }
            else
            {
                return(string.Format("{0}{1}", prefix, market.name));
            }
        }