// Called for each group that is enumerated
		protected void GroupsEnumerator (ALAssetsGroup group, ref bool stop)
		{
		    // when the enumeration is completed, this method is invoked with group set to null
			if (group != null) {
				Console.WriteLine ("Group found: " + group.Type.ToString ());
				
				// don't stop, baby
				stop = false;
		
				// photos and videos. could also pass AllVideos, AllVideos, etc.
				group.SetAssetsFilter (ALAssetsFilter.AllAssets);
		
				if (group.Name != null) 
					Console.WriteLine("Group Name: " + group.Name);
				
				// add the group to the assets dictionary
				groups.Add(group);
				assetGroups.Add(group, new List<ALAsset> ());
				currentGroup = group;
				
				// enumerate each asset within the group
				group.Enumerate(AssetEnumerator);
		    } else {
				Console.WriteLine ("Group enumeration completed.");
				
				assetGroupTableSource = new AssetGroupTableSource (groups);
				TableView.Source = assetGroupTableSource;
			
				assetGroupTableSource.GroupSelected += (object sender, AssetGroupTableSource.GroupSelectedEventArgs e) => {
					AssetEnumerationScreen assetScreen = new AssetEnumerationScreen (e.Group.Name, assetGroups[e.Group]);
					NavigationController.PushViewController (assetScreen, true);
				};
			}
		}
 private void GroupEnumerator(ALAssetsGroup group, ref bool shouldStop)
 {
     if (group == null)
     {
         shouldStop = true;
         return;
     }
     if (!shouldStop)
     {
         group.Enumerate(AssetEnumerator);
         shouldStop = false;
     }
     taskCompletionSource.TrySetResult(pictures);
 }
Beispiel #3
0
        /// <summary>
        /// Groups the enumerator.
        /// </summary>
        /// <param name="assetGroup">Asset group.</param>
        /// <param name="shouldStop">Should stop.</param>
        private void GroupEnumerator(ALAssetsGroup assetGroup, ref bool shouldStop)
        {
            if (assetGroup == null)
            {
                shouldStop = true;
                notifyAssetsLoaded();

                return;
            }

            if (!shouldStop)
            {
                assetGroup.Enumerate(AssetEnumerator);
                shouldStop = false;
            }
        }
Beispiel #4
0
        // Called for each group that is enumerated
        protected void GroupsEnumerator(ALAssetsGroup group, ref bool stop)
        {
            // when the enumeration is completed, this method is invoked with group set to null
            if (group != null)
            {
                Console.WriteLine("Group found: " + group.Type.ToString());

                // don't stop, baby
                stop = false;

                // photos and videos. could also pass AllVideos, AllVideos, etc.
                group.SetAssetsFilter(ALAssetsFilter.AllAssets);

                if (group.Name != null)
                {
                    Console.WriteLine("Group Name: " + group.Name);
                }

                // add the group to the assets dictionary
                groups.Add(group);
                assetGroups.Add(group, new List <ALAsset> ());
                currentGroup = group;

                // enumerate each asset within the group
                group.Enumerate(AssetEnumerator);
            }
            else
            {
                Console.WriteLine("Group enumeration completed.");

                assetGroupTableSource = new AssetGroupTableSource(groups);
                TableView.Source      = assetGroupTableSource;

                assetGroupTableSource.GroupSelected += (object sender, AssetGroupTableSource.GroupSelectedEventArgs e) => {
                    AssetEnumerationScreen assetScreen = new AssetEnumerationScreen(e.Group.Name, assetGroups[e.Group]);
                    NavigationController.PushViewController(assetScreen, true);
                };

                TableView.ReloadData();
            }
        }