本文整理汇总了C#中Row.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Row.GetType方法的具体用法?C# Row.GetType怎么用?C# Row.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Row
的用法示例。
在下文中一共展示了Row.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeRow
object SerializeRow(IDesignerSerializationManager manager, CodeExpression target, Row row)
{
object codeObject = null;
ExpressionContext context = null;
ExpressionContext context2 = manager.Context[typeof(ExpressionContext)] as ExpressionContext;
CodeMethodInvokeExpression codeIndexer = new CodeMethodInvokeExpression(target, "GetAt", new CodePrimitiveExpression(row.Index));
if (context2 != null)
{
//CodeIndexerExpression codeIndexer = new CodeIndexerExpression(target, new CodePrimitiveExpression(row.Index));
context = new ExpressionContext(codeIndexer, typeof(RowCollection), context2.PresetValue, row);
manager.Context.Push(context);
}
try
{
CodeDomSerializer rowSerialzier = (CodeDomSerializer)manager.GetSerializer(row.GetType(), typeof(CodeDomSerializer));
//codeObject = rowSerialzier.Serialize(manager, row);
codeObject = rowSerialzier.SerializeAbsolute(manager, row);
}
finally
{
foreach (Cell item in row.Cells)
{
object cellCodeObject = SerializeCell(manager, codeIndexer, item);
if(cellCodeObject is CodeStatementCollection && codeObject is CodeStatementCollection)
{
(codeObject as CodeStatementCollection).AddRange(cellCodeObject as CodeStatementCollection);
}
}
if (context != null)
{
manager.Context.Pop();
}
}
return codeObject;
}
示例2: SaveTestData
public void SaveTestData(Row data)
{
if (!Running) return;
var key = data.GetType().Name;
List<Row> lst;
if (!m_Data.TryGetValue(key, out lst))
{
lst = new List<Row>();
m_Data[key] = lst;
}
lst.Add( data );
}