public string GetBarSettingsFriendlyName(BarSettings sets) { if (sets == null) { return(string.Empty); } var exists = barSettingsSeries.FirstOrDefault(bs => bs == sets); return(exists == null?sets.ToString() : exists.Title); }
public string GetBarSettingsFriendlyName(BarSettings sets) { var exists = barSettingsSeries.FirstOrDefault(bs => bs == sets); return !ReferenceEquals(exists, null) ? exists.Title : sets.ToString(); }
public static bool PutForecast(int categoryId, string ticker, BarSettings timeframe, string xmlForecast) { var wc = new WebClient(); if (!string.IsNullOrEmpty(username)) wc.Credentials = new NetworkCredential(username, pass); var requestParams = new NameValueCollection { { TradeSignalXml.ReqPtrForecastCategory, categoryId.ToString() }, { TradeSignalXml.ReqPtrForecastTicker, ticker }, { TradeSignalXml.ReqPtrForecastTimeframe, timeframe.ToString(TradeSignalXml.TimeframeSeparator) } }; wc.QueryString = requestParams; try { var responseBytes = wc.UploadData(url, "PUT", TradeSignalXml.DefaultEncoding.GetBytes(xmlForecast)); var respString = TradeSignalXml.DefaultEncoding.GetString(responseBytes); return respString == "OK"; } catch (Exception ex) { Logger.Error("Ошибка в PutForecast()", ex); return false; } }
public string GetBarSettingsFriendlyName(BarSettings sets) { var exists = barSettingsSeries.FirstOrDefault(bs => bs == sets); return(!ReferenceEquals(exists, null) ? exists.Title : sets.ToString()); }