本文整理汇总了C#中AgentType.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# AgentType.Equals方法的具体用法?C# AgentType.Equals怎么用?C# AgentType.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AgentType
的用法示例。
在下文中一共展示了AgentType.Equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadBitWise
public int ReadBitWise(string dbName, Int64 CTID, AgentType agentType)
{
DataTable table;
DataRow row;
if (agentType.Equals(AgentType.Slave)) {
//find the table
table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
//find the row
row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0];
} else {
//find the table
table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
//find the row
row = table.Select("CTID = " + Convert.ToString(CTID))[0];
}
return row.Field<int>("syncBitWise");
}
示例2: WriteBitWise
public void WriteBitWise(string dbName, Int64 CTID, int value, AgentType agentType)
{
DataTable table;
DataRow row;
if (agentType.Equals(AgentType.Slave)) {
//find the table
table = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
//find the row
row = table.Select("CTID = " + Convert.ToString(CTID) + " AND slaveIdentifier = '" + Config.Slave + "'")[0];
} else {
//find the table
table = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
//find the row
row = table.Select("CTID = " + Convert.ToString(CTID))[0];
}
//update the row if it doesn't contain the specified bit
if ((row.Field<int>("syncBitWise") & value) == 0) {
row["syncBitWise"] = row.Field<int>("syncBitWise") + value;
//commit the changes
//table.AcceptChanges();
}
}
示例3: GetLastCTBatch
public DataRow GetLastCTBatch(string dbName, AgentType agentType, string slaveIdentifier = "")
{
//for slave we have to pass the slave identifier in and use tblCTSlaveVersion
if (agentType.Equals(AgentType.Slave)) {
DataTable tblCTSlaveVersion = testData.Tables["dbo.tblCTSlaveVersion", GetTableSpace(dbName)];
return tblCTSlaveVersion.Select("slaveIdentifier = '" + slaveIdentifier + "'", "CTID DESC")[0];
} else {
DataTable tblCTVersion = testData.Tables["dbo.tblCTVersion", GetTableSpace(dbName)];
return tblCTVersion.Select(null, "CTID DESC")[0];
}
}