private void BindListForExcel()
        {
            IPagedCollection <LogEntry> logEntries = LoggingProvider.Instance().GetPagedLogEntries(0, int.MaxValue - 1);

            LogPage.DataSource = logEntries;
            LogPage.DataBind();
        }
Beispiel #2
0
        private void OpenLogPage(object sender, LogPageViewModel viewModel)
        {
            var page = new LogPage(viewModel);

            NavigationPage.SetHasBackButton(page, true);
            MainPage.Navigation.PushAsync(page);
        }
 public EntryViewModel()
 {
     CurrentPage = new LogPage();
     _mainWindow = Application.Current.MainWindow as MainWindow;
     if(_mainWindow != null)
     _mainWindow.TabControl1.SelectedIndex = _currentEntryIndex;
 }
Beispiel #4
0
 // constructor
 public MainWindow()
 {
     InitializeComponent();
     DataContext = _windowData;
     Log         = logPage;
     Settings    = settingsPage;
 }
Beispiel #5
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            MainWindow = (MainWindow)Application.Current.MainWindow;

            LogPage = MainWindow.LogPage;

            NavService = LogFrame.NavigationService;
            LogFrame.Navigate(LogPage);
        }
        private void BindList()
        {
            IPagedCollection <LogEntry> logEntries = LoggingProvider.Instance().GetPagedLogEntries(
                resultsPager.PageIndex, resultsPager.PageSize);

            resultsPager.ItemCount = logEntries.MaxItems;
            LogPage.DataSource     = logEntries;
            LogPage.DataBind();
        }
Beispiel #7
0
        public LogPage GotoLogPage()
        {
            ClickMenu();
            Click("log");
            var page = new LogPage(Driver, BaseUri);

            PageFactory.InitElements(Driver, page);
            return(page);
        }
Beispiel #8
0
    void Start()
    {
        Instance = this;

        detail.ClearButton_Button.onClick.AddListener(OnClickClear);
        detail.HideButton_Button.onClick.AddListener(OnClickHide);
        detail.ShowButton_Button.onClick.AddListener(OnClickShow);
        detail.DumpButton_Button.onClick.AddListener(OnClickDump);
        detail.AuthButton_Button.onClick.AddListener(OnClickAuth);
    }
Beispiel #9
0
        // constructor
        public MainWindow()
        {
            InitializeComponent();
            Log      = logPage;
            Settings = settingsPage;

            _viewModel = new MainViewModel(this);

            DataContext = _windowData;
        }
Beispiel #10
0
        private async void RenderMainLogPage(ViewOptions options, HttpContext context)
        {
            var model = new LogPageModel()
            {
                Activities = _store.GetActivities(),
                Options    = options,
                Path       = _options.Path
            };
            var logPage = new LogPage(model);

            await logPage.ExecuteAsync(context);
        }
Beispiel #11
0
 //9
 public void SignIn()
 {
     MakeScreenshotWhenFail(() =>
     {
         new MainPage(webDriver).GoToLogPage();
         LogPage logPage = new LogPage(webDriver);
         logPage.GoSignUp();
         logPage.InputData(registrationUser.DataForRegistration());
         logPage.SubmitSignUp();
         Assert.IsTrue(logPage.GetMessage().Contains(messageSignUp));
     });
 }
 //9
 public void SignIn()
 {
     MakeScreenshotWhenFail(() =>
     {
         Logger.InitLogger();
         new MainPage(webDriver).GoToLogPage();
         LogPage logPage = new LogPage(webDriver);
         logPage.GoSignUp();
         Assert.IsTrue(logPage.IsDisplaySignUp());
         Logger.Log.Info("Test complete successfully");
     });
 }
        public void NextEntry()
        {
            CurrentPage = new LogPage();

               var tabitem = new TabItem {Header = "Page 1", Content = CurrentPage, Foreground = Brushes.White};

               _mainWindow?.TabControl1.Items.Add(tabitem);
            if (_mainWindow != null)
                _mainWindow.TabControl1.SelectedIndex = _currentEntryIndex;

            _numberOfEntries++;
            _currentEntryIndex++;
        }
Beispiel #14
0
        public AdminPage(MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;
            //validationPage = new ValidationPage(mainWindow);


            InitializeComponent();

            AdminFullNameTxt.Text = mainWindow.loginUser.Value.full_name;
            AdminJobTxt.Text      = mainWindow.loginUser.Value.function;

            ncManagementPage   = new NcManagementPage(mainWindow);
            userManagementPage = new UserManagementPage(mainWindow);
            logPage            = new LogPage(mainWindow);

            //ValidationFrame.Content = validationPage;
            NcManagementFrame.Content = ncManagementPage;
            UsersFrame.Content        = userManagementPage;
            LogFrame.Content          = logPage;
        }
        private void GenerateEntry(LogPage log)
        {
            for (int i = 0; i < 14; i++)
            {
                if (i != 5)
                {
                    System.Threading.Thread.Sleep(333);
                    EntryModel ent = new EntryModel();

                    log.DataContext = ent;
                    log.MainGrid.Items.Add(ent);
                    log.SecondaryGrid.Items.Add(ent);
                }
                else
                {
                    CurrentPage.MainGrid.Items.Add(new object());
                    log.SecondaryGrid.Items.Add(new object());
                }

            }
        }
Beispiel #16
0
        /// <summary>
        /// Shows the debug menu.
        /// </summary>
        public void ShowDebugMenu(bool showAdminTool)
        {
            if (!this.isDebugMenuVisible)
            {
                if (showAdminTool)
                {
                    var debugButton = new RibbonButtonData(Messages.Btn_Tools
                                                           , "/Images/Debug.png"
                                                           , new RelayCommand(() => ViewService.Manager.Show <DebugViewModel>()));

                    var checkVersionButton = new RibbonButtonData(Messages.Btn_CheckNewVersion
                                                                  , "/Images/CheckVersion.png"
                                                                  , new RelayCommand(() => DebugCheckNewVersion()));

                    PluginContext.Host.AddInHome(debugButton, Groups.DebugTools);
                    PluginContext.Host.AddInHome(checkVersionButton, Groups.DebugTools);
                }

                var statisticsButton = new RibbonButtonData(Messages.Btn_UsageStat
                                                            , "/Images/DebugStat.png"
                                                            , new RelayCommand(() => PluginContext.Host.Navigate(this.StatisticsPage)));

                PluginContext.Host.AddInHome(statisticsButton, Groups.DebugTools);

                var logButton = new RibbonButtonData(Messages.Btn_Logs
                                                     , "/Images/ActivityReports.png"
                                                     , new RelayCommand(() =>
                {
                    var view = new LogPage();
                    view.As <LogViewModel>().Refresh();

                    PluginContext.Host.Navigate(view);
                }));

                PluginContext.Host.AddInHome(logButton, Groups.DebugTools);

                this.isDebugMenuVisible = true;
            }
        }
Beispiel #17
0
        public async Task <LogPage> GetPageAsync(Expression <Func <Log, bool> > filter, int pageSize, int pageIndex)
        {
            var pageCount = await GetPageCountAsync(filter, pageSize);

            pageIndex = pageIndex <= 0 ? 1
                                       : pageIndex > pageCount ? pageCount
                                                               : pageIndex;
            var offset = pageSize * (pageIndex - 1);

            offset = offset < 0 ? 0 : offset;
            var result = await _repository.GetManyByPage(filter, i => i.Date, offset, pageSize);

            var page = new LogPage
            {
                HaveLast  = pageIndex > 1,
                HaveNext  = pageIndex < pageCount,
                PageCount = pageCount,
                Index     = pageIndex,
                Logs      = result,
                Size      = pageSize
            };

            return(page);
        }
        public void GivenINavigateToThePage(string pageName)
        {
            var webDriver = FeatureContext.Current.GetWebDriver();
            var uri       = FeatureContext.Current.GetBaseUri();

            switch (pageName.ToLower())
            {
            case "account log":
                var accountLogPage = new AccountLogPage(webDriver, uri);
                Assert.IsTrue(accountLogPage.IsCurrentPage,
                              $"Page {accountLogPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(accountLogPage);
                break;

            case "change email address":
                var changeEmailAddressPage = new ChangeEmailAddressPage(webDriver, uri);
                Assert.IsTrue(changeEmailAddressPage.IsCurrentPage,
                              $"Page {changeEmailAddressPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changeEmailAddressPage);
                break;

            case "change email address pending":
                var changeEmailAddressPendingPage = new ChangeEmailAddressPendingPage(webDriver, uri);
                Assert.IsTrue(changeEmailAddressPendingPage.IsCurrentPage,
                              $"Page {changeEmailAddressPendingPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changeEmailAddressPendingPage);
                break;

            case "change email address success":
                var changeEmailAddressSuccessPage = new ChangeEmailAddressSuccessPage(webDriver, uri);
                Assert.IsTrue(changeEmailAddressSuccessPage.IsCurrentPage,
                              $"Page {changeEmailAddressSuccessPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changeEmailAddressSuccessPage);
                break;

            case "change password":
                var changePasswordPage = new ChangePasswordPage(webDriver, uri);
                Assert.IsTrue(changePasswordPage.IsCurrentPage,
                              $"Page {changePasswordPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changePasswordPage);
                break;

            case "change password success":
                var changePasswordSuccessPage = new ChangePasswordSuccessPage(webDriver, uri);
                Assert.IsTrue(changePasswordSuccessPage.IsCurrentPage,
                              $"Page {changePasswordSuccessPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changePasswordSuccessPage);
                break;

            case "change security information":
                var changeSecurityInformationPage = new ChangeSecurityInformationPage(webDriver, uri);
                Assert.IsTrue(changeSecurityInformationPage.IsCurrentPage,
                              $"Page {changeSecurityInformationPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changeSecurityInformationPage);
                break;

            case "change security information success":
                var changeSecurityInformationSuccessPage = new ChangeSecurityInformationSuccessPage(webDriver, uri);
                Assert.IsTrue(changeSecurityInformationSuccessPage.IsCurrentPage,
                              $"Page {changeSecurityInformationSuccessPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(changeSecurityInformationSuccessPage);
                break;

            case "delete user":
                var deleteUserPage = new DeleteUserPage(webDriver, uri);
                Assert.IsTrue(deleteUserPage.IsCurrentPage,
                              $"Page {deleteUserPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(deleteUserPage);
                break;

            case "home":
                var homePage = new HomePage(webDriver, uri);
                Assert.IsTrue(homePage.IsCurrentPage,
                              $"Page {homePage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(homePage);
                break;

            case "landing":
                var landingPage = new LandingPage(webDriver, uri);
                Assert.IsTrue(landingPage.IsCurrentPage,
                              $"Page {landingPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(landingPage);
                break;

            case "log":
                var logPage = new LogPage(webDriver, uri);
                Assert.IsTrue(logPage.IsCurrentPage,
                              $"Page {logPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(logPage);
                break;

            case "login":
                var loginPage = new LoginPage(webDriver, uri);
                Assert.IsTrue(loginPage.IsCurrentPage,
                              $"Page {loginPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(loginPage);
                break;

            case "make admin":
                var makeAdminPage = new MakeAdminPage(webDriver, uri);
                Assert.IsTrue(makeAdminPage.IsCurrentPage,
                              $"Page {makeAdminPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(makeAdminPage);
                break;

            case "manage users":
                var userIndexPage = new UserIndexPage(webDriver, uri);
                Assert.IsTrue(userIndexPage.IsCurrentPage,
                              $"Page {userIndexPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(userIndexPage);
                break;

            case "recover":
                var recoverPage = new RecoverPage(webDriver, uri);
                Assert.IsTrue(recoverPage.IsCurrentPage,
                              $"Page {recoverPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(recoverPage);
                break;

            case "recover password":
                var recoverPasswordPage = new RecoverPasswordPage(webDriver, uri);
                Assert.IsTrue(recoverPasswordPage.IsCurrentPage,
                              $"Page {recoverPasswordPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(recoverPasswordPage);
                break;

            case "recover password success":
                var recoverPasswordSuccessPage = new RecoverPasswordSuccessPage(webDriver, uri);
                Assert.IsTrue(recoverPasswordSuccessPage.IsCurrentPage,
                              $"Page {recoverPasswordSuccessPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(recoverPasswordSuccessPage);
                break;

            case "recover success":
                var recoverSuccessPage = new RecoverSuccessPage(webDriver, uri);
                Assert.IsTrue(recoverSuccessPage.IsCurrentPage,
                              $"Page {recoverSuccessPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(recoverSuccessPage);
                break;

            case "register":
                var registerPage = new RegisterPage(webDriver, uri);
                Assert.IsTrue(registerPage.IsCurrentPage,
                              $"Page {registerPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(registerPage);
                break;

            case "register success":
                var registerSuccessPage = new RegisterSuccessPage(webDriver, uri);
                Assert.IsTrue(registerSuccessPage.IsCurrentPage,
                              $"Page {registerSuccessPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(registerSuccessPage);
                break;

            case "remove admin":
                var removeAdminPage = new RemoveAdminPage(webDriver, uri);
                Assert.IsTrue(removeAdminPage.IsCurrentPage,
                              $"Page {removeAdminPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(removeAdminPage);
                break;

            case "reset password":
                var resetPasswordPage = new ResetPasswordPage(webDriver, uri);
                Assert.IsTrue(resetPasswordPage.IsCurrentPage,
                              $"Page {resetPasswordPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(resetPasswordPage);
                break;

            case "user edit":
                var userEditPage = new UserEditPage(webDriver, uri);
                Assert.IsTrue(userEditPage.IsCurrentPage,
                              $"Page {userEditPage.GetType().Name} is not the current expected page");
                ScenarioContext.Current.Set(userEditPage);
                break;

            default:
                throw new NotImplementedException(pageName);
            }
        }
Beispiel #19
0
        public static void Show(string WindowTitle, string ProgressText, Action WorkerFunction, LogPage logWindow)
        {
            var progressWindow = new formProgress();

            progressWindow.StatusText.Text = ProgressText;

            logWindow.Text = ProgressText;

            var progressWorker = new BackgroundWorker();

            progressWorker.DoWork += (obj, var) =>
            {
                WorkerFunction();
            };
            progressWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(
                delegate(object sender, RunWorkerCompletedEventArgs e) {
                if (e.Error != null)
                {
                    Debug.LogLine(String.Format("[Error] Exception message '{0}'", e.Error.ToString()));
                    Debug.LogLine(String.Format("[Error] Exception StackTrace '{0}'", e.Error.StackTrace));
                    logWindow.Invoke((MethodInvoker) delegate { logWindow.Text = String.Format("Error during process :'{0}'", ProgressText); });

                    MessageBox.Show(String.Format("Exception :'{0}'\r\nCheck SnakeBites log for more info.", e.Error.ToString()), String.Format("Error during process :'{0}'", ProgressText), MessageBoxButtons.OK, MessageBoxIcon.Error);
                    progressWindow.Invoke((MethodInvoker) delegate { progressWindow.Close(); });
                }
                else if (e.Cancelled)
                {
                }
                else
                {
                    progressWindow.Invoke((MethodInvoker) delegate { progressWindow.Close(); });
                }
                progressWorker.Dispose();
            }
                );

            progressWorker.RunWorkerAsync();
            progressWindow.ShowDialog();
        }
Beispiel #20
0
 public LogTextBoxWriter(LogPage logPage)
 {
     this.logPage = logPage;
 }
Beispiel #21
0
 public MainPage()
 {
     InitializeComponent();
     BindingContext = new LogPage();
 }