当前位置: 首页>>代码示例>>C#>>正文


C# ICursor.GetLong方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: convertCursorRowToUXFormat

        /*
        This is ported from FetchWeatherTask --- but now we go straight from the cursor to the
        string.
         */
        private String convertCursorRowToUXFormat(ICursor cursor)
        {
            // get row indices for our cursor

            String highAndLow = formatHighLows (
                                    cursor.GetDouble (COL_WEATHER_MAX_TEMP),
                                    cursor.GetDouble (COL_WEATHER_MIN_TEMP));

            return Utility.formatDate (cursor.GetLong (COL_WEATHER_DATE)) +
            " - " + cursor.GetString (COL_WEATHER_DESC) +
            " - " + highAndLow;
        }
开发者ID:Screech129,项目名称:WeatherApp,代码行数:16,代码来源:DetailFragment.cs

示例5: OnSessionQueryComplete

		/**
	     * Handle {@link SessionsQuery} {@link Cursor}.
	     */
		private void OnSessionQueryComplete (ICursor cursor)
		{
			try {
				mSessionCursor = true;
				if (!cursor.MoveToFirst ()) {
					return;
				}
	
				// Format time block this session occupies
				long blockStart = cursor.GetLong (SessionsQuery.BLOCK_START);
				long blockEnd = cursor.GetLong (SessionsQuery.BLOCK_END);
				String roomName = cursor.GetString (SessionsQuery.ROOM_NAME);
				String subtitle = UIUtils.FormatSessionSubtitle (blockStart, blockEnd, roomName, Activity);
	
				mTitleString = cursor.GetString (SessionsQuery.TITLE);
				mTitle.Text = mTitleString;
				mSubtitle.Text = subtitle;
	
				mUrl = cursor.GetString (SessionsQuery.URL);
				if (TextUtils.IsEmpty (mUrl)) {
					mUrl = "";
				}
	
				mHashtag = cursor.GetString (SessionsQuery.HASHTAG);
				mTagDisplay = mRootView.FindViewById<TextView> (Resource.Id.session_tags_button);
				if (!TextUtils.IsEmpty (mHashtag)) {
					// Create the button text
					SpannableStringBuilder sb = new SpannableStringBuilder ();
					sb.Append (GetString (Resource.String.tag_stream) + " ");
					int boldStart = sb.Length ();
					sb.Append (GetHashtagsString ());
					sb.SetSpan (sBoldSpan, boldStart, sb.Length (), SpanTypes.ExclusiveExclusive);
	
					mTagDisplay.Text = (string)sb;
					mTagDisplay.Click += (sender, e) => {
						Intent intent = new Intent (Activity, typeof(TagStreamActivity));
						intent.PutExtra (TagStreamFragment.EXTRA_QUERY, GetHashtagsString ());
						StartActivity (intent);	
					};
					
				} else {
					mTagDisplay.Visibility = ViewStates.Gone;
				}
	
				mRoomId = cursor.GetString (SessionsQuery.ROOM_ID);
	
				// Unregister around setting checked state to avoid triggering
				// listener since change isn't user generated.
				mStarred.CheckedChange += null;
				mStarred.Checked = cursor.GetInt (SessionsQuery.STARRED) != 0;
				mStarred.CheckedChange += HandleCheckedChange;
	
				String sessionAbstract = cursor.GetString (SessionsQuery.ABSTRACT);
				if (!TextUtils.IsEmpty (sessionAbstract)) {
					UIUtils.SetTextMaybeHtml (mAbstract, sessionAbstract);
					mAbstract.Visibility = ViewStates.Visible;
					mHasSummaryContent = true;
				} else {
					mAbstract.Visibility = ViewStates.Gone;
				}
	
				View requirementsBlock = mRootView.FindViewById (Resource.Id.session_requirements_block);
				String sessionRequirements = cursor.GetString (SessionsQuery.REQUIREMENTS);
				if (!TextUtils.IsEmpty (sessionRequirements)) {
					UIUtils.SetTextMaybeHtml (mRequirements, sessionRequirements);
					requirementsBlock.Visibility = ViewStates.Visible;
					mHasSummaryContent = true;
				} else {
					requirementsBlock.Visibility = ViewStates.Gone;
				}
	
				// Show empty message when all data is loaded, and nothing to show
				if (mSpeakersCursor && !mHasSummaryContent) {
					mRootView.FindViewWithTag (Android.Resource.Id.Empty).Visibility = ViewStates.Visible;
				}
	
				//AnalyticsUtils.getInstance(getActivity()).trackPageView("/Sessions/" + mTitleString);
	
				UpdateLinksTab (cursor);
				UpdateNotesTab ();
	
			} finally {
				cursor.Close ();
			}
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:88,代码来源:SessionDetailFragment.cs

示例6: BindView

        /*
        This is where we fill-in the views with the contents of the cursor.
         */
        public override void BindView(View view, Context context, ICursor cursor)
        {
            // Read weather icon ID from cursor
            int weatherId = cursor.GetInt (ForecastFragment.COL_WEATHER_CONDITION_ID);
            // Use placeholder image for now
            if (GetItemViewType (cursor.Position) == 0) {

                MainViewHolder.iconView.SetImageResource (getArtResourceForWeatherCondition (weatherId));
            } else {
                MainViewHolder.iconView.SetImageResource (getIconResourceForWeatherCondition (weatherId));

            }

            // TODO Read date from cursor
            long date = cursor.GetLong (ForecastFragment.COL_WEATHER_DATE);
            MainViewHolder.dateView.Text = Utility.getFriendlyDayString (context, date);

            // TODO Read weather forecast from cursor
            string forecast = cursor.GetString (ForecastFragment.COL_WEATHER_DESC);
            MainViewHolder.descriptionView.Text = forecast;
            // Read user preference for metric or imperial temperature units
            bool isMetric = Utility.isMetric (context);

            // Read high temperature from cursor
            double high = cursor.GetDouble (ForecastFragment.COL_WEATHER_MAX_TEMP);
            MainViewHolder.highTempView.Text = Utility.formatTemperature (context, high, isMetric);

            // TODO Read low temperature from cursor
            double low = cursor.GetDouble (ForecastFragment.COL_WEATHER_MIN_TEMP);
            MainViewHolder.lowTempView.Text = Utility.formatTemperature (context, low, isMetric);
        }
开发者ID:Screech129,项目名称:WeatherApp,代码行数:34,代码来源:ForecastAdapter.cs

示例7: OnQueryComplete

		public void OnQueryComplete (int token, Java.Lang.Object cookie, ICursor cursor)
		{
			if (Activity == null) {
	            return;
	        }
			
			Day day = (Day) cookie;
			
			// Clear out any existing sessions before inserting again
	        day.BlocksView.RemoveAllBlocks();
			
			try {
	            while (cursor.MoveToNext()) {
	                string type = cursor.GetString(BlocksQuery.BLOCK_TYPE);
	                
					// TODO: place random blocks at bottom of entire layout
					int column;
					try {
						column = TypeColumnMap[type];
					} catch {
						continue;
					}
	                
	                string blockId = cursor.GetString(BlocksQuery.BLOCK_ID);
	                string title = cursor.GetString(BlocksQuery.BLOCK_TITLE);
	                long start = cursor.GetLong(BlocksQuery.BLOCK_START);
	                long end = cursor.GetLong(BlocksQuery.BLOCK_END);
	                bool containsStarred = cursor.GetInt(BlocksQuery.CONTAINS_STARRED) != 0;
	
	                BlockView blockView = new BlockView(Activity, blockId, title, start, end, containsStarred, column);
	
	                int sessionsCount = cursor.GetInt(BlocksQuery.SESSIONS_COUNT);
					
	                if (sessionsCount > 0) {
	                    blockView.Click += HandleClick;
	                } else {
	                    blockView.Focusable = false;
	                    blockView.Enabled = false;
	                    LayerDrawable buttonDrawable = (LayerDrawable) blockView.Background;
	                    buttonDrawable.GetDrawable(0).SetAlpha(DISABLED_BLOCK_ALPHA);
	                    buttonDrawable.GetDrawable(2).SetAlpha(DISABLED_BLOCK_ALPHA);
	                }
	
	                day.BlocksView.AddView(blockView);
	            }
	        } finally {
	            cursor.Close();
	        }

		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:50,代码来源:ScheduleFragment.cs

示例8: BindView

			public override void BindView (Android.Views.View view, Context context, ICursor cursor)
			{
				TextView titleView = view.FindViewById<TextView> (Resource.Id.session_title);
				TextView subtitleView = view.FindViewById<TextView> (Resource.Id.session_subtitle);
	
				titleView.Text = cursor.GetString (SessionsQuery.TITLE);
	
				// Format time block this session occupies
				long blockStart = cursor.GetLong (SessionsQuery.BLOCK_START);
				long blockEnd = cursor.GetLong (SessionsQuery.BLOCK_END);
				string roomName = cursor.GetString (SessionsQuery.ROOM_NAME);
				string subtitle = UIUtils.FormatSessionSubtitle (blockStart, blockEnd, roomName, context);
	
				subtitleView.Text = subtitle;
				
				bool starred = cursor.GetInt (SessionsQuery.STARRED) != 0;
				view.FindViewById (Resource.Id.star_button).Visibility = starred ? ViewStates.Visible : ViewStates.Invisible;
	
				// Possibly indicate that the session has occurred in the past.
				UIUtils.SetSessionTitleColor (blockStart, blockEnd, titleView, subtitleView);
			}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:21,代码来源:SessionsFragment.cs


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