本文整理汇总了C#中Row类的典型用法代码示例。如果您正苦于以下问题:C# Row类的具体用法?C# Row怎么用?C# Row使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Row类属于命名空间,在下文中一共展示了Row类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
/// <summary>
/// Main processing script.
/// </summary>
/// <param name="input">The input row.</param>
/// <param name="outputRow">The output row.</param>
/// <param name="args">The arguments.</param>
/// <returns>The IEnumerable output row.</returns>
public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
{
string frameShift = args[0];
string frameLength = args[1];
Directory.CreateDirectory("relatedFeatures");
foreach (var row in input.Rows)
{
outputRow["WaveID"].Set(row["WaveID"].String);
outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
outputRow["RawF0"].Set(row["RawF0"].String);
outputRow["LPCC"].Set(row["LPCC"].Binary);
outputRow["OF0"].Set(row["OF0"].String);
outputRow["LSP"].Set(row["LSP"].Binary);
outputRow["Pow"].Set(row["Pow"].String);
outputRow["MBE"].Set(row["MBE"].String);
outputRow["NCCF"].Set(row["NCCF"].String);
string waveId = row["WaveID"].String;
string wave = JobBase.GenerateLocalFile(waveId, row["WaveBinary"].Binary, FileExtensions.Waveform);
string relatedFeatureFile = Path.Combine("relatedFeatures", waveId + "." + FileExtensions.Text);
string[] argument = { wave, relatedFeatureFile, frameShift, frameLength };
F0ExtractorCOSMOS.ExtractRelatedFeaturesOneFile(argument, null);
outputRow["RF"].Set(File.ReadAllText(relatedFeatureFile));
yield return outputRow;
}
}
示例2: Parse
public static Table Parse(IRestResponse response)
{
Table table = new Table();
StringReader reader = new StringReader(response.Content);
string readLine = reader.ReadLine();
if (readLine != null)
{
string[] collection = readLine.Split(Separator);
foreach (string column in collection)
{
table.Columns.Add(column.TrimStart('"').TrimEnd('"'));
}
}
string line = reader.ReadLine();
while (!string.IsNullOrEmpty(line))
{
Row row = new Row(line);
table.Rows.Add(row);
line = reader.ReadLine();
}
return table;
}
示例3: AddRow
private void AddRow(string name, int price)
{
Row row = new Row();
row["name"] = name;
row["price"] = price;
rows.Add(row);
}
示例4: Process
/// <summary>
/// Main processing script.
/// </summary>
/// <param name="input">The input row.</param>
/// <param name="outputRow">The output row.</param>
/// <param name="args">The arguments.</param>
/// <returns>The IEnumerable output row.</returns>
public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
{
string f0Dir = "f0";
string expandDir = "expand";
string svmDir = "svm";
Directory.CreateDirectory(f0Dir);
Directory.CreateDirectory(expandDir);
Directory.CreateDirectory(svmDir);
foreach (var row in input.Rows)
{
outputRow["WaveID"].Set(row["WaveID"].String);
outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
outputRow["RawF0"].Set(row["RawF0"].String);
outputRow["LPCC"].Set(row["LPCC"].Binary);
outputRow["OF0"].Set(row["OF0"].String);
outputRow["LSP"].Set(row["LSP"].Binary);
outputRow["Pow"].Set(row["Pow"].String);
outputRow["MBE"].Set(row["MBE"].String);
string waveId = row["WaveID"].String;
string f0File = JobBase.GenerateLocalFile(waveId, row["RawF0"].String, FileExtensions.F0File, true, f0Dir);
string expandFeatureFile = JobBase.GenerateLocalFile(waveId, row["EXP"].String, FileExtensions.Text, false, expandDir);
string svmFile = Path.Combine(svmDir, waveId + "." + FileExtensions.Text);
string[] argument = { f0File, expandFeatureFile, svmFile };
F0ExtractorCOSMOS.FormatFeaturesOneFile(argument, null);
outputRow["SVM"].Set(File.ReadAllText(svmFile));
yield return outputRow;
}
}
示例5: CreateCell
private NPOI.SS.UserModel.Cell CreateCell(Cell cell, Row currentRow, int columnOrdinal)
{
var nCell = currentRow.CreateCell(columnOrdinal, CellType.STRING);
nCell.CellStyle = GetCellStyle(cell);
return nCell;
}
示例6: Transform
public Row Transform(Row row) {
foreach (var date in _dates.Where(date => (DateTime)row[date] < _minDate)) {
row[date] = _minDate;
}
Increment();
return row;
}
示例7: Process
/// <summary>
/// Main processing script.
/// </summary>
/// <param name="input">The input row.</param>
/// <param name="outputRow">The output row.</param>
/// <param name="args">The arguments.</param>
/// <returns>The IEnumerable output row.</returns>
public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
{
string uvDir = "uv";
string scaledSVMDir = "scaledSVM";
Directory.CreateDirectory(uvDir);
Directory.CreateDirectory(scaledSVMDir);
foreach (var row in input.Rows)
{
outputRow["WaveID"].Set(row["WaveID"].String);
outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
outputRow["RawF0"].Set(row["RawF0"].String);
outputRow["LPCC"].Set(row["LPCC"].Binary);
outputRow["OF0"].Set(row["OF0"].String);
outputRow["LSP"].Set(row["LSP"].Binary);
outputRow["Pow"].Set(row["Pow"].String);
outputRow["MBE"].Set(row["MBE"].String);
string waveId = row["WaveID"].String;
string scaledSVMFile = JobBase.GenerateLocalFile(waveId, row["SSVM"].String, FileExtensions.Text, false, scaledSVMDir);
string uvFile = Path.Combine(uvDir, waveId + "." + FileExtensions.Text);
string argument = Helper.NeutralFormat(" \"{0}\" \"{1}\" \"{2}\"", scaledSVMFile, Path.GetFileName(this.Job.ReplaceVariable["UVMODELFILE"]), uvFile);
CommandLine.RunCommand(Path.GetFileName(this.Job.ReplaceVariable["SVMPREDICTTOOL"]),
argument, "./");
outputRow["UV"].Set(JobBase.GetTextFile(uvFile));
yield return outputRow;
}
}
示例8: GenerateReport
public static void GenerateReport(List<DataObject> objects)
{
SheetData data = new SheetData();
//add column names to the first row
Row header = new Row();
header.RowIndex = (UInt32)1;
foreach (DataObject obj in objects)
{
Cell headerCell = createTextCell(objects.IndexOf(obj) + 1, 1, obj.Name);
header.AppendChild(headerCell);
}
data.AppendChild(header);
SpreadsheetDocument doc = CreateDoc(data);
/*using (SpreadsheetDocument spreadsheet = SpreadsheetDocument.Open(fileName, true))
{
WorkbookPart workbook = spreadsheet.WorkbookPart;
//create a reference to Sheet1
WorksheetPart worksheet = workbook.WorksheetParts.Last();
///loop through each data row DataRow contentRow;
for (int i = 0; i < table.Rows.Count; i++)
{
contentRow = table.Rows[i];
data.AppendChild(createContentRow(contentRow, i + 2));
}
} */
}
示例9: AddPerson
protected void AddPerson(int id, string email)
{
Row row = new Row();
row["id"] = id;
row["email"] = email;
right.Add(row);
}
示例10: OpenXLRow
public OpenXLRow(WorkbookPart wbPart, WorksheetPart wsPart, List<string> columns, Row xRow)
{
this.WbPart = wbPart;
this.WsPart = wsPart;
this.Columns = columns;
this._cells = GetCells(xRow);
}
示例11: CreateRowFromReader
public override Row CreateRowFromReader(IDataReader reader)
{
GetSchemaTable(reader);
Row r = new Row();
for (int i = 0; i < reader.FieldCount; i++)
{
Type fType = reader.GetFieldType(i);
if (fType == typeof(System.Decimal))
{
GetDecimal(reader, r, i);
}
else if (fType == typeof(System.DateTime))
{
object o = reader.GetValue(i);
if (o != DBNull.Value)
{
DateTime dtime = reader.GetDateTime(i);
if (dtime < MinDateTime)
{
o = NullDateTime.Add(new TimeSpan(dtime.Hour, dtime.Minute, dtime.Second));
}
r[reader.GetName(i)] = o;
}
}
else
{
r[reader.GetName(i)] = reader.GetValue(i);
}
}
return r;
}
示例12: Process
/// <summary>
/// Main processing script.
/// </summary>
/// <param name="input">The input row.</param>
/// <param name="outputRow">The output row.</param>
/// <param name="args">The arguments.</param>
/// <returns>The IEnumerable output row.</returns>
public override IEnumerable<Row> Process(RowSet input, Row outputRow, string[] args)
{
float minF0Value = float.Parse(args[0]);
float maxF0Value = float.Parse(args[1]);
string uvDir = "uv";
string fZeroDir = "f0";
string smoothedFZeroDir = "smoothedF0";
Directory.CreateDirectory(uvDir);
Directory.CreateDirectory(fZeroDir);
Directory.CreateDirectory(smoothedFZeroDir);
foreach (var row in input.Rows)
{
outputRow["WaveID"].Set(row["WaveID"].String);
outputRow["WaveBinary"].Set(row["WaveBinary"].Binary);
outputRow["WaveAlignments"].Set(row["WaveAlignments"].String);
outputRow["RawF0"].Set(row["RawF0"].String);
outputRow["LPCC"].Set(row["LPCC"].Binary);
outputRow["OF0"].Set(row["OF0"].String);
outputRow["LSP"].Set(row["LSP"].Binary);
outputRow["Pow"].Set(row["Pow"].String);
outputRow["MBE"].Set(row["MBE"].String);
string waveId = row["WaveID"].String;
string f0File = JobBase.GenerateLocalFile(waveId, row["RawF0"].String, FileExtensions.F0File, true, fZeroDir);
string uvFile = JobBase.GenerateLocalFile(waveId, row["UV"].String, FileExtensions.Text, true, uvDir);
string smoothedF0File = Path.Combine(smoothedFZeroDir, waveId + "." + FileExtensions.F0File);
string[] argument = { f0File, uvFile, smoothedF0File, minF0Value.ToString(), maxF0Value.ToString() };
F0ExtractorCOSMOS.SmoothOneF0File(argument, null);
outputRow["SF0"].Set(JobBase.GetTextFile(smoothedF0File));
yield return outputRow;
}
}
示例13: AssertSubtract
void AssertSubtract(Row row, string excdColumn, string panColumn, string pctnColumn, string nexcdColumn, Errors errors)
{
if (row[excdColumn].ToLower() == "yes")
{
AssertSubtract(row, panColumn, pctnColumn, nexcdColumn, errors);
}
}
示例14: GetPathSplitIndex
private List<int> GetPathSplitIndex(Row dialogStuff)
{
List<int> values = new List<int> ();
int dummyVal = 0;
int barIndex = 0;
int startIndex = 0;
foreach (char c in dialogStuff.Conversation_Path_Chain) {
if (c.Equals ('|')) {
if (int.TryParse (dialogStuff.Conversation_Path_Chain.Substring (startIndex, barIndex), out dummyVal)){
values.Add(int.Parse (dialogStuff.Conversation_Path_Chain.Substring (startIndex, barIndex))); //still need to do somthing with the value that is after bar
startIndex = barIndex + 1;
}
}
barIndex++;
}
//for the last path or for a singlton
if (int.TryParse (dialogStuff.Conversation_Path_Chain.Substring (startIndex), out dummyVal)) {
values.Add(int.Parse (dialogStuff.Conversation_Path_Chain.Substring (startIndex))); //still need to do somthing with the value that is after bar
}
return values;
}
示例15: PutAdress
private void PutAdress(Aspose.Pdf.Generator.Pdf pdf, PassengerInfo passengerInfo)
{
//create table to add address of the customer
Table adressTable = new Table();
adressTable.IsFirstParagraph = true;
adressTable.ColumnWidths = "60 180 60 180";
adressTable.DefaultCellTextInfo.FontSize = 10;
adressTable.DefaultCellTextInfo.LineSpacing = 3;
adressTable.DefaultCellPadding.Bottom = 3;
//add this table in the first section/page
Section section = pdf.Sections[0];
section.Paragraphs.Add(adressTable);
//add a new row in the table
Row row1AdressTable = new Row(adressTable);
adressTable.Rows.Add(row1AdressTable);
//add cells and text
Aspose.Pdf.Generator.TextInfo tf1 = new Aspose.Pdf.Generator.TextInfo();
tf1.Color = new Aspose.Pdf.Generator.Color(111, 146, 188);
tf1.FontName = "Helvetica-Bold";
row1AdressTable.Cells.Add("Bill To:", tf1);
row1AdressTable.Cells.Add(passengerInfo.Name + "#$NL" +
passengerInfo.Address + "#$NL" + passengerInfo.Email + "#$NL" +
passengerInfo.PhoneNumber);
}