本文整理汇总了C#中ICursor.GetDouble方法的典型用法代码示例。如果您正苦于以下问题:C# ICursor.GetDouble方法的具体用法?C# ICursor.GetDouble怎么用?C# ICursor.GetDouble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICursor
的用法示例。
在下文中一共展示了ICursor.GetDouble方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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);
}