コード例 #1
0
ファイル: MainForm.cs プロジェクト: mark-s/MSDN-to-Kindle
        private void reloadLibrary()
        {
            Cursor.Current = Cursors.WaitCursor;

            try
            {
                CleanUpTempDir();
                CreateTempDir();

                statusStrip1.Items.Clear();
                //statusStrip1.Items.Add(workingDir);
                statusStrip1.Items.Add(RootContentItem.Name);

                TOCTreeView.BeginUpdate();
                TOCTreeView.Nodes.Clear();

                _appController = new AppController(RootContentItem.ContentId, _currentLocale, RootContentItem.Version, TOCTreeView, _workingDir);

                TOCTreeView.EndUpdate();

                if (ContentDataSet.Tables[TableNames.ITEMINSTANCE] != null)
                    ContentDataSet.Tables[TableNames.ITEMINSTANCE].Clear();

                if (ContentDataSet.Tables[TableNames.ITEM] != null)
                    ContentDataSet.Tables[TableNames.ITEM].Clear();

                if (ContentDataSet.Tables[TableNames.PICTURE] != null)
                    ContentDataSet.Tables[TableNames.PICTURE].Clear();
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: mark-s/MSDN-to-Kindle
        private void MainForm_Load(object sender, EventArgs e)
        {
            try
            {
                Text = String.Format("Package This! - {0}", Assembly.GetExecutingAssembly().GetName().Version);

                // Unicode Start of String, chosen to avoid collisions possible with default sep
                // when we serialize the path to a file.
                TOCTreeView.PathSeparator = "\x0098";

                CreateTempDir();

                RootContentItem.CurrentLibrary = Settings.Default.currentLibrary;

                //statusStrip1.Items.Add(workingDir);
                statusStrip1.Items.Add(RootContentItem.Name);

                SplashForm.Status("Connecting to server..."); //First time we hit the server (at least in Australia) we get a 15 sec delay
                populateLocaleMenu();

                SplashForm.Status("Loading controls...");
                populateLibraryMenu();

                _appController = new AppController(RootContentItem.ContentId, _currentLocale, RootContentItem.Version, TOCTreeView, _workingDir);
            }
            finally
            {
                SplashForm.Done();
            }
        }