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


C# ContentValues.ToString方法代码示例

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


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

示例1: Update

		public override int Update (Uri uri, ContentValues values, string selection, string[] selectionArgs)
		{
			if (LOGV) Log.Verbose(TAG, "update(uri=" + uri + ", values=" + values.ToString() + ")");
	        SQLiteDatabase db = mOpenHelper.WritableDatabase;
	        SelectionBuilder builder = BuildSimpleSelection(uri);
	        int retVal = builder.Where(selection, selectionArgs).Update(db, values);
	        Context.ContentResolver.NotifyChange(uri, null);
	        return retVal;
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:9,代码来源:ScheduleProvider.cs

示例2: Insert

		public override Uri Insert (Uri uri, ContentValues values)
		{
			if (LOGV) Log.Verbose(TAG, "insert(uri=" + uri + ", values=" + values.ToString() + ")");
	        SQLiteDatabase db = mOpenHelper.WritableDatabase;
	        int match = sUriMatcher.Match(uri);
	        switch (match) {
	            case BLOCKS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.BLOCKS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Blocks.BuildBlockUri(values.GetAsString(ScheduleContract.Blocks.BLOCK_ID));
	            }
	            case TRACKS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.TRACKS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Tracks.BuildTrackUri(values.GetAsString(ScheduleContract.Tracks.TRACK_ID));
	            }
	            case ROOMS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.ROOMS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Rooms.BuildRoomUri(values.GetAsString(ScheduleContract.Rooms.ROOM_ID));
	            }
	            case SESSIONS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.SESSIONS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Sessions.BuildSessionUri(values.GetAsString(ScheduleContract.Sessions.SESSION_ID));
	            }
	            case SESSIONS_ID_SPEAKERS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.SESSIONS_SPEAKERS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Speakers.BuildSpeakerUri(values.GetAsString(ScheduleDatabase.SessionsSpeakers.SPEAKER_ID));
	            }
	            case SESSIONS_ID_TRACKS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.SESSIONS_TRACKS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Tracks.BuildTrackUri(values.GetAsString(ScheduleDatabase.SessionsTracks.TRACK_ID));
	            }
	            case SPEAKERS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.SPEAKERS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Speakers.BuildSpeakerUri(values.GetAsString(ScheduleContract.Speakers.SPEAKER_ID));
	            }
	            case VENDORS: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.VENDORS, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.Vendors.BuildVendorUri(values.GetAsString(ScheduleContract.Vendors.VENDOR_ID));
	            }
	            case SEARCH_SUGGEST: {
	                db.InsertOrThrow(ScheduleDatabase.Tables.SEARCH_SUGGEST, null, values);
	                Context.ContentResolver.NotifyChange(uri, null);
	                return ScheduleContract.SearchSuggest.CONTENT_URI;
	            }
	            default: {
	                throw new Exception("Unknown uri: " + uri);
	            }
	        }
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:56,代码来源:ScheduleProvider.cs


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