afung.MangaWeb3.Client.Widget.MangaPage.Load C# (CSharp) Method

Load() public method

public Load ( System.Action onload, System.Action onfailure ) : void
onload System.Action
onfailure System.Action
return void
        public void Load(Action onload, Action onfailure)
        {
            if (loaded)
            {
                onload();
                return;
            }

            this.onload = onload;
            this.onfailure = onfailure;

            loading = true;

            pageRequest = new MangaPageRequest();
            pageRequest.id = mangaId;
            pageRequest.page = ltr ? totalPages - page - 1 : page;
            pageRequest.width = Settings.DisplayType == 0 ? 0 : (int)Math.Round(width * Environment.PixelRatio); // Fit Height?
            pageRequest.height = Settings.DisplayType == 2 ? 0 : (int)Math.Round(height * Environment.PixelRatio); // Fit Width?
            pageRequest.dimensions = Environment.IsiOS && Settings.FixAutoDownscale;
            pageRequest.part = 0;

            Request.Send(pageRequest, MangaPageRequestSucess);
        }