Beispiel #1
0
        public static string[] ToString(Tuple <Asset, Asset>[] values, AssetToupleFormat format = AssetToupleFormat.NamesSeparated)
        {
            if (values.IsNullOrEmpty())
            {
                return(null);
            }

            List <string> list = new List <string>();

            foreach (var v in values)
            {
                list.AddIfValueIsNotNull(Kraken.ToString(v, format));
            }

            return(list.ToArray());
        }
Beispiel #2
0
        public static string ToString(Tuple <Asset, Asset> values, AssetToupleFormat format = AssetToupleFormat.NamesSeparated)
        {
            if (values == null)
            {
                return(null);
            }

            Asset  _base  = values.Item1;
            Asset  _quote = values.Item2;
            string sb     = _base.GetEnumName();
            string sq     = _quote.GetEnumName();
            string sbd    = _base.GetEnumDescription();
            string sqd    = _quote.GetEnumDescription();
            string sbc    = IsCurrency(_base) ? "Z" + sb : "X" + sb;
            string sqc    = IsCurrency(_quote) ? "Z" + sq : "X" + sq;

            if (format == AssetToupleFormat.Names)
            {
                return(string.Format("{0}{1}", sb, sq));
            }
            else if (format == AssetToupleFormat.NamesSeparated)
            {
                return(string.Format("{0} {1}", sb, sq));
            }
            else if (format == AssetToupleFormat.Descriptions)
            {
                return(string.Format("{0}{1}", sbd, sqd));
            }
            else if (format == AssetToupleFormat.DescriptionsSeparated)
            {
                return(string.Format("{0} {1}", sbd, sqd));
            }
            else if (format == AssetToupleFormat.CurrencyNames)
            {
                return(string.Format("{0}{1}", sbc, sqc));
            }
            else if (format == AssetToupleFormat.CurrencyNamesSeparated)
            {
                return(string.Format("{0} {1}", sbc, sqc));
            }
            else
            {
                return(null);
            }
        }