コード例 #1
0
ファイル: PreloadImage.cs プロジェクト: ShelbyBoss/Editure
        private async Task <Tuple <string, BitmapImage> > GetTupleAsync(int index, int offset)
        {
            int startIndex = index;

            if (pictures.Count == 0)
            {
                return(null);
            }

            index = (index + offset + pictures.Count) % pictures.Count;

            try
            {
                string      path = pictures[index].FullName;
                BitmapImage bmp  = await EditImage.LoadBitmapAsync(path);

                return(new Tuple <string, BitmapImage>(path, bmp));
            }
            catch { }

            return(null);
        }
コード例 #2
0
ファイル: PreloadImage.cs プロジェクト: ShelbyBoss/Editure
        public async Task <BitmapImage> TryGetImageAsync(string path)
        {
            if (path == CurrentPath)
            {
                return(Current);
            }
            if (path == PreviousPath)
            {
                return(Previous);
            }
            if (path == NextPath)
            {
                return(Next);
            }

            try
            {
                return(await EditImage.LoadBitmapAsync(path));
            }
            catch { }

            return(null);
        }