本文整理汇总了C#中Row.SetString方法的典型用法代码示例。如果您正苦于以下问题:C# Row.SetString方法的具体用法?C# Row.SetString怎么用?C# Row.SetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row.SetString方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Transform
public Row Transform(Row row) {
var xml = row.GetString(_input);
if (xml.Equals(string.Empty)) {
return row;
}
var count = 0;
var doc = new NanoXmlDocument(xml);
if (_elements.ContainsKey(doc.RootNode.Name)) {
var field = _elements[doc.RootNode.Name];
row[field] = field.Convert(doc.RootNode.Value ?? (field.ReadInnerXml ? doc.RootNode.InnerText() : doc.RootNode.ToString()));
count++;
}
var subNodes = doc.RootNode.SubNodes.ToArray();
while (subNodes.Any()) {
var nextNodes = new List<NanoXmlNode>();
foreach (var node in subNodes) {
if (_elements.ContainsKey(node.Name)) {
var field = _elements[node.Name];
count++;
var value = node.Value ?? (field.ReadInnerXml ? node.InnerText() : node.ToString());
if (!string.IsNullOrEmpty(value)) {
if (field.Type == "string") {
row.SetString(field, value);
} else {
row[field] = field.Convert(value);
}
}
}
if (_searchAttributes) {
foreach (var attribute in node.Attributes.Where(attribute => _attributes.ContainsKey(attribute.Name))) {
var field = _attributes[attribute.Name];
count++;
if (!string.IsNullOrEmpty(attribute.Value)) {
if (field.Type == "string") {
row.SetString(field, attribute.Value);
} else {
row[field] = field.Convert(attribute.Value);
}
}
}
}
if (count < _total) {
nextNodes.AddRange(node.SubNodes);
}
}
subNodes = nextNodes.ToArray();
}
Increment();
return row;
}
示例2: Create
public Row Create(IDataReader reader, int rowCapacity, Field[] fields) {
var row = new Row(rowCapacity, _context.Entity.IsMaster);
for (var i = 0; i < reader.FieldCount; i++) {
var field = fields[i];
if (field.Type == "string") {
if (reader.GetFieldType(i) == typeof(string)) {
row.SetString(field, reader.IsDBNull(i) ? null : reader.GetString(i));
} else {
TypeMismatch(field, reader, i);
var value = reader.GetValue(i);
row[field] = value == DBNull.Value ? null : value;
}
} else {
var value = reader.GetValue(i);
row[field] = value == DBNull.Value ? null : value;
}
}
return row;
}
示例3: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, string.Concat(_input.Select(f => row.GetString(f))));
Increment();
return row;
}
示例4: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, row.GetString(_input).Trim(_trimChars));
Increment();
return row;
}
示例5: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, row.GetString(_input).ToLowerInvariant());
Increment();
return row;
}
示例6: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, row.GetString(_input).PadLeft(Context.Transform.TotalWidth, Context.Transform.PaddingChar));
Increment();
return row;
}
示例7: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, row.GetString(_input).Left(_length));
Increment();
return row;
}
示例8: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, string.Join(Context.Transform.Separator, _input.Select(f => row.GetString(f))));
Increment();
return row;
}
示例9: Transform
public Row Transform(Row row) {
row.SetString(_output, Decompress(row.GetString(_input)));
Increment();
return row;
}
示例10: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, Decode(row.GetString(_input)));
Increment();
return row;
}
示例11: Transform
public Row Transform(Row row) {
row.SetString(Context.Field, string.Format(Context.Transform.Format, _input.Select(f => row.GetString(f)).ToArray()));
Increment();
return row;
}