本文整理汇总了C#中ICursor类的典型用法代码示例。如果您正苦于以下问题:C# ICursor类的具体用法?C# ICursor怎么用?C# ICursor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICursor类属于命名空间,在下文中一共展示了ICursor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1:
Cursor/*PERMUDA*/Proxy(
ICursor/*PERMUDA*//*PERMUDA FROMSUFFIX*/ from
)
{
NonNull.CheckParameter( from, "from" );
this.From = from;
}
示例2: OnCreate
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.HomeScreen);
listView = FindViewById<ListView>(Resource.Id.List);
string[] projection = new string[] { VegetableProvider.InterfaceConsts.Id, VegetableProvider.InterfaceConsts.Name };
string[] fromColumns = new string[] { VegetableProvider.InterfaceConsts.Name };
int[] toControlIds = new int[] { Android.Resource.Id.Text1 };
// ManagedQuery is deprecated in Honeycomb (3.0, API11)
cursor = ManagedQuery(VegetableProvider.CONTENT_URI, projection, null, null, null);
// ContentResolver requires you to close the query yourself
//cursor = ContentResolver.Query(VegetableProvider.CONTENT_URI, projection, null, null, null);
//StartManagingCursor(cursor);
// CursorLoader introduced in Honeycomb (3.0, API11)
var loader = new CursorLoader(this,
VegetableProvider.CONTENT_URI, projection, null, null, null);
cursor = (ICursor)loader.LoadInBackground();
// create a SimpleCursorAdapter
adapter = new SimpleCursorAdapter(this, Android.Resource.Layout.SimpleListItem1, cursor,
fromColumns, toControlIds);
listView.Adapter = adapter;
listView.ItemClick += OnListItemClick;
}
示例3: ConvertToStringFormatted
public override ICharSequence ConvertToStringFormatted (ICursor cursor)
{
var convertMe = new string[1];
convertMe [0] = cursor.GetString (COLUMN_DISPLAY_NAME);
var converted = CharSequence.ArrayFromStringArray (convertMe);
return converted [0];
}
示例4: mapNote
private Note mapNote(ICursor cursor)
{
return new Note
{
Id = cursor.GetInt(0),
Title = cursor.GetString(1),
Contents = cursor.GetString(2)
};
}
示例5: StatementResult
public StatementResult(ICursor cursor, ConstraintInfo[] constraints)
{
if (cursor == null)
throw new ArgumentNullException("cursor");
Cursor = cursor;
Constraints = constraints;
Type = StatementResultType.CursorRef;
}
示例6: NoteListCursorAdapter
public NoteListCursorAdapter(Context context, int layout, ICursor c, string[] from, int[] to, int selectedIndex)
: base(context, layout, c, from, to)
{
this.layout = layout;
this.context = context;
this.selectedIndex = selectedIndex;
localeDateFormat = DateFormat.getDateFormat(context);
localeTimeFormat = DateFormat.getTimeFormat(context);
}
示例7: NewView
public override View NewView(Context context, ICursor cursor, ViewGroup viewGroup)
{
View itemLayout = inflater.Inflate(Resource.Layout.sample_contacts_activity_item, viewGroup, false);
itemLayout.Tag = new ViewHolder
{
text1 = itemLayout.FindViewById<TextView>(Android.Resource.Id.Text1),
icon = itemLayout.FindViewById<QuickContactBadge>(Android.Resource.Id.Icon)
};
return itemLayout;
}
示例8: createTransaction
public static Transaction createTransaction(ICursor cursor)
{
Transaction purchase = new Transaction();
purchase.orderId = cursor.GetString(0);
purchase.productId = cursor.GetString(1);
purchase.purchaseState = (PurchaseState)Enum.Parse(typeof(PurchaseState), cursor.GetInt(2).ToString());
purchase.purchaseTime = cursor.GetLong(3);
purchase.developerPayload = cursor.GetString(4);
return purchase;
}
示例9: NewView
public override View NewView(Context context, ICursor cursor, ViewGroup parent)
{
var grid = (GridView)parent;
var imageView = new ImageView(context);
imageView.LayoutParameters = new GridView.LayoutParams(grid.ColumnWidth, grid.ColumnWidth);
imageView.SetScaleType(ImageView.ScaleType.CenterCrop);
imageView.SetPadding(8, 8, 8, 8);
return imageView;
}
示例10: BindView
public override void BindView(View view, Context context, ICursor cursor)
{
string type = cursor.GetString(BlocksQuery.BLOCK_TYPE);
string blockId = cursor.GetString(BlocksQuery.BLOCK_ID);
string blockTitle = cursor.GetString(BlocksQuery.BLOCK_TITLE);
long blockStart = cursor.GetLong(BlocksQuery.BLOCK_START);
long blockEnd = cursor.GetLong(BlocksQuery.BLOCK_END);
string blockMeta = cursor.GetString(BlocksQuery.BLOCK_META);
//TODO: Fix it
//String blockTimeString = UIUtils.FormatBlockTimeString(blockStart, blockEnd,
// context);
}
示例11: NewView
public override View NewView(Context context, ICursor cursor, ViewGroup parent)
{
var gv = parent as GridView;
int px = Utils.GetPixFromGridView(context, parent as GridView);
px = gv.ColumnWidth;
var imageView = new ImageView(context);
imageView.LayoutParameters = new GridView.LayoutParams(px, px);
imageView.SetScaleType(ImageView.ScaleType.CenterCrop);
imageView.SetPadding(8, 8, 8, 8);
return imageView;
}
示例12: cursorToList
private static List<Transaction> cursorToList(ICursor c)
{
List<Transaction> transactions = new List<Transaction>();
if (c != null)
{
while (c.MoveToNext())
{
Transaction purchase = BillingDB.createTransaction(c);
transactions.Add(purchase);
}
c.Close();
}
return transactions;
}
示例13: AssertRC
private static void AssertRC(int expected, ICursor cursor, string message = "")
{
var actual = 0;
while (cursor.MoveNext())
actual++;
var ok = (expected == actual);
Console.WriteLine(ok ? "SUCCES {2} expected {0}, actual {1}" : "FAILED {2} expected {0}, actual {1}",
expected, actual, message);
Total++;
if (ok)
Succeeded++;
}
示例14: DeleteNote
public void DeleteNote(ICursor cursor)
{
new AlertDialog.Builder(_context)
.SetTitle(_context.Resources.GetString(Resource.String.delete_title))
.SetMessage(Resource.String.delete_message)
.SetPositiveButton(Resource.String.yes_button, (object sender, DialogClickEventArgs e) =>
{
Uri noteUri = ContentUris.WithAppendedId(WikiNote.Notes.ALL_NOTES_URI,
cursor.GetInt(0));
_context.ContentResolver.Delete(noteUri, null, null);
_context.SetResult(Result.Ok);
_context.Finish();
})
.SetNegativeButton(Resource.String.no_button, delegate { }).Show();
}
示例15: Hand
public Hand(Color color)
{
cursorImage[(int)InputStatus.CURSOR] = getColoredImage(Resources.DiscImage, color);
cursorImage[(int)InputStatus.UNKNOWN] = getColoredImage(Resources.DiscImage, color);
cursorImage[(int)InputStatus.TOUCHED] = getColoredImage(Resources.DiscImageFilled, color);
cursor = CursorFactory.getCursor(cursorImage[(int)status]);
}