本文整理汇总了C#中DataTable.Get方法的典型用法代码示例。如果您正苦于以下问题:C# DataTable.Get方法的具体用法?C# DataTable.Get怎么用?C# DataTable.Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataTable
的用法示例。
在下文中一共展示了DataTable.Get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MouseCfg
/// <summary>
/// Constructor from DataTable
/// </summary>
/// <param name="mouseCfgData">DataTable loaded from CFG file</param>
public MouseCfg(DataTable mouseCfgData)
{
m_invertedX = mouseCfgData.Get<bool>("invertedX") ? -1.0f : 1.0f;
m_invertedY = mouseCfgData.Get<bool>("invertedY") ? -1.0f : 1.0f;
m_sensivity = mouseCfgData.Get<float>("sensivity");
m_useUnityScreenPosition = mouseCfgData.Get<bool>("useUnityScreenPosition");
}
示例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);
}
}