LoadIntro() public method

public LoadIntro ( BookItem b, bool useCache = true ) : void
b BookItem
useCache bool
return void
Exemplo n.º 1
0
        private void LoadBookInfo( string id )
        {
            string[] Argv = id.Split( new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries );

            if ( Argv.Length == 2 )
            {
                string Mode = Argv[ 0 ];
                id = Argv[ 1 ];

                if ( Mode == "Spider" )
                {
                    // XXX: TODO
                    return;
                }
                else if ( Mode == "Local" )
                {
                    // XXX: TODO
                    return;
                }

                // Commencing Level2 initializations
                new global::wenku8.System.Bootstrap().Level2();
            }

            BookItem BookEx = X.Instance<BookItem>( XProto.BookItemEx, id );
            BookEx.XSetProp(
                "Mode"
                , X.Const<string>( XProto.WProtocols, "ACTION_BOOK_META" ) );

            ThisBook = BookEx;

            if ( SkipThisPage )
            {
                new VolumeLoader( GoToContentReader ).Load( ThisBook );
                return;
            }

            if ( ViewInfo )
            {
                BookLoader BL = new BookLoader( UpdateBookInfoSection );
                BL.Load( ThisBook, true );
                BL.LoadIntro( ThisBook, true );
            }

            if ( ViewTOC )
            {
                new VolumeLoader( SetTemplateTOC ).Load( ThisBook );
            }

            if ( ViewComments )
            {
                SetTemplateComment( ThisBook );
            }
        }
Exemplo n.º 2
0
        private void BookClicked( BookInfoItem BookItem )
        {
            Logger.Log( ID, string.Format( "Clicked items is {0}, mode {1}", BookItem.Payload, BookItem.Mode ) );

            BookItem b = X.Instance<BookItem>( XProto.BookItemEx, BookItem.Payload );

            switch ( BookItem.Mode )
            {
                case SectionMode.InfoPane:
                    // Pane Loading = True
                    b.XSetProp( "Mode", X.Const<string>( XProto.WProtocols, "ACTION_BOOK_META" ) );

                    BookLoader loader = new BookLoader( UpdatePane );
                    loader.Load( b, true );
                    loader.LoadIntro( b, true );
                    RollOutInfoPane();
                    break;
                case SectionMode.DirectNavigation:
                    GotoBookInfoView( b.Id );
                    break;
            }
        }