本文整理汇总了C#中CsvRow.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# CsvRow.ToArray方法的具体用法?C# CsvRow.ToArray怎么用?C# CsvRow.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CsvRow
的用法示例。
在下文中一共展示了CsvRow.ToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParseRowList
/// <summary>
/// Row is a LIST containing 4 elements:
/// row[0] - word
/// row[1] - definition
/// row[2] - type
/// row[3] - date added
/// Parsed data is converted into appropiate word types and added to the Output field
/// Data that was couldn't be parrsed is put as a string into OutputRevokedElements list
/// </summary>
/// <param name="row"></param>
private void ParseRowList(CsvRow row)
{
if (row.Count >= 4)
{
// We can put different words (nouns, verbs etc.) into one list(MyWord) bcos they inherit from MyWord
if (row[2].ToLower().Equals("noun")) Output.Add(new Noun(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("verb")) Output.Add(new Verb(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("adverb")) Output.Add(new Adverb(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("adjective")) Output.Add(new Adjective(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("saying")) Output.Add(new Saying(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("preposition")) Output.Add(new Preposition(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("idiom")) Output.Add(new Idiom(row[0], row[1], row[2], row[3]));
else if (row[2].ToLower().Equals("phrasal verb")) Output.Add(new PhrasalVerb(row[0], row[1], row[2], row[3]));
else Output.Add(new MyWord(row[0], row[1], row[2], row[3]));
}
else OutputRevokedElements.Add(string.Join(",", row.ToArray()));
}