本文整理汇总了C#中Cursor.MoveNext方法的典型用法代码示例。如果您正苦于以下问题:C# Cursor.MoveNext方法的具体用法?C# Cursor.MoveNext怎么用?C# Cursor.MoveNext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cursor
的用法示例。
在下文中一共展示了Cursor.MoveNext方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveCursorToNext
/*
* Move the cursor to the next record in the database
* with more than five records. The returning values of
* every move operation should be true.
*/
public void MoveCursorToNext(Cursor dbc, LockingInfo lck)
{
for (int i = 0; i < 5; i++)
if (lck == null)
Assert.IsTrue(dbc.MoveNext());
else
Assert.IsTrue(dbc.MoveNext(lck));
}
示例2: MoveCursorToPrev
/*
* Move the cursor to previous record in the database.
* The returning value should be true;
*/
public void MoveCursorToPrev(Cursor dbc,
uint kOffset, uint kLen,
uint dOffset, uint dLen, LockingInfo lck)
{
if (lck == null) {
dbc.MoveLast();
for (int i = 0; i < 5; i++) {
Assert.IsTrue(dbc.MovePrev());
dbc.MoveNext();
Assert.IsTrue(dbc.MovePrev(
new DatabaseEntry(kOffset, kLen),
new DatabaseEntry(dOffset, dLen)));
CheckPartial(
dbc.Current.Key, kOffset, kLen,
dbc.Current.Value, dOffset, dLen);
}
} else {
dbc.MoveLast(lck);
for (int i = 0; i < 5; i++) {
Assert.IsTrue(dbc.MovePrev(lck));
dbc.MoveNext();
Assert.IsTrue(dbc.MovePrev(
new DatabaseEntry(kOffset, kLen),
new DatabaseEntry(dOffset, dLen),
lck));
CheckPartial(
dbc.Current.Key, kOffset, kLen,
dbc.Current.Value, dOffset, dLen);
}
}
}
示例3: MoveCursorToNext
/*
* Move the cursor to the next record in the database
* with more than five records. The returning values of
* every move operation should be true.
*/
public void MoveCursorToNext(Cursor dbc,
uint kOffset, uint kLen,
uint dOffset, uint dLen, LockingInfo lck)
{
DatabaseEntry key = new DatabaseEntry(kOffset, kLen);
DatabaseEntry data = new DatabaseEntry(dOffset, dLen);
for (int i = 0; i < 5; i++) {
if (lck == null) {
Assert.IsTrue(dbc.MoveNext());
Assert.IsTrue(dbc.MoveNext(key, data));
} else {
Assert.IsTrue(dbc.MoveNext(lck));
Assert.IsTrue(
dbc.MoveNext(key, data, lck));
}
CheckPartial(dbc.Current.Key, kOffset, kLen,
dbc.Current.Value, dOffset, dLen);
}
}
示例4: DumpHeader
/// <summary>Print the header to a given stream.</summary>
/// <param name="ps">the stream to which the card images are dumped.</param>
public void DumpHeader(TextWriter ps)
{
cursor = GetCursor();
while(cursor.MoveNext())
{
ps.WriteLine(((DictionaryEntry)cursor.Current).Value);
}
}
示例5: CheckEnd
/// <summary>Ensure that the header has exactly one END keyword in
/// the appropriate location.</summary>
internal void CheckEnd()
{
// Ensure we have an END card only at the end of the header.
cursor = GetCursor();
HeaderCard card;
while(cursor.MoveNext())
{
card = (HeaderCard)((DictionaryEntry)cursor.Current).Value;
if(!card.KeyValuePair && card.Key.Equals("END"))
{
cursor.Remove();
}
}
try
{
cursor.Add(new HeaderCard("END", null, null));
}
catch(HeaderCardException)
{
}
}
示例6: CheckBeginning
/// <summary>Ensure that the header begins with
/// a valid set of keywords. Note that we
/// do not check the values of these keywords.</summary>
internal void CheckBeginning()
{
cursor = GetCursor();
cursor.MoveNext();
if(cursor.Current == null)
{
throw new FitsException("Empty Header");
}
HeaderCard card = (HeaderCard)((DictionaryEntry)cursor.Current).Value;
String key = card.Key;
if(!key.Equals("SIMPLE") && !key.Equals("XTENSION"))
{
throw new FitsException("No SIMPLE or XTENSION at beginning of Header");
}
bool isTable = false;
bool isExtension = false;
if(key.Equals("XTENSION"))
{
String value_Renamed = card.Value;
if (value_Renamed == null)
{
throw new FitsException("Empty XTENSION keyword");
}
isExtension = true;
if(value_Renamed.Equals("BINTABLE") || value_Renamed.Equals("A3DTABLE") || value_Renamed.Equals("TABLE"))
{
isTable = true;
}
}
CardCheck("BITPIX");
CardCheck("NAXIS");
int nax = GetIntValue("NAXIS");
// cursor.MoveNext();
for(int i = 1; i <= nax; i += 1)
{
CardCheck("NAXIS" + i);
}
if (isExtension)
{
CardCheck("PCOUNT");
CardCheck("GCOUNT");
if (isTable)
{
CardCheck("TFIELDS");
}
}
}