Ejemplo n.º 1
0
        void SelectedAssets(List <ALAsset> assets)
        {
            var results = new List <AssetResult>(assets.Count);

            foreach (var asset in assets)
            {
                var obj = asset.AssetType;
                if (obj == default(ALAssetType))
                {
                    continue;
                }

                var rep = asset.DefaultRepresentation;
                if (rep != null)
                {
                    var result = new AssetResult();
                    UIImageOrientation orientation = UIImageOrientation.Up;
                    var cgImage = rep.GetFullScreenImage();

                    //set if not null
                    if (cgImage != null)
                    {
                        result.Image = new UIImage(cgImage, 1.0f, orientation);
                    }

                    result.Name = rep.Filename;
                    result.Path = rep.Url.AbsoluteString;

                    results.Add(result);
                }
            }

            _TaskCompletionSource.TrySetResult(results);
        }
        void SelectedAssets(List<ALAsset> assets)
        {
            var results = new List<AssetResult> (assets.Count);
            foreach (var asset in assets) {
                var obj = asset.AssetType;
                if (obj == default (ALAssetType))
                    continue;

                var rep = asset.DefaultRepresentation;
                if (rep != null) {
                    var result = new AssetResult ();
                    UIImageOrientation orientation = UIImageOrientation.Up;
                    var cgImage = rep.GetFullScreenImage ();
                    result.Image = new UIImage (cgImage, 1.0f, orientation);
                    result.Name = rep.Filename;
                    result.Path = rep.Url.AbsoluteString;

                    results.Add (result);
                }
            }

            _TaskCompletionSource.TrySetResult (results);
        }