本文整理汇总了C#中DataTable.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# DataTable.Contains方法的具体用法?C# DataTable.Contains怎么用?C# DataTable.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataTable
的用法示例。
在下文中一共展示了DataTable.Contains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowDialog
public void ShowDialog(DataTable dialogTable, string name)
{
frame.dialogName = name;
if ( !dialogTable.Contains("Character")
||!dialogTable.Contains("Words") ){
Debug.Log("Cannot found Character or words in " + name);
return;
}
// Debug.Log("show dialog " + name + " [total line] " + dialogTable.Rows.Count.ToString() );
// for(int i = 0 ; i < dialogTable.Rows.Count ; ++i )
// {
// ShowDialog(dialogTable.Rows[i]["Character"].ToString()
// , dialogTable.Rows[i]["Words"].ToString());
// }
for(int i = 0 ; i < dialogTable.rows.Count; ++ i)
{
string cha = dialogTable.rows[i].row.Select("Character");
string word = dialogTable.rows[i].row.Select("Words");
ShowDialog(cha, word);
}
// frame.BeginShow();
}
示例2: pushParameter
/// <summary>
/// Pushes all the parameters for a function call. The order of parameters is strict and there are no default values
/// </summary>
/// <param name="dataTable">Collection of known variables</param>
/// <param name="param">Value of the parameter</param>
private void pushParameter(DataTable dataTable, String param)
{
if (dataTable.Contains(param))
{
int parameterAddr = dataTable.Get(param);
// push parameters value (i.e. an address to a string on the heap)
m_currentProgramCode.Writer.Write((int)XmlScriptExecutor.OpCode.PUSH_ADDR);
m_currentProgramCode.Writer.Write(parameterAddr);
//m_currentProgramCode.Writer.Write((int)XmlScriptExecutor.OpCode.READ_STRING_FROM_HEAP);
}
else
{
m_currentProgramCode.Writer.Write((int)XmlScriptExecutor.OpCode.PUSH_STRING);
m_currentProgramCode.Writer.Write(param);
// pop the string from the stack, alloc space for it and push its address onto the stack
// (could use a register here, and then push it from the register onto the stack)
m_currentProgramCode.Writer.Write((int)XmlScriptExecutor.OpCode.ALLOC_STRING_ON_HEAP);
//m_currentProgramCode.Writer.Write((int)XmlScriptExecutor.OpCode.READ_STRING_FROM_HEAP);
}
}