本文整理汇总了C#中Cursor.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# Cursor.Refresh方法的具体用法?C# Cursor.Refresh怎么用?C# Cursor.Refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cursor
的用法示例。
在下文中一共展示了Cursor.Refresh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveCursorToCurrentRec
/*
* Move the cursor to current existing record. The returning
* value should be true.
*/
public void MoveCursorToCurrentRec(Cursor dbc,
LockingInfo lck)
{
// Add a record to the database.
KeyValuePair<DatabaseEntry, DatabaseEntry> pair;
pair = new KeyValuePair<DatabaseEntry,DatabaseEntry>(
new DatabaseEntry(ASCIIEncoding.ASCII.GetBytes("key")),
new DatabaseEntry(ASCIIEncoding.ASCII.GetBytes("key")));
dbc.Add(pair);
if (lck == null)
dbc.Refresh();
else
dbc.Refresh(lck);
Assert.IsNotNull(dbc.Current.Key);
}
示例2: MoveCursorToCurrentRec
/*
* Move the cursor to current existing record. The returning
* value should be true.
*/
public void MoveCursorToCurrentRec(Cursor dbc,
uint kOffset, uint kLen,
uint dOffset, uint dLen, LockingInfo lck)
{
DatabaseEntry key, data;
// Add a record to the database.
KeyValuePair<DatabaseEntry, DatabaseEntry> pair;
key = new DatabaseEntry(
ASCIIEncoding.ASCII.GetBytes("key"));
data = new DatabaseEntry(
ASCIIEncoding.ASCII.GetBytes("data"));
pair = new KeyValuePair<DatabaseEntry,
DatabaseEntry>(key, data);
dbc.Add(pair);
if (lck == null)
Assert.IsTrue(dbc.Refresh());
else
Assert.IsTrue(dbc.Refresh(lck));
Assert.AreEqual(key.Data, dbc.Current.Key.Data);
Assert.AreEqual(data.Data, dbc.Current.Value.Data);
key = new DatabaseEntry(kOffset, kLen);
data = new DatabaseEntry(dOffset, dLen);
if (lck == null)
Assert.IsTrue(dbc.Refresh(key, data));
else
Assert.IsTrue(dbc.Refresh(key, data, lck));
CheckPartial(dbc.Current.Key, kOffset, kLen,
dbc.Current.Value, dOffset, dLen);
}