Beispiel #1
0
        public TabPage(MainWindow mw, Favourites f)
        {
            this.mw = mw;
            error   = "";
            fav     = f;
            InitializeComponent();
            Page5 welcome = new Page5(mw);
            Grid  g1      = new Grid();

            g1 = welcome.welcome;
            welcome.Content = null;
            this.ResultsPane.Items.Add(g1);
            this.Searcher = new System.ComponentModel.BackgroundWorker();
            this.Searcher.WorkerReportsProgress      = true;
            this.Searcher.WorkerSupportsCancellation = true;


            this.Searcher.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.Searcher_DoWork);
            this.Searcher.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.Searcher_ProgressChanged);
            this.Searcher.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Searcher_RunWorkerCompleted);


            this.viewCitation = new System.ComponentModel.BackgroundWorker();
            this.viewCitation.WorkerReportsProgress      = true;
            this.viewCitation.WorkerSupportsCancellation = true;
            this.viewCitation.DoWork             += new System.ComponentModel.DoWorkEventHandler(this.Citation_DoWork);
            this.viewCitation.ProgressChanged    += new System.ComponentModel.ProgressChangedEventHandler(this.Citation_ProgressChanged);
            this.viewCitation.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Citation_RunWorkerCompleted);
            controllerList = new List <Controller>();

            progressBar.Visibility = System.Windows.Visibility.Hidden;
            this.searchBox.Opacity = 1;


            this.UpdateStatusBar += updateStatusBar;  // related to statusbar

            updateStatusBar("Ready To Search...");


            /*
             * Initially two tabs are created:
             * One for the search
             * Other for adding a new tab
             */

            //Dummy to test

            /*pageList = new List<Button>();
             * Button b;
             * for (int i = 0; i < 12; i++)
             * {
             *  b = new Button();
             *  b.HorizontalAlignment = HorizontalAlignment.Stretch;
             *  b.Background = new SolidColorBrush(Colors.White);
             *  b.Foreground = new SolidColorBrush(Colors.Blue);
             *  b.BorderBrush = Brushes.White;
             *  b.BorderThickness = new Thickness(0);
             *  b.Cursor = Cursors.Hand;
             *  b.Uid = i + "";
             *  if (i == 0)
             *      b.Content = b.Uid = "previous";
             *  else if (i == 11)
             *      b.Content = b.Uid = "next";
             *  else
             *      b.Content = (i) + "";
             *  if (i == 1)
             *  {
             *      b.Foreground = new SolidColorBrush(Colors.Black);
             *      b.Background = Brushes.LightGray;
             *  }
             *  else
             *  {
             *      b.Background = Brushes.White;
             *      b.Foreground = new SolidColorBrush(Colors.Blue);
             *  }
             *  b.Click += b_Click;
             *  pageList.Add(b);
             *  Pagination.Children.Add(pageList[i]);
             * }*/
            //Dummy to test
        }
        public TabPage(MainWindow mw, Favourites f)
        {
            this.mw = mw;
            error = "";
            fav = f;
            InitializeComponent();
            Page5 welcome = new Page5(mw);
            Grid g1 = new Grid();
            g1 = welcome.welcome;
            welcome.Content = null;
            this.ResultsPane.Items.Add(g1);
            this.Searcher = new System.ComponentModel.BackgroundWorker();
            this.Searcher.WorkerReportsProgress = true;
            this.Searcher.WorkerSupportsCancellation = true;


            this.Searcher.DoWork += new System.ComponentModel.DoWorkEventHandler(this.Searcher_DoWork);
            this.Searcher.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.Searcher_ProgressChanged);
            this.Searcher.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Searcher_RunWorkerCompleted);


            this.viewCitation = new System.ComponentModel.BackgroundWorker();
            this.viewCitation.WorkerReportsProgress = true;
            this.viewCitation.WorkerSupportsCancellation = true;
            this.viewCitation.DoWork += new System.ComponentModel.DoWorkEventHandler(this.Citation_DoWork);
            this.viewCitation.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.Citation_ProgressChanged);
            this.viewCitation.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.Citation_RunWorkerCompleted);
            controllerList = new List<Controller>();

            progressBar.Visibility = System.Windows.Visibility.Hidden;
            this.searchBox.Opacity = 1;


            this.UpdateStatusBar += updateStatusBar;  // related to statusbar

            updateStatusBar("Ready To Search...");

            
            /*
             * Initially two tabs are created:
             * One for the search
             * Other for adding a new tab
           */

            //Dummy to test
            /*pageList = new List<Button>();
            Button b;
            for (int i = 0; i < 12; i++)
            {
                b = new Button();
                b.HorizontalAlignment = HorizontalAlignment.Stretch;
                b.Background = new SolidColorBrush(Colors.White);
                b.Foreground = new SolidColorBrush(Colors.Blue);
                b.BorderBrush = Brushes.White;
                b.BorderThickness = new Thickness(0);
                b.Cursor = Cursors.Hand;
                b.Uid = i + "";
                if (i == 0)
                    b.Content = b.Uid = "previous";
                else if (i == 11)
                    b.Content = b.Uid = "next";
                else
                    b.Content = (i) + "";
                if (i == 1)
                {
                    b.Foreground = new SolidColorBrush(Colors.Black);
                    b.Background = Brushes.LightGray;
                }
                else
                {
                    b.Background = Brushes.White;
                    b.Foreground = new SolidColorBrush(Colors.Blue);
                }
                b.Click += b_Click;
                pageList.Add(b);
                Pagination.Children.Add(pageList[i]);
            }*/
            //Dummy to test
        }