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


C# Android.GetQueryParameter方法代码示例

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


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

示例1: Query

		public override Android.Database.ICursor Query (Android.Net.Uri uri, string[] projection, string selection, string[] selectionArgs, string sortOrder)
		{
			if (LOGV) Log.Verbose(TAG, "query(uri=" + uri + ", proj=" + projection.ToString() + ")");
	        SQLiteDatabase db = mOpenHelper.ReadableDatabase;
	
	        int match = sUriMatcher.Match(uri);
	        switch (match) {
	            default: {
	                // Most cases are handled with simple SelectionBuilder
	                SelectionBuilder builder = BuildExpandedSelection(uri, match);
	                return builder.Where(selection, selectionArgs).Query(db, projection, sortOrder);
	            }
	            case SEARCH_SUGGEST: {
	                SelectionBuilder builder = new SelectionBuilder();
	
	                // Adjust incoming query to become SQL text match
	                selectionArgs[0] = selectionArgs[0] + "%";
	                builder.Table(ScheduleDatabase.Tables.SEARCH_SUGGEST);
	                builder.Where(selection, selectionArgs);
	                builder.Map(SearchManager.SuggestColumnQuery,
	                        SearchManager.SuggestColumnText1);
	
	                projection = new String[] { BaseColumns.Id, SearchManager.SuggestColumnText1,
	                        SearchManager.SuggestColumnQuery };
	
	                String limit = uri.GetQueryParameter(SearchManager.SuggestParameterLimit);
	                return builder.Query(db, projection, null, null, ScheduleContract.SearchSuggest.DEFAULT_SORT, limit);
	            }
	        }
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:30,代码来源:ScheduleProvider.cs

示例2: OpenFile

        public override ParcelFileDescriptor OpenFile(Android.Net.Uri uri, string mode)
        {
            switch ((UriMatches)UriMatcher.Match(uri))
            {
                case UriMatches.GetIcon:
                    var iconId = (PwIcon)Enum.Parse(typeof(PwIcon), uri.GetQueryParameter(IconIdParameter));
                    var customIconUuid = new PwUuid(MemUtil.HexStringToByteArray(uri.GetQueryParameter(CustomIconUuidParameter)));

                    var iconDrawable = _db.DrawableFactory.GetIconDrawable(App.Context.Resources, _db.KpDatabase, iconId, customIconUuid) as BitmapDrawable;
                    if (iconDrawable != null)
                    {
                        var pipe = ParcelFileDescriptor.CreatePipe();
                        var outStream = new OutputStreamInvoker(new ParcelFileDescriptor.AutoCloseOutputStream(pipe[1]));

                        ThreadPool.QueueUserWorkItem(state =>
                            {
                                iconDrawable.Bitmap.Compress(Bitmap.CompressFormat.Png, 100, outStream);
                                outStream.Close();
                            });

                        return pipe[0];
                    }

                    // Couldn't get an icon for some reason.
                    return null;
                default:
                    throw new ArgumentException("Unknown Uri: " + uri, "uri");
            }
        }
开发者ID:pythe,项目名称:wristpass,代码行数:29,代码来源:SearchProvider.cs


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