예제 #1
0
                void GetAdditionalGroups( )
                {
                    if (RetrievingGroups == false)
                    {
                        RetrievingGroups = true;

                        BlockerView.Show(delegate
                        {
                            GroupFinder.GetGroups(GroupTypeId, StreetValue, CityValue, StateValue, ZipValue, CurrGroupIndex, NumRequestedGroups,
                                                  delegate(MobileAppApi.GroupSearchResult sourceLocation, List <MobileAppApi.GroupSearchResult> groupEntries, bool result)
                            {
                                BlockerView.Hide(delegate
                                {
                                    RetrievingGroups = false;

                                    // for additional groups, only take action if we got something back.
                                    if (result)
                                    {
                                        // increment our index to the next set, or the end of the list, whichever is less
                                        // this will ensure when we hit the end of the list, CurrGroupIndex reflects that.
                                        CurrGroupIndex += Math.Min(groupEntries.Count, NumRequestedGroups);

                                        GroupEntries.AddRange(groupEntries);

                                        UpdateMap(true);
                                    }
                                });
                            });
                        });
                    }
                }
예제 #2
0
        void GetAdditionalGroups( )
        {
            if (Searching == false)
            {
                Searching = true;

                BlockerView.Show(delegate
                {
                    GroupFinder.GetGroups(GroupTypeId, StreetValue, CityValue, StateValue, ZipValue, CurrGroupIndex, NumRequestedGroups,
                                          delegate(MobileAppApi.GroupSearchResult sourceLocation, List <MobileAppApi.GroupSearchResult> groupEntries, bool result)
                    {
                        BlockerView.Hide(delegate
                        {
                            Searching = false;

                            if (result)
                            {
                                // increment our index to the next set, or the end of the list, whichever is less
                                // this will ensure when we hit the end of the list, CurrGroupIndex reflects that.
                                CurrGroupIndex += Math.Min(groupEntries.Count, NumRequestedGroups);

                                // add in the new results
                                GroupEntries.AddRange(groupEntries);

                                // update the map
                                UpdateMap(result);

                                // and reload the table
                                GroupFinderTableView.ReloadData( );

                                // since we're only loading additional groups, don't flag the
                                // list as updated. We don't want it to reset to the top.
                                GroupListUpdated = false;
                            }
                        });
                    });
                });
            }
        }