wenku8.Model.Loaders.ChapterLoader.Load C# (CSharp) Method

Load() public method

public Load ( Chapter C, bool Cache = true ) : void
C Chapter
Cache bool
return void
        public async void Load( Chapter C, bool Cache = true )
        {
            await LoadAsync( C, Cache );
        }

Usage Example

Esempio n. 1
0
        internal static void DownloadVolume( BookItem ThisBook, Volume Vol )
        {
            if ( ThisBook is BookInstruction )
            {
                Chapter[] Chs = Vol.ChapterList;

                int i = 0; int l = Chs.Length;

                ChapterLoader Loader = null;
                Loader = new ChapterLoader( ThisBook, C => {
                    C.UpdateStatus();

                    if ( i < l )
                    {
                        Loader.Load( Chs[ i++ ] );
                    }
                } );

                Loader.Load( Chs[ i++ ] );
                return;
            }


            Worker.ReisterBackgroundWork( () =>
            {
                string id = ThisBook.Id;
                string CVid = Vol.vid;

                foreach ( Chapter c in Vol.ChapterList )
                {
                    if ( !c.IsCached )
                    {
                        Logger.Log( ID, "Registering: " + c.ChapterTitle, LogType.DEBUG );
                        App.RuntimeTransfer.RegisterRuntimeThread(
                            X.Call<XKey[]>( XProto.WRequest, "GetBookContent", id, c.cid )
                            , c.ChapterPath, Guid.NewGuid()
                            , Uri.EscapeDataString( ThisBook.Title ) + "&" + Uri.EscapeDataString( Vol.VolumeTitle ) + "&" + Uri.EscapeDataString( c.ChapterTitle )
                            , c.IllustrationPath
                        );
                    }
                }

                App.RuntimeTransfer.StartThreadCycle( ( a, b ) =>
                {
                    LoadComplete( a, b );
                    Worker.UIInvoke( () => { foreach ( Chapter C in Vol.ChapterList ) C.UpdateStatus(); } );
                } );

                App.RuntimeTransfer.ResumeThread();
            } );
        }
All Usage Examples Of wenku8.Model.Loaders.ChapterLoader::Load