Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #47 from xamarin/bugs-2015-06-08
Browse files Browse the repository at this point in the history
Bugs 2015 06 08
  • Loading branch information
bholmes committed Jun 9, 2015
2 parents 90e3a23 + ee483b1 commit 8e5bcf4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Details.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on Android):
using Xamarin.Contacts;
// ...
var book = new AddressBook ();
var book = new Xamarin.Contacts.AddressBook ();
// new AddressBook (this); on Android
if (!await book.RequestPermission()) {
Console.WriteLine ("Permission denied by user or manifest");
Expand Down
2 changes: 1 addition & 1 deletion GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on Android):
using Xamarin.Contacts;
// ...
var book = new AddressBook ();
var book = new Xamarin.Contacts.AddressBook ();
book.RequestPermission().ContinueWith (t => {
if (!t.Result) {
Console.WriteLine ("Permission denied by user or manifest");
Expand Down
7 changes: 5 additions & 2 deletions MonoDroid/Xamarin.Mobile/Contacts/ContactHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ internal static IEnumerable<Contact> GetContacts (bool rawContacts, ContentResol
if (currentContact != null)
map.Add (currentContact.Id, currentContact);

for (; x < ids.Length; x++)
yield return map[ids[x]];
for (; x < ids.Length; x++) {
Contact tContact = null;
if (map.TryGetValue (ids[x], out tContact))
yield return tContact;
}
}
finally
{
Expand Down
12 changes: 10 additions & 2 deletions MonoDroid/Xamarin.Mobile/ContentQueryTranslator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,12 @@ private bool TryGetTable (List<MemberExpression> memberExpressions)

Table = presult.Table;

if (presult.MimeType != null)
if (presult.MimeType != null) {
if (this.queryBuilder.Length > 0)
this.queryBuilder.Append (" AND ");

this.queryBuilder.Append (String.Format ("({0} = ?)", ContactsContract.DataColumns.Mimetype));
}

this.arguments.Add (presult.MimeType);

Expand All @@ -602,8 +606,12 @@ private bool TryGetTable (MemberExpression me)
}

TableFindResult result = this.tableFinder.Find (me);
if (result.MimeType != null)
if (result.MimeType != null) {
if (this.queryBuilder.Length > 0)
this.queryBuilder.Append (" AND ");

this.queryBuilder.Append (String.Format ("({0} = ?)", ContactsContract.DataColumns.Mimetype));
}

this.arguments.Add (result.MimeType);

Expand Down

0 comments on commit 8e5bcf4

Please sign in to comment.