示例#1
0
 public static contentProvider getInstance()
 {
     if (m_instance == null)
     {
         m_instance = new contentProvider();
     }
     return(m_instance);
 }
示例#2
0
        public MainPage()
        {
            this.InitializeComponent();

            m_content      = contentProvider.getInstance();
            m_config       = m_content.m_mainPgCfg;
            m_lessonPgCfg  = m_content.m_lessonPgCfg;
            m_chapterPgCfg = m_content.m_chapterPgCfg;

            //test();
            //testWriteData();
            //ApplicationView.PreferredLaunchViewSize = new Size(480, 800);
            //ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

            //s_content.LoadChapterCompleted += C_LoadCompleted;
            //s_content.LoadMultiChapterCompleted += S_content_LoadMultiChapterCompleted;

            //this page events
            Loaded += MainPage_Loaded;
            //LayoutUpdated += MainPage_LayoutUpdated;
            Unloaded += MainPage_Unloaded;

            initCtrls();

            browserBtn.Tapped += browserBtn_ClickAsync;
            openBtn.Click     += browserBtn_ClickAsync;
            reloadBtn.Click   += reloadBtn_Click;
            addBtn.Click      += btnAdd_Click;
            nextBtn.Click     += btnNext_Click;
            prevBtn.Click     += PrevBtn_Click;
            clean.Click       += btnClean_Click;
            clearBtn.Click    += btnClean_Click;

            //background work
            m_bgwork            = new myWorker();
            m_bgwork.BgProcess += bg_process;
            m_bgwork.FgProcess += fg_process;
        }