Exemplo n.º 1
0
        List <DateTime> FindRange()
        {
            DateTime low = new DateTime(1900, 01, 01);
            DateTime hi  = new DateTime(2099, 01, 01);

            foreach (CPhoto photo in _DB.Photos)
            {
                foreach (CStats stat in photo.Stats)
                {
                    if (CWorker.Str2DT(stat.Date) > low)
                    {
                        low = CWorker.Str2DT(stat.Date);
                    }
                    if (CWorker.Str2DT(stat.Date) < hi)
                    {
                        hi = CWorker.Str2DT(stat.Date);
                    }
                }
            }
            List <DateTime> lDate = new List <DateTime>();

            lDate.Add(low);
            lDate.Add(hi);
            return(lDate.OrderBy(q => q).ToList());
        }
Exemplo n.º 2
0
    public void SpwanVillagers()
    {
        //Appel GetNPC
        m_beggar    = m_Factory.GetNPC(NPCType.Beggar);
        m_Farmer    = m_Factory.GetNPC(NPCType.Farmer);
        m_Shopowner = m_Factory.GetNPC(NPCType.ShopOwner);

        m_beggar.Speak();
        m_Farmer.Speak();
        m_Shopowner.Speak();
    }
Exemplo n.º 3
0
        CStats FindIf(List <CStats> stats, DateTime dt)
        {
            string dtStr = CWorker.DT2Str(dt);

            foreach (CStats stat in stats)
            {
                if (dtStr == stat.Date)
                {
                    return(stat);
                }
            }
            return(null);
        }
Exemplo n.º 4
0
        public CTotalViews FindTotalViews(string dateSTR, CXDB xDB)
        {
            DateTime dt = CWorker.Str2DT(dateSTR);

            foreach (CTotalViews record in xDB.Totals)
            {
                if (dt == CWorker.Str2DT(record.Date))
                {
                    return(record);
                }
            }
            return(null);
        }
Exemplo n.º 5
0
        static void Main(string[] args)
        {
            string _BasePath = @"C:\temp\";
            string _BaseName = "FLICKRDB";
            CDB    _DB;
            CDB    _DB2;

            CWorker.BasePath         = _BasePath;
            CWorker.DataBaseRootName = _BaseName;
            _DB = CWorker.ReadDB();
            CWorker.DataBaseRootName = "OLD";
            CWorker.BasePath         = @"C:\Temp\";
            _DB2 = CWorker.ReadDB();

            foreach (CPhoto photo in _DB.Photos)
            {
                foreach (CPhoto catchUp in _DB2.Photos)
                {
                    if (photo.ID == catchUp.ID)
                    {
                        bool delta = false;
                        foreach (CStats stats in catchUp.Stats)
                        {
                            bool addIn = true;
                            for (int ndx = 0; ndx != photo.Stats.Count; ndx++)
                            {
                                if (stats.Date == photo.Stats[ndx].Date)
                                {
                                    addIn = false;
                                    break;
                                }
                            }
                            if (addIn)
                            {
                                delta = true;
                                photo.Stats.Add(new CStats(CWorker.Str2DT(stats.Date), stats.Views));
                            }
                        }
                        if (delta)
                        {
                            //(from x in xDB.Data orderby x.Total descending orderby x.Month descending select x).ToList();
                            photo.Stats = (from x in photo.Stats orderby x.Date select x).ToList();
                        }
                    }
                }
            }
            CWorker.DataBaseRootName = "Next";
            CWorker.StoreDB(_DB);
        }
Exemplo n.º 6
0
        List <CStats> DeltaArray(List <CStats> stats)
        {
            List <CStats> statOut = new List <CStats>();

            statOut.Add(new CStats(CWorker.Str2DT(stats[0].Date), 0));
            for (int ndx = 1; ndx != stats.Count; ndx++)
            {
                CStats priorObject = stats[ndx - 1];
                int    prior       = stats[ndx - 1].Views;
                statOut.Add(new CStats(CWorker.Str2DT(stats[ndx].Date), (stats[ndx].Views - priorObject.Views)));
            }
            int xdx = stats.Count - 1;

            return(statOut);
        }
Exemplo n.º 7
0
        static string _MakeSuperRow(CData record)
        {
            string href        = string.Format(FMTHREF, record.MetaData.ID);
            string src         = string.Format(FMTSRC, record.MetaData.ThumbURL);
            string todayString = CWorker.SuperFormatInt(record.Today);
            string totalString = CWorker.SuperFormatInt(record.Total);
            string weekString  = CWorker.SuperFormatInt(record.Week);
            string monthString = CWorker.SuperFormatInt(record.Month);

            string y = string.Empty;

            y = string.Format("<tr><td><img {4}/></td><td><a {5} target='_blank'>{6}</a></td><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td></tr>",
                              totalString, monthString, weekString, todayString, src, href, record.MetaData.Title);
            return(y);
        }
Exemplo n.º 8
0
        static string _MakeRowViewTotals(CTotalViews record, CTotalViews prior)
        {
            string views;
            string total;

            views = CWorker.FormatInt(record.Views);
            total = CWorker.FormatInt(record.Total);
            if (record.Views < 1)
            {
                views = "_";
            }
            if (record.Total < 1)
            {
                total = "_";
            }


            return(string.Format("<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>", CWorker.FormatDateString(record.Date), total, views));
        }
Exemplo n.º 9
0
        List <CTotalViews> TotalViews(CDB db)
        {
            List <CTotalViews> output = new List <CTotalViews>();

            foreach (string date in MakeDateList(db))
            {
                output.Add(new CTotalViews(date));
            }

            foreach (CPhoto photo in db.Photos)
            {
                int         offset  = 0;
                int         running = 0;
                CTotalViews prior   = null;
                foreach (CTotalViews record in output)
                {
                    CStats stat = FindIf(photo.Stats, CWorker.Str2DT(record.Date));
                    if (stat != null)
                    {
                        record.Views += stat.Views;
                        running      += stat.Views;
                    }
                    if (stat == null)
                    {
                        if (prior != null)
                        {
                            record.Views += prior.Views;
                        }
                    }
                    offset++;
                    prior       = new CTotalViews(record.Date);
                    prior.Views = record.Views;
                }
            }
            return(output);
        }
Exemplo n.º 10
0
 public void Commit()
 {
     CWorker.StoreXDB(xDB);
 }
Exemplo n.º 11
0
 public CStatistics(string basePath, string dbRootname)
 {
     CWorker.BasePath         = basePath;
     CWorker.DataBaseRootName = dbRootname;
     _DB = CWorker.ReadDB();
 }
Exemplo n.º 12
0
        public CXDB Exec()
        {
            if (_DB == null)
            {
                return(null);
            }
            if (_DB.Photos == null)
            {
                return(null);
            }
            if (_DB.Photos.Count == 0)
            {
                return(null);
            }

            DateTime today = CWorker.FixDate(DateTime.Now);

            //xDB.Totals = _DB.TotalViews();
            //xDB.Totals = TotalViews(_DB);
            //xDB.Totals = TotalDelta(xDB);
            xDB.Totals = new List <CTotalViews>();
            CDate dateRecord = new CDate();

            dateRecord.WeekDays  = 6;
            dateRecord.PriorDays = 1;
            dateRecord.MonthDays = 30;
            string todayStr = CWorker.DT2StrReadable(CWorker.FixDate(today));

            dateRecord.Today = todayStr;
            dateRecord.Prior = todayStr + " : " + CWorker.DT2StrReadable(CWorker.FixDate((CWorker.DTSub(today, dateRecord.PriorDays))));
            dateRecord.First = todayStr;
            dateRecord.Week  = CWorker.DT2StrReadable(CWorker.FixDate((CWorker.DTSub(today, dateRecord.WeekDays)))) + " : " + todayStr;
            dateRecord.Month = CWorker.DT2StrReadable(CWorker.FixDate((CWorker.DTSub(today, dateRecord.MonthDays)))) + " : " + todayStr;

            xDB.Date = dateRecord;


            xDB.Views    = new CViews();
            xDB.Pictures = new CViews();

            int ViewsTotal = 0;
            int ViewsToday = 0;
            int ViewsWeek  = 0;
            int ViewsMonth = 0;

            int picturesTotal = 0;

            xDB.Pictures.Today = 0;
            int picturesWeek  = 0;
            int picturesMonth = 0;

            List <DateTime> range = FindRange();


            xDB.Pictures.Today = 0;
            xDB.Pictures.Total = 0;
            xDB.Pictures.Week  = 0;
            xDB.Pictures.Month = 0;

            xDB.Views.Total = 0;
            xDB.Views.Today = 0;
            xDB.Views.Week  = 0;
            xDB.Views.Month = 0;
            xDB.MaxCount    = 0;



            int maxCount = -1;

            foreach (CPhoto photo in _DB.Photos)
            {
                if (photo.ID == "4633792226")
                {
                    string x = "y";
                }
                List <CStats> fullStat  = FillArray(photo.Stats, range);//
                List <CStats> deltaList = DeltaArray(fullStat);
                if (fullStat.Count < 2)
                {
                    continue;
                }
                if (fullStat.Count > xDB.MaxCount)
                {
                    xDB.MaxCount = fullStat.Count;
                }


                int thisWeek  = 0;
                int thisToday = 0;
                int thisMonth = 0;


                //CStats urRecord = fullStat[0];
                CStats current = FindIf(fullStat, today);//



                ViewsTotal += current.Views;
                if (current.Views != 0)
                {
                    picturesTotal++;
                }


                //thisToday = CWorker.Delta2(today, deltaList, dateRecord.PriorDays);
                CStats temp = FindIf(deltaList, today);
                if (temp == null)
                {
                    continue;
                }
                thisToday = temp.Views;

                ViewsToday += thisToday;
                if (thisToday != 0)
                {
                    xDB.Pictures.Today++;
                }

                thisWeek   = CWorker.Delta2(today, deltaList, dateRecord.WeekDays);
                ViewsWeek += thisWeek;
                if (thisWeek != 0)
                {
                    picturesWeek++;
                }

                thisMonth   = CWorker.Delta2(today, deltaList, dateRecord.MonthDays);
                ViewsMonth += thisMonth;
                if (thisMonth != 0)
                {
                    picturesMonth++;
                }
                UpdateViews(xDB, deltaList);
                UpdateTotals(xDB, fullStat);
                CData data = new CData();
                data.MetaData = new CMetaData(photo);
                data.Total    = current.Views;
                data.Week     = thisWeek;
                data.Today    = thisToday;
                data.Month    = thisMonth;
                xDB.Data.Add(data);
            }


            xDB.Pictures.Total = picturesTotal;
            xDB.Pictures.Week  = picturesWeek;
            xDB.Pictures.Month = picturesMonth;

            xDB.Views.Total = ViewsTotal;
            xDB.Views.Today = ViewsToday;
            xDB.Views.Week  = ViewsWeek;
            xDB.Views.Month = ViewsMonth;
            xDB.MaxCount    = maxCount;
            return(xDB);
        }
Exemplo n.º 13
0
 public void Commit()
 {
     CWorker.StoreDB(_DB);
 }
Exemplo n.º 14
0
        public CDB Exec()
        {
            if (_DB.GetOAuthToken == null)
            {
                AccessToken.FullName     = "Cloud2013";
                AccessToken.Token        = "72157644879828272-04fe2e4af1f40866";
                AccessToken.UserId       = "26095572@N07";
                AccessToken.TokenSecret  = "02947f478d4b0cc1";
                FlickrManager.OAuthToken = AccessToken;
                _F = FlickrManager.GetAuthInstance("2c67273e05ae10a7001e5b569df4f7d1", "d8906735118cab71");

                _DB.SetUser(AccessToken.FullName, AccessToken.UserId);
                _DB.APIKey       = "2c67273e05ae10a7001e5b569df4f7d1";
                _DB.SharedSecret = "d8906735118cab71";
                _DB.Token        = AccessToken.Token;
                _DB.TokenSecret  = AccessToken.TokenSecret;
            }
            else
            {
                FlickrManager.OAuthToken = _DB.GetOAuthToken;
                _F = FlickrManager.GetAuthInstance(_DB.APIKey, _DB.SharedSecret);
            }
            int ndx    = 0;
            int update = 0;
            int insert = 0;
            int dup    = 0;

            while (true)
            {
                PhotoCollection photo = _F.PeopleGetPhotos(PhotoSearchExtras.Views, ndx++, 500);
                if (photo.Count == 0)
                {
                    break;
                }


                foreach (FlickrNet.Photo p in photo)
                {
                    if (p.Views == null)
                    {
                        p.Views = 0;
                    }
                    if (CWorker.NewEntry(p.PhotoId, _DB))
                    {
                        _DB.Photos.Add(new CPhoto(p.PhotoId, p.Title, p.ThumbnailUrl, p.LargeUrl, p.Views));
                    }
                    else
                    {
                        CPhoto thisPhoto = CWorker.GetPhotoRecord(p.PhotoId, _DB);
                        CStats record    = CWorker.GetStatsRecord(thisPhoto, System.DateTime.Now);
                        if (record == null)
                        {
                            if (p.Views != 0)//add only if non-zero
                            {
                                thisPhoto.Stats.Add(new CStats(p.Views));
                                insert++;
                            }
                        }
                        else
                        {
                            string dt = CWorker.DT2Str(System.DateTime.Now);
                            for (int xdx = 0; ndx != thisPhoto.Stats.Count; xdx++)
                            {
                                if (thisPhoto.Stats[xdx].Date == dt)
                                {
                                    if (thisPhoto.Stats[xdx].Views != record.Views)
                                    {
                                        thisPhoto.Stats[xdx].Views = record.Views;
                                        update++;
                                    }
                                    else
                                    {
                                        dup++;
                                    }
                                    break;
                                }
                            }
                        }
                    }
                }
            }

            return(_DB);
        }
Exemplo n.º 15
0
 public CReadFlickr(string basePath, string rootName)
 {
     CWorker.BasePath         = basePath;
     CWorker.DataBaseRootName = rootName;
     CDB db = CWorker.ReadDB();
 }
Exemplo n.º 16
0
 public CReadFlickr()
 {
     _DB = CWorker.ReadDB();
 }
Exemplo n.º 17
0
 public void Commit(CDB pDB)
 {
     CWorker.StoreDB(pDB);
 }
Exemplo n.º 18
0
 public void Commit(CXDB xdb)
 {
     CWorker.StoreXDB(xdb);
 }
Exemplo n.º 19
0
 public CHTML(int displayLimit)
 {
     _DisplayLimit   = displayLimit;
     _XtractBaseName = "XTRACT";
     _XDB            = CWorker.ReadXDB(_XtractBaseName);
 }
Exemplo n.º 20
0
        static void Main(string[] args)
        {
            OAuthAccessToken accessToken = new OAuthAccessToken();

            FlickrNet.Flickr f = null;
            CWorker.BasePath         = @"C:\TEMP\";
            CWorker.DataBaseRootName = "FLICKRDB";
            CDB db = CWorker.ReadDB();

            if (db.GetOAuthToken == null)
            {
                accessToken.FullName     = "Cloud2013";
                accessToken.Token        = "72157644879828272-04fe2e4af1f40866";
                accessToken.UserId       = "26095572@N07";
                accessToken.TokenSecret  = "02947f478d4b0cc1";
                FlickrManager.OAuthToken = accessToken;
                f = FlickrManager.GetAuthInstance("2c67273e05ae10a7001e5b569df4f7d1", "d8906735118cab71");
                db.SetUser(accessToken.FullName, accessToken.UserId);
                db.APIKey       = "2c67273e05ae10a7001e5b569df4f7d1";
                db.SharedSecret = "d8906735118cab71";
                db.Token        = accessToken.Token;
                db.TokenSecret  = accessToken.TokenSecret;
            }
            else
            {
                FlickrManager.OAuthToken = db.GetOAuthToken;
                f = FlickrManager.GetAuthInstance(db.APIKey, db.SharedSecret);
            }
            int ndx = 0;

            while (true)
            {
                PhotoCollection photo = f.PeopleGetPhotos(PhotoSearchExtras.Views, ndx++, 500);
                if (photo.Count == 0)
                {
                    break;
                }
                foreach (FlickrNet.Photo p in photo)
                {
                    if (CWorker.NewEntry(p.PhotoId, db))
                    {
                        db.Photos.Add(new CPhoto(p.PhotoId, p.Title, p.ThumbnailUrl, p.LargeUrl, p.Views));
                    }
                    else
                    {
                        CPhoto thisPhoto = CWorker.GetPhotoRecord(p.PhotoId, db);
                        CStats record    = CWorker.GetStatsRecord(thisPhoto, System.DateTime.Now);
                        if (record == null)
                        {
                            thisPhoto.Stats.Add(new CStats(p.Views));
                        }
                        else
                        {
                            if (p.Views == null)
                            {
                                p.Views = 0;
                            }
                            if (record.Views != Convert.ToInt32(p.Views))
                            {
                                record.Views = Convert.ToInt32(p.Views);
                            }
                        }
                    }
                }
            }
            CWorker.StoreDB(db);
            if (args.Length != 0)
            {
                CWorker.Exit(0, "Success");
            }
        }
Exemplo n.º 21
0
 public CStatistics()
 {
     _DB = CWorker.ReadDB();
 }
Exemplo n.º 22
0
        static string _PicturePhrase(int pictures, int views)
        {
            const string fmtPictureAndViews = "<h3><p>Pictures: {0} Views: {1}</p></h3>";

            return(string.Format(fmtPictureAndViews, CWorker.FormatInt(pictures), CWorker.FormatInt(views)));
        }
Exemplo n.º 23
0
        public AppWizard()
        {
            InitializeComponent();

            // kill previous instances of Environment Assessment Web Service that may be running
            CWebServiceManager.Kill();

            // create progress related objects
            base.TaskbarItemInfo = new TaskbarItemInfo();
            ProgressInfo         = new ObservableCollection <CTaskInfo> {
            };
            CFunctions.EnableCollectionSynchronization(ProgressInfo, _ProgressInfoLock);

            // initialize containers
            cntTop = new Border {
                Name = "cntTop", Height = 110, Background = new SolidColorBrush(Colors.White), VerticalAlignment = VerticalAlignment.Top
            };
            DockPanel topPanel = new DockPanel()
            {
                Name = "topPanel"
            };

            cntTop.Child = topPanel;

            cntNav = new Border {
                Name = "cntNavigation", HorizontalAlignment = HorizontalAlignment.Left, Margin = new Thickness(0, 110, 0, 60), Width = 210, Background = new SolidColorBrush(Colors.LightAccent),
            };
            DockPanel navPanel = new DockPanel()
            {
                Name = "navPanel"
            };

            cntNav.Child = navPanel;

            cntBottom = new Border {
                Name = "cntBottom", Height = 60, BorderThickness = new Thickness(0, 1, 0, 0), BorderBrush = new SolidColorBrush(Colors.LightGray), Margin = new Thickness(12, 0, 12, 0), VerticalAlignment = VerticalAlignment.Bottom,
            };
            DockPanel btmPanel = new DockPanel()
            {
                Name = "btmPanel"
            };

            cntBottom.Child = btmPanel;

            cntMain = new Border {
                Name = "cntMain", Margin = new Thickness(210, 110, 0, 60), Background = new SolidColorBrush(Colors.White)
            };
            DockPanel mainPanel = new DockPanel()
            {
                Name = "mainPanel"
            };

            cntMain.Child = mainPanel;

            // add pages
            List <string> ButtonText = new List <string>()
            {
                "< _Previous", "_Next >", "_Cancel"
            };

            pnlWelcome = new Controls.WelcomePanel();
            pnlWelcome.tbkTitle.Text    = "Analyze your server environment";
            pnlWelcome.tbkSubTitle.Text = "Collects data from vSphere and Hyper-V.";
            pnlWelcome.tbkTerms.Text    = "This program is provided as-is with no implied warranties whatsoever as to its functionality, operability, use or fitness for any purpose. We disclaim any liability regarding the use of this program, even if previously advised of such. By using this sofware you agree to these terms.";
            Pages.Add(new Page(pnlWelcome.tbkTitle.Text, pnlWelcome.tbkSubTitle.Text, new List <Control> {
                pnlWelcome
            }, ButtonText));

            pnlServers = new Controls.ServerPanel();
            pnlServers.lvServers.SetBinding(ItemsControl.ItemsSourceProperty, new Binding()
            {
                Path = new PropertyPath("CService"), NotifyOnTargetUpdated = true
            });
            pnlServers.lvServers.ItemsSource = DiscoveredServers;
            //[ or pnlServers.lvServers.SelectionChanged link to next and previous buttons];

            pnlServers.lgvServer.Columns.Add(new GridViewColumn {
                Header = "Server", DisplayMemberBinding = new Binding("Name"), Width = 140
            });
            pnlServers.lgvServer.Columns.Add(new GridViewColumn {
                Header = "Type", DisplayMemberBinding = new Binding("Type"), Width = 120
            });
            pnlServers.lgvServer.Columns.Add(new GridViewColumn {
                Header = "Credentials", DisplayMemberBinding = new Binding("UserName"), Width = 145
            });
            //pnlServers.ComponentUpdated link to next and previous buttons

            CWorker OnServiceDiscoverWorker = new CWorker();

            OnServiceDiscoverWorker.DoWork             += OnServiceDiscoverWorker_DoWork;
            OnServiceDiscoverWorker.RunWorkerCompleted += OnServiceDiscoverWorker_RunWorkerCompleted;
            Pages.Add(new Page("Server Connections", "Configure the credentials to \r\naccess vSphere and Hyper-V.", new List <Control> {
                pnlServers
            }, ButtonText, OnServicePageValidateHandler, OnServiceDiscoverWorker));

            pnlProgress = new Controls.ProgressPanel();
            //pnlProgress.lblProgress.Content = "Collecting Data...";
            pnlProgress.lvProgress.SetBinding(ItemsControl.ItemsSourceProperty, new Binding()
            {
                Path = new PropertyPath("CTaskStatus"), NotifyOnTargetUpdated = true
            });
            pnlProgress.lvProgress.ItemsSource = ProgressInfo;
            pnlProgress.lgvProgress.Columns.Add(new GridViewColumn {
                Header = "Action", CellTemplate = (DataTemplate)FindResource("ProgressActionTemplate"), Width = 385
            });                                                                                                                                                              //DisplayMemberBinding = new Binding("Details")
            pnlProgress.lgvProgress.Columns.Add(new GridViewColumn {
                Header = "Duration", DisplayMemberBinding = new Binding("Duration"), Width = 100
            });

            CWorker OnDataCollectWorker = new CWorker();

            OnDataCollectWorker.WorkerReportsProgress = true;
            OnDataCollectWorker.DoWork             += OnDataCollectWorker_DoWork;
            OnDataCollectWorker.ProgressChanged    += OnDataCollectWorker_ProgressChanged;
            OnDataCollectWorker.RunWorkerCompleted += OnDataCollectWorker_RunWorkerCompleted;
            pnlProgress.pbProgress.Value            = 10;
            Pages.Add(new Page("Data Collection", "Collecting data from \r\nvSphere and Hyper-V.", new List <Control> {
                pnlProgress
            }, ButtonText, null, OnDataCollectWorker));

            MainGrid.Children.Add(cntTop);
            MainGrid.Children.Add(cntNav);
            MainGrid.Children.Add(cntMain);
            MainGrid.Children.Add(cntBottom);

            // update navigation
            foreach (Control c in Navigation.Controls)
            {
                navPanel.Children.Add(c);
            }

            // update content for first page
            lblTitle = new Label {
                FontFamily = new FontFamily("Segoe UI"), FontSize = 21, Foreground = new SolidColorBrush(Colors.DarkGray), Margin = new Thickness(26, -4, 0, 0), VerticalAlignment = VerticalAlignment.Top, HorizontalAlignment = HorizontalAlignment.Left, Width = 700
            };
            tbkSubTitle = new TextBlock {
                FontFamily = new FontFamily("Segoe UI"), FontSize = 14, Foreground = new SolidColorBrush(Colors.MediumGray), VerticalAlignment = VerticalAlignment.Top, Margin = new Thickness(-694, 40, 0, 0),
            };
            topPanel.Children.Add(lblTitle);
            topPanel.Children.Add(tbkSubTitle);

            int btnHeight = 30, btnWidth = 82;

            btnPrevious = new Button()
            {
                Content = ButtonText[0], Height = btnHeight, Width = btnWidth, Margin = new Thickness(460, 0, 8, 0), HorizontalAlignment = HorizontalAlignment.Right, FontSize = 14, ToolTip = "Go to previous page", Style = FindResource("WizardNextPreviousButtonStyle") as Style
            };
            btnNext = new Button()
            {
                Content = ButtonText[1], Height = btnHeight, Width = btnWidth, HorizontalAlignment = HorizontalAlignment.Right, FontSize = 14, Style = FindResource("WizardNextPreviousButtonStyle") as Style, ToolTip = "Go to next page"
            };
            btnCancelFinish = new Button()
            {
                Content = ButtonText[2], Height = btnHeight, Width = btnWidth, HorizontalAlignment = HorizontalAlignment.Right, FontSize = 14, Style = FindResource("WizardOKCancelButtonStyle") as Style, IsCancel = true, ToolTip = "Close wizard"
            };
            btnNext.Click         += btnNext_Click;
            btnPrevious.Click     += btnPrevious_Click;
            btnCancelFinish.Click += btnCancelFinish_Click;
            btmPanel.Children.Add(btnPrevious);
            btmPanel.Children.Add(btnNext);
            btmPanel.Children.Add(btnCancelFinish);

            // register navigation change event
            Navigation.ActivePageChanged += MainWizard_ActivePageChanged;

            // run update page for first page
            UpdatePage();
        }