Exemple #1
0
        public async Task ReturnContainerRev(ImgContainer container)
        {
            container.Cts?.Cancel();
            CancellationTokenSource cts = new CancellationTokenSource();

            container.Cts = cts;

            Containers.ForEach(c => c.CurrentIndex += 1);
            container.CurrentIndex = -numofBackwardContainer;
            container.InitPos(CurrentSlideDirection);
            ReleaseContainerImage(container);
            ImagePool.ShiftForwardIndex(-container.NumofImage);
            MapImageFileContextToContainer(container, true);
            MainWindow.Current.UpdatePageInfo();
            await container.LoadImage(cts.Token);
        }
Exemple #2
0
        public async Task ReturnContainer(ImgContainer container)
        {
            // まだコンテナにTaskが残っているならキャンセル
            container.Cts?.Cancel();

            // キャンセルトークン作成
            CancellationTokenSource cts = new CancellationTokenSource();

            container.Cts = cts;

            Containers.ForEach(c => c.CurrentIndex -= 1);
            container.CurrentIndex = numofForwardContainer;
            container.InitPos(CurrentSlideDirection);
            ReleaseContainerImage(container);
            ImagePool.ShiftBackwardIndex(container.NumofImage);
            MapImageFileContextToContainer(container, false);
            MainWindow.Current.UpdatePageInfo();
            await container.LoadImage(cts.Token);
        }