コード例 #1
0
            public override string GetString(int column)
            {
                switch (column)
                {
                case 0:                         // _ID
                    return(MPos.ToString(CultureInfo.InvariantCulture));

                case 1:                         // SuggestColumnText1
                    return(CurrentEntry.Strings.ReadSafe(PwDefs.TitleField));

                case 2:                         // SuggestColumnText2
                    KeyValuePair <string, string> context;
                    if (mResultContexts.TryGetValue(CurrentEntry.Uuid, out context))
                    {
                        return(Internationalise(context));
                    }
                    return(null);

                case 3:                         // SuggestColumnIcon1
                    var builder = new Android.Net.Uri.Builder();
                    builder.Scheme(ContentResolver.SchemeContent);
                    builder.Authority(Authority);
                    builder.Path(GetIconPathQuery);
                    builder.AppendQueryParameter(IconIdParameter, CurrentEntry.IconId.ToString());
                    builder.AppendQueryParameter(CustomIconUuidParameter, CurrentEntry.CustomIconUuid.ToHexString());
                    return(builder.Build().ToString());

                case 4:                         // SuggestColumnIntentDataId
                    return(CurrentEntry.Uuid.ToHexString());

                default:
                    return(null);
                }
            }
コード例 #2
0
ファイル: SearchProvider.cs プロジェクト: Arushacked/keepass2
            public override string GetString(int column)
            {
                switch (column)
                {
                case 0:                         // _ID
                    return(MPos.ToString(CultureInfo.InvariantCulture));

                case 1:                         // SuggestColumnText1
                    return(CurrentEntry.Strings.ReadSafe(PwDefs.TitleField));

                case 2:                         // SuggestColumnText2
                    if (MPos < _entriesWithContexts.Count)
                    {
                        return(Internationalise(_entriesWithContexts[MPos].resultContext));
                    }
                    return("");

                case 3:                         // SuggestColumnIcon1
                    var builder = new Android.Net.Uri.Builder();
                    builder.Scheme(ContentResolver.SchemeContent);
                    builder.Authority(Authority);
                    builder.Path(GetIconPathQuery);
                    builder.AppendQueryParameter(IconIdParameter, CurrentEntry.IconId.ToString());
                    builder.AppendQueryParameter(CustomIconUuidParameter, CurrentEntry.CustomIconUuid.ToHexString());
                    builder.AppendQueryParameter(DatabaseIndexParameter, _entriesWithContexts[MPos].DatabaseIndex.ToString());
                    return(builder.Build().ToString());

                case 4:                         // SuggestColumnIntentDataId
                    return(new ElementAndDatabaseId(App.Kp2a.FindDatabaseForElement(CurrentEntry), CurrentEntry).FullId);

                default:
                    return(null);
                }
            }