public override UIImage IconForSize(nuint size)
        {
            string text        = null;
            nuint  bucketIndex = 0;

            if (options.EnableBuckets)
            {
                var buckets = options.Buckets;
                bucketIndex = BucketIndexForSize((nint)size);
                text        = size < (nuint)buckets[0] ? size.ToString() : $"{buckets[bucketIndex]}+";
            }
            else
            {
                text = size.ToString();
            }

            if (options.RendererCallback != null)
            {
                return(DefaultImageFactory.Instance.ToUIImage(options.RendererCallback(text)));
            }
            if (options.RendererImage != null)
            {
                return(GetIconForText(text, DefaultImageFactory.Instance.ToUIImage(options.RendererImage)));
            }
            return(GetIconForText(text, bucketIndex));
        }
コード例 #2
0
        public override UIImage IconForSize(nuint size)
        {
            nuint bucketIndex = 0;
            var   sizes       = size / 2;

            if (options.EnableBuckets)
            {
                var buckets = options.Buckets;
                bucketIndex = BucketIndexForSize((nint)size);
            }
            if (options.RendererCallback != null)
            {
                return(DefaultImageFactory.Instance.ToUIImage(options.RendererCallback(sizes.ToString())));
            }
            if (options.RendererImage != null)
            {
                return(GetIconForText(sizes.ToString(), DefaultImageFactory.Instance.ToUIImage(options.RendererImage)));
            }
            return(GetIconForText(sizes.ToString(), bucketIndex));
        }