예제 #1
0
        /// <summary>
        /// Writes the data of this object to a csv string
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public string ToCsvData(string s = ";")
        {
            var csv = $"{StartTime.ToString()}{s}{EndTime.ToString()}{s}{CumulatedAmountBlockchain}{s}{CumulatedAmountBlockchainExCoinbase}{s}{AverageFee}{s}{AverageInputCount}{s}{AverageInputValue}{s}{AverageOutputCount}{s}{AverageOutputValue}{s}{AverageSizeInBytes}{s}{NumberOfBlocks}{s}{NumberOfTransactions}{s}{TransactionsPerBlock}{s}";

            if (AggregatedExchangeTransactions == null || !AggregatedExchangeTransactions.Any())
            {
                AggregatedExchangeTransactions = new List <AggregatedExchangeTransaction> {
                    new AggregatedExchangeTransaction()
                }
            }
            ;

            foreach (var aggregatedExchangeTransaction in AggregatedExchangeTransactions)
            {
                csv += aggregatedExchangeTransaction.ToCsvData(s) + s;
            }

            return(csv);
        }
예제 #2
0
        /// <summary>
        /// Writes the data of this object to a csv string
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public string ToCsvHeader(string s = ";")
        {
            var csv = $"StartTime{s}EndTime{s}CumulatedAmountBlockchain{s}CumulatedAmountBlockchainExCoinbase{s}AverageFee{s}AverageInputCount{s}AverageInputValue{s}AverageOutputCount{s}AverageOutputValue{s}AverageSizeInBytes{s}NumberOfBlocks{s}NumberOfTransactions{s}TransactionsPerBlock{s}";

            if (AggregatedExchangeTransactions == null || !AggregatedExchangeTransactions.Any())
            {
                AggregatedExchangeTransactions = new List <AggregatedExchangeTransaction> {
                    new AggregatedExchangeTransaction()
                }
            }
            ;

            foreach (var aggregatedExchangeTransaction in AggregatedExchangeTransactions)
            {
                csv += aggregatedExchangeTransaction.ToCsvHeader(s) + s;
            }

            return(csv);
        }