public override string ConvertToString(object value, IWriterRow row, MemberMapData memberMapData)
    {
        var list = ((List <MyCustom>)value).OrderBy(m => m.Id).ToList();

        foreach (var item in list)
        {
            row.WriteField(item.Id);
            row.WriteField(item.Property1);
            row.WriteField(item.Property2);
        }
        return(null);
    }
Exemplo n.º 2
0
 public override string ConvertToString(object value, IWriterRow row, MemberMapData memberMapData)
 {
   var bars = value as List<Bar>;
   if (bars == null) return null;
   foreach (var bar in bars)
   {
     row.WriteField(bar.BarID);
     row.WriteField(bar.BarProperty1);
     row.WriteField(bar.BarProperty2);
     row.WriteField(bar.BarProperty3);
   }
   return null;
 }
Exemplo n.º 3
0
        private static void WriteHeader(IWriterRow csvWriter, int gameNum)
        {
            csvWriter.WriteField($"Game {gameNum}");
            var selected = gameNum % 2 == 1 ? "Home" : "Away";

            csvWriter.WriteField($"{selected} Side Selection");
            csvWriter.WriteField("Winner");
            csvWriter.WriteField("ProDraft Spectate Link");
            csvWriter.WriteField("Match History Link");
            csvWriter.WriteField("Blue Player");
            csvWriter.WriteField("Blue Champion");
            csvWriter.WriteField("Red Player");
            csvWriter.WriteField("Red Champion");
        }
Exemplo n.º 4
0
 private static void WriteHeader(IWriterRow csvWriter, int gameNum, GameDetail gameDetail)
 {
     csvWriter.WriteField($"Game {gameNum}");
     csvWriter.WriteField("Match Replay Url");
     csvWriter.WriteField("Team on Blue Side");
     csvWriter.WriteField("Winner");
     csvWriter.WriteField("ProDraft Spectate Link");
     csvWriter.WriteField("Post Game Screenshot");
 }
Exemplo n.º 5
0
        /// <summary>
        /// Converts the object to a string.
        /// </summary>
        /// <param name="value">The object to convert to a string.</param>
        /// <param name="row"></param>
        /// <param name="memberMapData"></param>
        /// <returns>The string representation of the object.</returns>
        public override string ConvertToString(object value, IWriterRow row, MemberMapData memberMapData)
        {
            var list = value as IEnumerable;

            if (list == null)
            {
                return(base.ConvertToString(value, row, memberMapData));
            }

            foreach (var item in list)
            {
                row.WriteField(item.ToString());
            }

            return(null);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Converts the object to a string.
        /// </summary>
        /// <param name="value">The object to convert to a string.</param>
        /// <param name="row">The <see cref="IWriterRow"/> for the current record.</param>
        /// <param name="memberMapData">The <see cref="MemberMapData"/> for the member being written.</param>
        /// <returns>The string representation of the object.</returns>
        public override string ConvertToString(object value, IWriterRow row, MemberMapData memberMapData)
        {
            var dictionary = value as IDictionary;

            if (dictionary == null)
            {
                return(base.ConvertToString(value, row, memberMapData));
            }

            foreach (DictionaryEntry entry in dictionary)
            {
                row.WriteField(entry.Value);
            }

            return(null);
        }