本文整理汇总了C#中Cursor.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# Cursor.GetString方法的具体用法?C# Cursor.GetString怎么用?C# Cursor.GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cursor
的用法示例。
在下文中一共展示了Cursor.GetString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: populateFields
private void populateFields(View v, Cursor c)
{
int nameCol = c.getColumnIndex(Note.TITLE);
int modifiedCol = c.getColumnIndex(Note.MODIFIED_DATE);
int tagCol = c.getColumnIndex(Note.TAGS);
string title = c.GetString(nameCol);
string tags = c.GetString(tagCol);
//Format last modified dates to be similar to desktop Tomboy
//TODO this is messy - must be a better way than having 3 separate date types
Time lastModified = new Time();
lastModified.parse3339(c.GetString(modifiedCol));
Long lastModifiedMillis = lastModified.toMillis(false);
Date lastModifiedDate = new Date(lastModifiedMillis);
string strModified = this.context.GetString(Resource.String.textModified)+" ";
//TODO this is very inefficient
if (DateUtils.isToday(lastModifiedMillis)){
strModified += this.context.GetString(Resource.String.textToday) +", " + localeTimeFormat.format(lastModifiedDate);
} else {
// Add a day to the last modified date - if the date is now today, it means the note was edited yesterday
Time yesterdayTest = lastModified;
yesterdayTest.monthDay += 1;
if (DateUtils.isToday(yesterdayTest.toMillis(false))){
strModified += this.context.GetString(Resource.String.textYexterday) +", " + localeTimeFormat.format(lastModifiedDate);
} else {
strModified += localeDateFormat.format(lastModifiedDate) + ", " + localeTimeFormat.format(lastModifiedDate);
}
}
/**
* Next set the name of the entry.
*/
TextView note_title = (TextView) v.FindViewById(Resource.Id.note_title);
if (note_title != null) {
note_title.SetText(title);
if(tags.contains("system:deleted"))
note_title.setPaintFlags(note_title.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
else
note_title.setPaintFlags(note_title.getPaintFlags() & ~Paint.STRIKE_THRU_TEXT_FLAG);
}
TextView note_modified = (TextView) v.FindViewById(Resource.Id.note_date);
if (note_modified != null) {
note_modified.SetText(strModified);
}
}