Beispiel #1
0
        public override Navigator GetChildNavigatorWithContent(object content)
        {
            _contacts.VerifyAccess();

            var contact = content as FacebookContact;

            if (contact == null)
            {
                return(null);
            }

            for (int index = 0; index < _contacts.Count; ++index)
            {
                if (_contacts[index].Equals(contact))
                {
                    var navigator = new ContactNavigator(_contacts[index], this)
                    {
                        ParentIndex = index,
                    };
                    return(navigator);
                }
            }

            return(null);
        }
Beispiel #2
0
        public Navigator GetContactWithUserName(string username)
        {
            _contacts.VerifyAccess();

            for (int index = 0; index < _contacts.Count; ++index)
            {
                if (!string.IsNullOrEmpty(_contacts[index].UserName) && _contacts[index].UserName.Equals(username, StringComparison.OrdinalIgnoreCase))
                {
                    var navigator = new ContactNavigator(_contacts[index], this)
                    {
                        ParentIndex = index,
                    };
                    return(navigator);
                }
            }

            return(null);
        }
Beispiel #3
0
        public Navigator GetContactWithId(FacebookObjectId id)
        {
            _contacts.VerifyAccess();

            for (int index = 0; index < _contacts.Count; ++index)
            {
                if (_contacts[index].UserId == id)
                {
                    var navigator = new ContactNavigator(_contacts[index], this)
                    {
                        ParentIndex = index,
                    };
                    return(navigator);
                }
            }

            return(null);
        }
Beispiel #4
0
        protected override Navigator GetChildNavigatorWithGuid(FacebookObjectId guid)
        {
            Verify.IsTrue(FacebookObjectId.IsValid(guid), "Invalid guid");
            _contacts.VerifyAccess();

            for (int index = 0; index < _contacts.Count; ++index)
            {
                if (_contacts[index].UserId == guid)
                {
                    var navigator = new ContactNavigator(_contacts[index], this)
                    {
                        ParentIndex = index,
                    };
                    return(navigator);
                }
            }

            return(null);
        }