• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ICursor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICursor的典型用法代码示例。如果您正苦于以下问题:C# ICursor类的具体用法?C# ICursor怎么用?C# ICursor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICursor类属于命名空间,在下文中一共展示了ICursor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1:

Cursor/*PERMUDA*/Proxy(
    ICursor/*PERMUDA*//*PERMUDA FROMSUFFIX*/ from
)
{
    NonNull.CheckParameter( from, "from" );
    this.From = from;
}
开发者ID:macro187,项目名称:halfdecentsharp,代码行数:7,代码来源:CursorProxy.permuda.cs


示例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;
        }
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:30,代码来源:HomeScreen.cs


示例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];
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:8,代码来源:AutoComplete4.cs


示例4: mapNote

 private Note mapNote(ICursor cursor)
 {
     return new Note
     {
         Id = cursor.GetInt(0),
         Title = cursor.GetString(1),
         Contents = cursor.GetString(2)
     };
 }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:9,代码来源:StandardNoteRepository.cs


示例5: StatementResult

        public StatementResult(ICursor cursor, ConstraintInfo[] constraints)
        {
            if (cursor == null)
                throw new ArgumentNullException("cursor");

            Cursor = cursor;
            Constraints = constraints;
            Type = StatementResultType.CursorRef;
        }
开发者ID:deveel,项目名称:deveeldb,代码行数:9,代码来源:StatementResult.cs


示例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);
        }
开发者ID:decriptor,项目名称:tomdroid,代码行数:10,代码来源:NoteListCursorAdapter.cs


示例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;
 }
开发者ID:fitzhex,项目名称:testrepo,代码行数:10,代码来源:SampleContactsAdapter.cs


示例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;
 }
开发者ID:Ezekoka,项目名称:MonoGame-StarterKits,代码行数:10,代码来源:BillingDB.cs


示例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;
        }
开发者ID:adbk,项目名称:spikes,代码行数:11,代码来源:ImageAdapter.cs


示例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);
            }
开发者ID:prashantvc,项目名称:XamarinIO,代码行数:13,代码来源:MyScheduleFragment.cs


示例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;
        }
开发者ID:adbk,项目名称:spikes,代码行数:14,代码来源:ImageAdapter.cs


示例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;
 }
开发者ID:Ezekoka,项目名称:MonoGame-StarterKits,代码行数:14,代码来源:TransactionManager.cs


示例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++;
        }
开发者ID:meowthsli,项目名称:Esentery,代码行数:14,代码来源:IntegrationTests.cs


示例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();
 }
开发者ID:CBSAdvisor,项目名称:cbs-quantum,代码行数:15,代码来源:WikiActivityHelper.cs


示例15: BindView

        public override void BindView(View view, Context context, ICursor cursor)
        {
            Uri contactUri = ContactsContract.Contacts.GetLookupUri(
                cursor.GetLong(SampleContactsActivity.ContactsQuery.Id),
                cursor.GetString(SampleContactsActivity.ContactsQuery.LookupKey));

            ViewHolder holder = (ViewHolder)view.Tag;
            holder.text1.Text = cursor.GetString(SampleContactsActivity.ContactsQuery.DisplayName);
            holder.icon.AssignContactUri(contactUri);

            Picasso.With(context)
                   .Load(contactUri)
                   .Placeholder(Resource.Drawable.contact_picture_placeholder)
                   .Tag(context)
                   .Into(holder.icon);
        }
开发者ID:fitzhex,项目名称:testrepo,代码行数:16,代码来源:SampleContactsAdapter.cs


示例16: BindView

        public override void BindView(View view, Context context, ICursor cursor)
        {
            int image_column_index = cursor.GetColumnIndex(MediaStore.Images.Media.InterfaceConsts.Id);
            var imageView = (ImageView)view;
            int id = cursor.GetInt(image_column_index);

            Bitmap bm = MediaStore.Images.Thumbnails.GetThumbnail(context.ContentResolver, id, ThumbnailKind.MicroKind, null);

            BitmapDrawable drawable = imageView.Drawable as BitmapDrawable;

            if (drawable != null && drawable.Bitmap != null)
            {
                drawable.Bitmap.Recycle();
            }

            imageView.SetImageBitmap(bm);
        }
开发者ID:adbk,项目名称:spikes,代码行数:17,代码来源:CursorImageAdapter.cs


示例17: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            Intent intent = Intent;
            Uri uri = null;
            String query = null;

            if (Intent.ActionSearch.Equals(intent.Action))
            {
                query = intent.GetStringExtra(SearchManager.Query);
            }
            else if (bundle != null)
            {
                query = bundle.GetString(SearchManager.Query);
            }

            if (query != null && query.Length > 0)
            {
                uri = Uri.WithAppendedPath(WikiNote.Notes.SEARCH_URI, Uri.Encode(query));
            }

            if (uri == null)
            {
                // somehow we got called w/o a query so fall back to a reasonable
                // default (all notes)
                uri = WikiNote.Notes.ALL_NOTES_URI;
            }

            // Do the query
            ICursor c = ManagedQuery(uri, WikiNote.WIKI_LISTNOTES_PROJECTION, null, null,
                        WikiNote.Notes.BY_TITLE_SORT_ORDER);
            _cursor = c;

            _helper = new WikiActivityHelper(this);

            // Bind the results of the search into the list
            ListAdapter = new SimpleCursorAdapter(
                                      this,
                                      Android.Resource.Layout.SimpleListItem1,
                                      _cursor,
                                      new String[] { WikiNote.Notes.TITLE },
                                      new int[] { Android.Resource.Id.Text1 });
            SetDefaultKeyMode(DefaultKey.Shortcut);
        }
开发者ID:CBSAdvisor,项目名称:cbs-quantum,代码行数:45,代码来源:WikiNotesList.cs


示例18: GetModifiedRotation

        public Quaternion GetModifiedRotation(ICursor cursor)
        {
            Quaternion rotation;

            Vector3 forward = UseGazeBasedNormal ? -GazeManager.Instance.GazeNormal : HostTransform.rotation * CursorNormal;

            // Determine the cursor forward
            if (forward.magnitude > 0)
            {
                rotation = Quaternion.LookRotation(forward, Vector3.up);
            }
            else
            {
                rotation = cursor.Rotation;
            }

            return rotation;
        }
开发者ID:ChangweiZhang,项目名称:HoloToolkit-Unity,代码行数:18,代码来源:CursorModifier.cs


示例19: GetModifiedPosition

        public Vector3 GetModifiedPosition(ICursor cursor)
        {
            Vector3 position;

            if (SnapCursor)
            {
                // Snap if the targeted object has a cursor modifier that supports snapping
                position = HostTransform.position +
                           HostTransform.TransformVector(CursorOffset);
            }
            else
            {
                // Else, consider the modifiers on the cursor modifier, but don't snap
                position = GazeManager.Instance.HitPosition + HostTransform.TransformVector(CursorOffset);
            }

            return position;
        }
开发者ID:ChangweiZhang,项目名称:HoloToolkit-Unity,代码行数:18,代码来源:CursorModifier.cs


示例20: EditNote

 /// <summary>
 /// Create an intent to start the WikiNoteEditor using the current title
 /// and body information (if any).
 /// </summary>
 public void EditNote(string mNoteName, ICursor cursor)
 {
     // This intent could use the android.intent.action.EDIT for a wiki note
     // to invoke, but instead I wanted to demonstrate the mechanism for invoking
     // an intent on a known class within the same application directly. Note
     // also that the title and body of the note to edit are passed in using the extras bundle.
     Intent i = new Intent(_context, typeof(WikiNoteEditor));
     i.PutExtra(WikiNote.Notes.TITLE, mNoteName);
     String body;
     if (cursor != null)
     {
         body = cursor.GetString(cursor.GetColumnIndexOrThrow(WikiNote.Notes.BODY));
     }
     else
     {
         body = string.Empty;
     }
     i.PutExtra(WikiNote.Notes.BODY, body);
     _context.StartActivityForResult(i, ACTIVITY_EDIT);
 }
开发者ID:CBSAdvisor,项目名称:cbs-quantum,代码行数:24,代码来源:WikiActivityHelper.cs



注:本文中的ICursor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICurve类代码示例发布时间:2022-05-24
下一篇:
C# ICurrencyService类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap