本文整理汇总了C#中Row.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Row.Add方法的具体用法?C# Row.Add怎么用?C# Row.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPatternString
public static void AddPatternString(string Text,Row Row,Pattern Pattern,TextStyle Style,Segment Segment,bool HasError)
{
Word x= Row.Add (Text);
x.Style = Style;
x.Pattern = Pattern;
x.HasError =HasError;
x.Segment =Segment;
}
示例2: AddPatternString
//public static char[] Parse(string text,string separators)
//{
// //string Result="";
// System.Text.StringBuilder Result=new System.Text.StringBuilder ();
// text= " " + text +" ";
// char c;
// for(int i = 0; i <text.Length;i++)
// {
// c = text[i];
// if (separators.IndexOf (c)>=0 )
// Result.Append (' ');
// else
// Result.Append ('.');
// }
// return Result.ToString().ToCharArray ();
//}
public static void AddPatternString(string text, Row row, Pattern pattern, TextStyle style, TextStyle matchingStyle, Segment segment, bool hasError)
{
Word x = row.Add(text);
x.Style = style;
x.MatchingStyle = matchingStyle;
x.Pattern = pattern;
x.HasError = hasError;
x.Segment = segment;
}
示例3: SheetHDR
public SheetHDR(ulong Id, string XmlSource, ExcelStream Excel, SharedStrings stringDictionary)
: base(Id, Excel, stringDictionary)
{
var xd = new XmlDocument();
xd.LoadXml(XmlSource);
var rows = xd.GetElementsByTagName("row");
// 遍历row标签
var flag = false;
Header = new Header();
foreach (XmlNode x in rows)
{
var cols = x.ChildNodes;
var objs = new Row(Header);
// 遍历c标签
foreach (XmlNode y in cols)
{
string value = null;
// 如果是字符串类型,则需要从字典中查询
if (y.Attributes["t"]?.Value == "s")
{
var index = Convert.ToUInt64(y.FirstChild.InnerText);
value = StringDictionary[index];
}
else if (y.Attributes["t"]?.Value == "inlineStr")
{
value = y.FirstChild.FirstChild.InnerText;
}
// 否则其中的v标签值即为单元格内容
else
{
value = y.InnerText;
}
if (!flag)
{
Header.Add(value, y.Attributes["r"].Value);
continue;
}
objs.Add(value, y.Attributes["r"].Value);
}
if (!flag)
{
while (Header.LastOrDefault() == null)
Header.RemoveAt(Header.Count - 1);
flag = true;
continue;
}
// 去掉末尾的null
while (objs.LastOrDefault() == null)
objs.RemoveAt(objs.Count - 1);
if (objs.Count > 0)
this.Add(objs);
}
while (this.Count > 0 && this.Last().Count == 0)
this.RemoveAt(this.Count - 1);
GC.Collect();
}
示例4: AddString
public static unsafe void AddString(string Text, Row Row, TextStyle Style,
Segment Segment)
{
if (Text == "")
return;
StringBuilder CurrentWord = new StringBuilder();
char[] Buff = Text.ToCharArray();
fixed (char* c = &Buff[0])
{
for (int i = 0; i < Text.Length; i++)
{
if (c[i] == ' ' || c[i] == '\t')
{
if (CurrentWord.Length != 0)
{
Word word = Row.Add(CurrentWord.ToString());
word.Style = Style;
word.Segment = Segment;
CurrentWord = new StringBuilder();
}
Word ws = Row.Add(c[i].ToString
(CultureInfo.InvariantCulture));
if (c[i] == ' ')
ws.Type = WordType.xtSpace;
else
ws.Type = WordType.xtTab;
ws.Style = Style;
ws.Segment = Segment;
}
else
CurrentWord.Append(c[i].ToString
(CultureInfo.InvariantCulture));
}
if (CurrentWord.Length != 0)
{
Word word = Row.Add(CurrentWord.ToString());
word.Style = Style;
word.Segment = Segment;
}
}
}
示例5: AddPatternString
public static void AddPatternString(string Text, Row Row, Pattern Pattern,
TextStyle Style, Span span, bool HasError)
{
var x = new Word
{
Style = Style,
Pattern = Pattern,
HasError = HasError,
Span = span,
Text = Text
};
Row.Add(x);
}
示例6: AddString
public static unsafe void AddString(string Text, Row Row, TextStyle Style, Span span)
{
if (Text == "") {
return;
}
var CurrentWord = new StringBuilder();
char[] Buff = Text.ToCharArray();
fixed (char* c = &Buff[0]) {
for (int i = 0; i < Text.Length; i++) {
if (c[i] == ' ' || c[i] == '\t') {
if (CurrentWord.Length != 0) {
Word word = Row.Add(CurrentWord.ToString());
word.Style = Style;
word.Span = span;
CurrentWord = new StringBuilder();
}
Word ws = Row.Add(c[i].ToString());
if (c[i] == ' ') {
ws.Type = WordType.Space;
} else {
ws.Type = WordType.Tab;
}
ws.Style = Style;
ws.Span = span;
} else {
CurrentWord.Append(c[i].ToString());
}
}
if (CurrentWord.Length != 0) {
Word word = Row.Add(CurrentWord.ToString());
word.Style = Style;
word.Span = span;
}
}
}
示例7: ReadCsv
private IEnumerable<Row> ReadCsv()
{
var rows = new List<Row>();
while (_reader.Read())
{
var row = new Row();
for (var i = 0; i < _reader.CurrentRecord.Length; i++)
{
row.Add(new Column(_reader.FieldHeaders[i], _reader.CurrentRecord[i].Trim()));
}
rows.Add(row);
}
return rows;
}
示例8: AddNumericRow
public void AddNumericRow(string label, double value)
{
Row r = new Row();
AddPaddedLabel(r, label);
r.Add(1, FormatFloatingPt(value));
Add(r);
}
示例9: AddDualNumericRow
public void AddDualNumericRow(string label, Tuple value, Tuple value2)
{
Row r = new Row();
AddPaddedLabel(r, label);
r.Add(1, FormatFloatingPt(value.v));
r.Add(2, " +-");
r.Add(3, FormatFloatingPt(value.err));
r.Add(4, " ");
r.Add(5, FormatFloatingPt(value2.v));
r.Add(6, " +-");
r.Add(7, FormatFloatingPt(value2.err));
Add(r);
}
示例10: AddNumericRowWithExtra
public void AddNumericRowWithExtra(string label, Tuple value, double extra)
{
Row r = new Row();
AddPaddedLabel(r, label);
r.Add(1, FormatFloatingPt(value.v));
r.Add(2, " +-");
r.Add(3, FormatFloatingPt(value.err));
r.Add(4, FormatFloatingPt(extra));
Add(r);
}
示例11: AddIntegerRow
public void AddIntegerRow(string label, Int32 value)
{
Row r = new Row();
AddPaddedLabel(r, label);
r.Add(1, FormatInteger(value));
Add(r);
}
示例12: GenRossiDataRow
// print only up to the last non-zero entry, later use the Feynman X,Y dual row technique for this compression attempt
Row GenRossiDataRow(RossiAlphaResultExt rar, Cycle c = null)
{
Row row = new Row();
int shift = 0;
if (c != null)
{
row.Add(0, c.seq.ToString());
shift = 1;
}
int maxindex = rar.gateData.Length - 1;
int i = 0;
for (i = rar.gateData.Length - 1; i >= 0; i--)
{
if (rar.gateData[i] > 0)
{
maxindex = i;
break;
}
}
//happy dad!
if (i == 0) // rolled all the way to the start ofthe array and found all 0s, empty bins!
{
maxindex = 0; // not 1000 and not -1
}
for (i = 0; i <= maxindex; i++)
{
row.Add(i + shift, rar.gateData[i].ToString());
}
return row;
}
示例13: GenRatesParamsRow
Row GenRatesParamsRow(RatesResultEnhanced rrm, Cycle c = null)
{
Row row = new Row();
int shift = 0;
if (c != null)
{
row.Add(0, c.seq.ToString());
shift = 1;
}
row.Add((int)RateInterval.GateWidth + shift, rrm.gateWidthInTics.ToString());
row.Add((int)RateInterval.CompletedGates + shift, rrm.completedIntervals.ToString());
row.Add((int)RateInterval.OverallTime + shift, rrm.totaltime.TotalSeconds.ToString());
return row;
}
示例14: AddPaddedLabel
void AddPaddedLabel(Row r, string label)
{
string s = String.Empty;
switch (sectiontype) // INCC5 spacing hard-coded and enforced here
{
case ReportSection.Standard:
s = String.Format("{0,24}", label);
break;
case ReportSection.MethodResults:
s = String.Format("{0,41}", label);
break;
case ReportSection.Summary:
s = String.Format("{0,39}", label);
break;
case ReportSection.MultiColumn:
s = String.Format("{0,4} ", label);
break;
}
r.Add(0, s);
}
示例15: AddCycleColumnRow
public void AddCycleColumnRow(int num, ulong[] values, string qc, int[] widths)
{
Row r = new Row();
string f = String.Format("{{0,{0}}}", widths[0]);
r.Add(0, String.Format(f, num));
for (int i = 0; i < values.Length; i++)
{
f = String.Format("{{0,{0}}}", widths[i + 1]);
r.Add(i + 1, String.Format(f, values[i]));
}
f = String.Format("{{0,{0}}}", widths[widths.Length - 1]);
r.Add(widths.Length, String.Format(f, qc));
Add(r);
}