Summary description for Settings
Inheritance: Page
Ejemplo n.º 1
0
        public async Task OnClicked()
        {
            // There is a bug in xamarin that picker gets disposed when modal is popped
            // so creating it each time here
            this.settingsPage = new SettingsPage();

            await PageTransition.PushModalAsync(this.settingsPage, true);

            this.settingsPage.Initialize();
        }
Ejemplo n.º 2
0
        private string EnumToString(SettingsPage page)
        {
            switch (page)
            {
            case SettingsPage.MainSettings:
                return("MainSettings".Translate());

            case SettingsPage.DevMode:
                return("DevModeShips".Translate());

            case SettingsPage.Boats:
                return("RimShips".Translate());
            }
            Log.Error(page.ToString() + " Page has not been implemented yet. - Smash Phil");
            return(page.ToString());
        }
        private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
        {
            string       key  = e.Node.FullPath;
            SettingsPage page = SettingsPages[key];

            Settings.Gui.InitialSettingsPage = key;

            if (page != null && page != current)
            {
                panel1.Controls.Clear();
                panel1.Controls.Add(page);
                page.Dock = DockStyle.Fill;
                current   = page;
                return;
            }
        }
Ejemplo n.º 4
0
        public vmMenuPage(MasterDetailPage current)
        {
            bool check = functions.checkReqSet();
            Page page  = new Page();

            if (check)
            {
                page = new MainPage();
            }
            else
            {
                page = new SettingsPage();
            }

            current.Detail = new NavigationPage(page);
        }
Ejemplo n.º 5
0
        public SettingsPageViewModel()
        {
            Save   = new Command(async(o) => await DoSave(o));
            Cancel = new Command(async() => await ExitSettings());

            Title               = "Settings";
            StoreID             = SettingsPage.StoreID();
            SalesID             = SettingsPage.SalesID();
            TaxRate             = SettingsPage.TaxRate();
            IncludeCSVWithQuote = SettingsPage.IncludeCSVWithQuote();

            ThemeOptions = System.Enum.GetValues(typeof(OSAppTheme)).Cast <OSAppTheme>().ToList();
            Theme        = SettingsPage.Theme();

            Stores = new Dictionary <string, string>()
            {
                { "CA - Tustin", "101" },
                { "CO - Denver", "181" },
                { "GA - Duluth", "065" },
                { "GA - Marietta", "041" },
                { "IL - Chicago", "151" },
                { "IL - Westmont", "025" },
                { "KS - Overland Park", "191" },
                { "MA - Cambridge", "121" },
                { "MD - Rockville", "085" },
                { "MD - Parkville", "125" },
                { "MI - Madison Heights", "055" },
                { "MN - St. Louis Park", "045" },
                { "MO - Brentwood", "095" },
                { "NJ - North Jersey", "075" },
                { "NY - Westbury", "171" },
                { "NY - Brooklyn", "115" },
                { "NY - Flushing", "145" },
                { "NY - Yonkers", "105" },
                { "OH - Columbus", "141" },
                { "OH  - Mayfield Heights", "051" },
                { "OH - Sharonville", "071" },
                { "PA - St. Davids", "061" },
                { "TX - Houston", "155" },
                { "TX - Dallas", "131" },
                { "VA - Fairfax", "081" },
                { "Micro Center Web Store", "029" }
            };

            StoreNames        = Stores.Keys.ToList();
            SelectedStoreName = Stores.FirstOrDefault(kvp => kvp.Value == StoreID).Key;
        }
Ejemplo n.º 6
0
        public void CustomerSettingsCogsSellSideActive()
        {
            SettingsPage settingsPage = new SettingsPage();
            DataRow      customerRow  = dbAccess.GetUnsyncedCustomerRow();
            string       customerId   = customerRow["CustomerId"].ToString();

            settingsPage.ClickCustomerSettingsGeneralLink()
            .SearchCustomer(customerId);
            Assert.AreEqual(settingsPage.CustomerIdSearchResults[0].Text, "No customers found");
            Pages.Optimizer.AccountsPage optimizerAccountsPageElements = new Pages.Optimizer.AccountsPage();
            optimizerAccountsPageElements.SyncCustomerWithTlrg(customerId);
            settingsPage = new SettingsPage()
                           .Refresh()
                           .ClickCustomerSettingsGeneralLink()
                           .SearchAndSelectCustomer(customerId);
            Assert.That(settingsPage.CogsActiveSellSideCheck.Displayed, Is.True);
        }
Ejemplo n.º 7
0
 private void RunGameValidate()
 {
     Settings.DowngradeMode = false;
     if (SettingsPage is null)
     {
         SettingsPage = new SettingsPage();
     }
     if (SettingsPage.IsLoaded)
     {
         SettingsPage.Update(true);
     }
     else
     {
         SettingsPage.Loaded += (Sender, Args) => SettingsPage.Update(true);
     }
     Menu.Settings.IsChecked = true;
 }
Ejemplo n.º 8
0
        public void CarrierSettingsTertiaryEmail()
        {
            SettingsPage settingsPage          = new SettingsPage();
            DataRow      carrierRow            = dbAccess.GetRandomCarrierRowWithPrimaryEmail();
            string       carrierId             = carrierRow["CarrierId"].ToString();
            string       tertiaryEmailActual   = "";
            string       tertiaryEmailExpected = "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "@echo.com";

            settingsPage.ClickCarrierSettingsGeneralLink()
            .SearchAndSelectCarrier(carrierId)
            .SetFieldValue(settingsPage.TertiaryDispatchEmailField, tertiaryEmailExpected)
            .ClickSaveButton()
            .Refresh()
            .ClickCarrierSettingsGeneralLink()
            .SearchAndSelectCarrier(carrierId);
            tertiaryEmailActual = settingsPage.GetFieldValue(settingsPage.TertiaryDispatchEmailField);
            Assert.AreEqual(tertiaryEmailActual, tertiaryEmailExpected);
        }
Ejemplo n.º 9
0
        public App()
        {
            InitializeComponent();

            MainPage = new AppShell();

            if (Device.RuntimePlatform == Device.Android)
            {
                //IOS.Clear();
            }
            else if (Device.RuntimePlatform == Device.iOS)
            {
                //Android.Clear();
            }

            RequestedThemeChanged += App_RequestedThemeChanged;
            SwitchTheme(SettingsPage.Theme());
        }
Ejemplo n.º 10
0
        //ChangeLanguage
        private void ChangeLanguage(string str_language)
        {
            if (StaticClass.GeneralClass.app_settings["language"].ToString() != str_language)
            {
                Image img = (Image)stpLanguage.FindName("img" + StaticClass.GeneralClass.app_settings["language"].ToString());
                img.Source = bitmap_language;

                Image img_current = (Image)stpLanguage.FindName("img" + str_language);
                img_current.Source = bitmap_language_current;

                if (StaticClass.GeneralClass.dict_language_current != null)
                {
                    Application.Current.Resources.Remove(StaticClass.GeneralClass.dict_language_current);
                }

                StaticClass.GeneralClass.dict_language_current.Source = new Uri("..\\Languages\\" + str_language + ".xaml", UriKind.Relative);
                Application.Current.Resources.MergedDictionaries.Add(StaticClass.GeneralClass.dict_language_current);

                //save current language
                StaticClass.GeneralClass.app_settings["language"] = str_language;
                Model.UpgradeDatabase.updateAppSetting(StaticClass.GeneralClass.app_settings);

                //change language for links
                app.linkGroupHome.DisplayName      = FindResource("lg_home").ToString();
                app.linkGroupReport.DisplayName    = FindResource("lg_report").ToString();
                app.linkGroupSetting.DisplayName   = FindResource("lg_setting").ToString();
                app.linkGroupChart.DisplayName     = FindResource("lg_chart").ToString();
                app.linkGroupStatistic.DisplayName = FindResource("lg_statistic").ToString();
                app.linkGroupOption.DisplayName    = FindResource("lg_option").ToString();
                app.linkLogin.DisplayName          = FindResource("l_login").ToString();
                app.linkLogout.DisplayName         = FindResource("l_logout").ToString();

                app.linkCategory.DisplayName    = FindResource("category").ToString();
                app.linkCurrency.DisplayName    = FindResource("currency").ToString();
                app.linkCustomer.DisplayName    = FindResource("customer").ToString();
                app.linkSalesperson.DisplayName = FindResource("salesperson").ToString();
                app.linkPayment.DisplayName     = FindResource("payment").ToString();
                app.linkUser.DisplayName        = FindResource("user").ToString();
                app.linkBackup.DisplayName      = FindResource("backup_restore").ToString();
                app.linkAppSetting.DisplayName  = FindResource("app_setting").ToString();
                app.lnkGiftCard.DisplayName     = FindResource("gift_card").ToString();
                SettingsPage.ResetLanguageHandler(null, null);
            }
        }
Ejemplo n.º 11
0
        public void LoadCogsCalculation()
        {
            string       customerId = load.OptiCustomerId;
            string       carrierId  = load.OptiCarrierId;
            string       uniqueName = "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff");
            AccountsPage optimizerAccountsPageElements = new AccountsPage()
                                                         .SyncCustomerWithTlrg(customerId);
            SettingsPage settingsPage = new SettingsPage()
                                        .ClickCustomerSettingsGeneralLink()
                                        //.SearchAndSelectCustomer(customerId)
                                        //.SetCustomerGeneralFields("2", "125", "1", uniqueName + "@echo.com", "(GMT -6:00) Central Time (US & Canada), Mexico City")
                                        //.ClickSaveButton()
                                        //.WaitForSaveConfirmation()
                                        .SyncNewCarrier(carrierId);
            PricingUploadPage pricingUploadPage = new PricingUploadPage()
                                                  .UploadLineHaulMultiRates(customerId, carrierId, uniqueName)
                                                  .UploadFuelSchedule(customerId, carrierId)
                                                  .UploadSpecialServices(customerId, carrierId);

            CreateMultiStopLoadShipmentBuilder();
            string expectedLoadId = loadDetailsPage.GetLoadIdDisplayed();

            loadDetailsPage.ClickElement(loadDetailsPage.StartTlrgButton);
            string actualWarning   = driver.FindElementBy(loadDetailsPage.LoadWarning).Text;
            string expectedWarning = "You are currently viewing a READ ONLY version of this page. No changes are allowed.";
            string expectedStatus  = "In Progress";

            Assert.AreEqual(expectedWarning, actualWarning);
            HomePage homePage     = new HomePage();
            string   expectedCogs = homePage.GetLoadCogs(expectedLoadId, 0.01, 100.00, 215.00, 0.3, 1000.00);

            homePage.ClickAllTab()
            .WaitForStartTlrgLoad(expectedLoadId, customerId, expectedStatus)
            .SearchAndSelectCustomer(customerId)
            .FilterLoads(homePage.LoadIdField, expectedLoadId);
            IList <string> actualLoad   = homePage.GetLoadAtIndex(0);
            string         actualLoadId = actualLoad[0];
            string         actualCogs   = actualLoad[3];
            string         actualStatus = actualLoad[4];

            Assert.AreEqual(expectedLoadId, actualLoadId);
            Assert.AreEqual(expectedCogs, actualCogs);
            Assert.AreEqual(expectedStatus, actualStatus);
        }
Ejemplo n.º 12
0
        public static SettingsPage GetSettingsPage()
        {
            if (PageReference.IsNullOrEmpty(ContentReference.StartPage))
            {
                return(null);
            }

            var startPage = ContentReference.StartPage.Get <StartPage>();

            if (PageReference.IsNullOrEmpty(startPage.SettingsPage))
            {
                return(null);
            }
            var settingsPage = startPage.SettingsPage.Get <SettingsPage>();

            _settingPage = settingsPage;

            return(_settingPage);
        }
Ejemplo n.º 13
0
        private UIViewController CreateTabFor(string title, string imageName, IMvxViewModel viewModel)
        {
            UIViewController screen;

            if (viewModel.GetType() == typeof(SettingsViewModel))
            {
                screen = new SettingsPage().CreateViewController();
            }
            else
            {
                screen = this.CreateViewControllerFor(viewModel) as UIViewController;

                viewModel.Start();
            }

            SetTitleAndTabBarItem(screen, title, imageName);

            return(screen);
        }
Ejemplo n.º 14
0
    public MainPage()
    {
        var playPage = new PlayPage()
        {
            Title = "Play"
        };
        var settingsPage = new SettingsPage()
        {
            Title = "Settings"
        };
        var aboutPage = new AboutPage()
        {
            Title = "About"
        };

        Children.Add(playPage);
        Children.Add(settingsPage);
        Children.Add(aboutPage);
    }
Ejemplo n.º 15
0
        /// <summary>
        /// Gets The Page Based Off Of The Page Name.
        /// </summary>
        /// <param name="PageName">The Name Of The Current Selected Page.</param>
        /// <returns>The Page That Corresponds With The Page Name.</returns>
        public NavigationPage GetPageByName(string PageName)
        {
            //Create The Correct Content Page
            ContentPage EmbededPage = null;

            switch (PageName.ToLower())
            {
            case "federal":
                EmbededPage = new RepsListPage(RepLoadType.Federal);
                break;

            case "state":
                EmbededPage = new RepsListPage(RepLoadType.State);
                break;

            case "local":
                EmbededPage = new RepsListPage(RepLoadType.Local);
                break;

            case "settings":
                EmbededPage = new SettingsPage();
                break;

            default:
                EmbededPage = new ContentPage();
                break;
            }

            //Edit The Page Heading & Nav Bar
            EmbededPage.Title = PageName;

            //Create The Navigation Page
            NavigationPage ReturnPage = new NavigationPage(EmbededPage)
            {
                BarBackgroundColor = AppThemeManager.Instance.CurrentTheme.NavBarColor,
                BackgroundColor    = AppThemeManager.Instance.CurrentTheme.BackgroundColor,
                BarTextColor       = AppThemeManager.Instance.CurrentTheme.TextColor
            };

            //Return The Page
            return(ReturnPage);
        }
Ejemplo n.º 16
0
        public MainPage()
        {
            var registry = new AppRegistry();

            registry.For <ISettingsDictionary>().Use <SettingsDictionary>().Singleton();
            Func <INavigation> navigationFactory = NavigationFactory;

            registry.For <Func <INavigation> >().Use(navigationFactory);
            _container = new Container(registry);

            this.InitializeComponent();
            var          mainPage     = _container.GetInstance <Forms.MainPage>();
            SettingsPage settingsPage = _container.GetInstance <SettingsPage>();

            var navigationService = _container.GetInstance <NavigationService>();

            navigationService.SettingsPage = settingsPage;
            _navigationPage = new NavigationPage(mainPage);
            LoadApplication(new Forms.App(_navigationPage));
        }
Ejemplo n.º 17
0
        public void CarrierSettingsLastUpdated()
        {
            string       actualUpdate   = "";
            string       expectedUpdate = "";
            SettingsPage settingsPage   = new SettingsPage();
            DataRow      carrierRow     = dbAccess.GetRandomCarrierRow();
            string       carrierId      = carrierRow["CarrierId"].ToString();

            settingsPage.ClickCarrierSettingsGeneralLink()
            .SearchAndSelectCarrier(carrierId)
            .SetFieldValue(settingsPage.PrimaryDispatchEmailField, "qa" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + "@echo.com")
            .ClickSaveButton();

            expectedUpdate = DateTime.Now.ToString("MM-dd-yy HH:mm");
            settingsPage.Refresh()
            .ClickCarrierSettingsGeneralLink()
            .SearchAndSelectCarrier(carrierId);
            actualUpdate = Regex.Match(settingsPage.CarrierLastUpdated.Text, @"\d{2}\-\d{2}\-\d{2} \d{2}\:\d{2}").Value;
            Assert.That((DateTime.Parse(expectedUpdate) - DateTime.Parse(actualUpdate)).TotalSeconds, Is.LessThanOrEqualTo(5));
        }
Ejemplo n.º 18
0
        public void ChangeAccentColor_AccentColorIsChanged()
        {
            //Arrange
            var currentAccentColor = TasksPage.GetAppBarBgColor();

            TasksPage.OpenDrawer().GoToSettings();
            var colors           = SettingsPage.GoToGeneral().GetAllAccentColors();
            var accentColor      = colors.First(c => !SettingsPage.ColorsAreClose(c, currentAccentColor));
            int accentColorIndex = colors.IndexOf(accentColor);

            //Act
            SettingsPage.SetAccentColor(accentColorIndex);

            //Assert
            //Since we are changing the theme, the activity must be restarted
            TasksPage.AssertOnPage(TimeSpan.FromSeconds(10));
            var finalAccentColor = TasksPage.GetAppBarBgColor();

            Assert.True(TasksPage.ColorsAreClose(finalAccentColor, accentColor));
        }
Ejemplo n.º 19
0
        public void Date_Format_Applied(String date_format, int term)
        {
            //Arrange
            DateTime startDate = new DateTime(2020, 1, 1);

            //Act
            SettingsPage settingsPage = new SettingsPage(driver);

            settingsPage.SelectDateFormat.SelectByText(date_format);
            settingsPage.Save();

            DepositPage depositPage = new DepositPage(driver);

            depositPage.StartDate = startDate;
            depositPage.SetAmountRateTerm(1, 1, term);
            depositPage.Calculate();

            //Assert
            Assert.AreEqual(startDate.AddDays(term).ToString(date_format, CultureInfo.InvariantCulture), depositPage.EndDate);
        }
Ejemplo n.º 20
0
        private async Task DoSave(object obj)
        {
            SettingsPage.SalesID(SalesID);
            SettingsPage.TaxRate(TaxRate);

            var storeId = Stores[SelectedStoreName];

            SettingsPage.StoreID(storeId);
            SettingsPage.IncludeCSVWithQuote(IncludeCSVWithQuote);

            if (Theme != SettingsPage.Theme())
            {
                Application.Current.UserAppTheme = Theme;
            }

            SettingsPage.Theme(Theme);

            MessagingCenter.Send(this, SETTINGS_UPDATED_MESSAGE);
            await ExitSettings();
        }
Ejemplo n.º 21
0
        public void CustomerSettingsSyncNewCustomer()
        {
            SettingsPage settingsPage = new SettingsPage();
            DataRow      customerRow  = dbAccess.GetUnsyncedCustomerRow();
            string       customerId   = customerRow["CustomerId"].ToString();

            settingsPage.ClickCustomerSettingsGeneralLink()
            .SearchCustomer(customerId);
            Assert.AreEqual(settingsPage.CustomerIdSearchResults[0].Text, "No customers found");
            Pages.Optimizer.AccountsPage optimizerAccountsPageElements = new Pages.Optimizer.AccountsPage();
            optimizerAccountsPageElements.SyncCustomerWithTlrg(customerId);
            settingsPage = new SettingsPage();
            customerRow  = dbAccess.GetSyncedCustomerRow(customerId);
            string isTlrgEnabled = customerRow["IsTLRGEnabled"].ToString();

            Assert.IsTrue(Convert.ToBoolean(isTlrgEnabled));
            settingsPage.Refresh()
            .ClickCustomerSettingsGeneralLink()
            .SearchCustomer(customerId);
            Assert.AreEqual(settingsPage.CustomerIdSearchResults[0].Text, customerId);
        }
Ejemplo n.º 22
0
        private void SettingsButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                SettingsPage settingsPage = new SettingsPage();

                settingsPage.WindowStyle        = WindowStyle.SingleBorderWindow;
                settingsPage.BackgroundUpdated += delegate {
                    UpdateBG();
                };

                settingsPage.ShowDialog();
                Tools.settings.SaveSettings();
                Tools.settings.LoadSettings();

                Tools.settings.CurrentSettings.UpdateSettings();
            }
            catch (Exception ex)
            {
            }
        }
Ejemplo n.º 23
0
        public void ChangeTheme_ThemeIsChanged()
        {
            //Arrange
            TasksPage.OpenDrawer();
            var currentThemeColor = TasksPage.GetNavigationViewBgColor();

            TasksPage.GoToSettings();

            //Act
            SettingsPage.GoToGeneral()
            .OpenAppThemeDialog()
            .ChangeAppTheme();

            //Assert
            //Since we are changing the theme, the activity must be restarted
            TasksPage.AssertOnPage(TimeSpan.FromSeconds(10));
            TasksPage.OpenDrawer();
            var finalThemeColor = TasksPage.GetNavigationViewBgColor();

            Assert.True(currentThemeColor != finalThemeColor);
        }
Ejemplo n.º 24
0
        public MainWindow()
        {
            SevenZip.SevenZipBase.SetLibraryPath(Path.Combine(ApplicationInfo.AppPath, $"{(System.Environment.Is64BitOperatingSystem ? "x64" : "x86")}/7z.dll"));

            InitializeComponent();

            _settings   = new SettingsPage(this);
            _isFirstRun = _settings.IsFirstRun;

            _singlePage = new SinglePage(this, _settings.Model, _gameDb);
            _batchPage  = new BatchPage(this, _settings.Model, _gameDb);
            _singlePage.Model.PropertyChanged += ModelOnPropertyChanged;

            _model = new MainModel();

            DataContext = _model;

            _model.Mode = AppMode.Single;

            CurrentPage.Content = _singlePage;
        }
Ejemplo n.º 25
0
        /**
         * Start is called before the first frame update
         */
        void Start()
        {
            m_timerAnimListenStopwatch = new System.Diagnostics.Stopwatch();

            // Initialize timer and action bar animation trigger references
            m_timerAnimTriggerRef     = new AnimatorTriggerRef().Init(timerAnimator);
            m_actionBarAnimTriggerRef = new AnimatorTriggerRef().Init(actionBarAnimator);

            // Treat music audio source as singleton
            music = GameObject.FindGameObjectWithTag("Music").GetComponent <AudioSource>();

            // Load saved settings if they exist
            LoadSettings();

            m_settingsSliders = new Slider[]
            {
                sldMasterVol,
                sldMusicVol,
                sldSfxVol
            };

            // Iterate through settings sliders and set the percent label accordingly
            foreach (Slider slider in m_settingsSliders)
            {
                SetSliderPercentLabel(slider);
            }

            // Build settings pages lookup
            m_settingsPagesLookup = new Dictionary <Button, SettingsPage>();
            for (int i = 0; i < drivingButtons.Count; i++)
            {
                SettingsPage settingsPage = new SettingsPage
                {
                    currPage = currPages[i],
                    nextPage = nextPages[i]
                };

                m_settingsPagesLookup.Add(drivingButtons[i], settingsPage);
            }
        }
Ejemplo n.º 26
0
        public void NavigateTo(string uri)
        {
            this.MenuButtons.ForEach(x => x.IsSelected = false);
            var resBtn = this.MenuButtons.FirstOrDefault(x => x.Uri == uri);

            if (resBtn != null)
            {
                resBtn.IsSelected = true;
            }

            switch (uri)
            {
            case "store":
                Source = new ApplicationListPage(new ApplicationsListViewModel(App.InjectContainer.Resolve <ISeacRuntimeClient>(), "Store", System.Windows.Visibility.Collapsed));
                break;

            case "library":
                Source = new ApplicationListPage(new ApplicationsListViewModel(App.InjectContainer.Resolve <ISeacRuntimeClient>(), "Library", System.Windows.Visibility.Visible));
                break;

            case "settings":
                Source = new SettingsPage();
                break;

            case "usersettings":
                Source = new UserSettingsPage(new UserSettingsViewModel(navigateWindow, App.InjectContainer.Resolve <IBaseTokenService>()));
                break;

            case "report":
                Source = new ReportPage();
                break;

            case "develop":
                Source = new DevelopmentPage();
                break;
            }

            OnPropertyChanged("Source");
        }
Ejemplo n.º 27
0
        private void NavigatedHandler(object Sender, RoutedEventArgs Args)
        {
            if (!ModInstallerMode && !(ModInstallerPage is null))
            {
                ModInstallerPage = null;
            }
            MenuRadioButton ActiveItem = Menu.ActiveItem;

            if (ActiveItem == Menu.Mods && ModInstallerMode)
            {
                PageFrame.Content = ModInstallerPage ?? (ModInstallerPage = new ModInstallerPage());
            }
            else if (ActiveItem == Menu.Settings)
            {
                PageFrame.Content = SettingsPage ?? (SettingsPage = new SettingsPage());
            }
            else
            {
                PageFrame.Content = Lambda <Func <object> >(New(Type.GetType($"TEKLauncher.Pages.{ActiveItem.Name}Page").GetConstructor(EmptyTypes))).Compile()();
            }
            Collect();
        }
Ejemplo n.º 28
0
        public void MyButtonCallback(ButtonWidget button)
        {
            switch (button.ID)
            {
            case 1:
                Close();
                break;

            case 3:
                TurnOffActiveFrame();
                active_frame = m_pageNozzle;
                break;
            }
            if (active_frame == null)
            {
                return;
            }

            active_frame.Enabled = true;
            active_frame.Visible = true;
            active_frame.Refresh();
            active_frame.OnOpen();
        }
Ejemplo n.º 29
0
        public void Number_Format_Applied(String number_format, int fin_year)
        {
            //Arrange
            Decimal amount      = 12345m;
            int     rate        = 74;
            int     term        = 211;
            int     year_length = 365;

            //Act
            SettingsPage settingsPage = new SettingsPage(driver);

            settingsPage.SelectNumberFormat.SelectByText(number_format);
            settingsPage.Save();

            DepositPage depositPage = new DepositPage(driver);

            depositPage.SelectFinYear(fin_year);
            depositPage.SetAmountRateTerm(amount, rate, term);
            depositPage.Calculate();

            //Assert
            Assert.AreEqual(Math.Round(amount * rate * term / 100 / year_length, 2).ToString("N", settingsPage.GetSelectedNFI(number_format)), depositPage.InterestStr);
        }
Ejemplo n.º 30
0
        /*
         * Get to that page given
         */

        public static void navigateToWeb(IArclitePage page, IActionsVisitor visitor, bool isFinal, IArcliteInputs inputs)
        {
            IArclitePage defaultPage = new ArcliteWebPage(visitor, inputs);

            IArclitePage        configurationPage = new ConfigurationsPage(visitor, inputs);
            IArclitePage        settingPage       = new SettingsPage(visitor, inputs);
            List <IArclitePage> webPageList       = new List <IArclitePage>();

            webPageList.Add(defaultPage);
            webPageList.Add(configurationPage);
            webPageList.Add(settingPage);

            int count = 0;

            foreach (IArclitePage p in webPageList)
            {
                if (count > 0)
                {
                    Util.navigateToWeb(p, visitor, false, inputs);
                }
                if (count == 2)
                {
                    visitor.switchFrame();
                }
                if (p.pageElements.ContainsKey(page.pageTitle))
                {
                    p.pageElements[page.pageTitle].accept(visitor, new InputVal());
                    if (isFinal && count != 2)
                    {
                        visitor.switchFrame();
                    }
                    return;
                }
                count++;
            }
            throw new ArgumentException("page does not exist");
        }
Ejemplo n.º 31
0
        public void DateIsSavingInSelectedFormat(String dateFormat, int term)
        {
            //Arrange
            DepositPage depositPage  = new DepositPage(driver);
            DateTime    startDate    = depositPage.StartDate;
            DateTime    endDate      = startDate.AddDays(term);
            String      strStartDate = startDate.ToString(dateFormat, CultureInfo.InvariantCulture);
            String      strEndDate   = endDate.ToString(dateFormat, CultureInfo.InvariantCulture);

            //Act
            SettingsPage settingsPage = depositPage.OpenSettingsPage();

            settingsPage.SelectDateFormat.SelectByText(dateFormat);
            settingsPage.Save();
            depositPage.SetAmountRateTerm(1, 1, term);
            depositPage.Calculate();
            HistoryPage historyPage   = depositPage.OpenHistoryPage();
            String      histStartDate = historyPage.GetDateFrom(1);
            String      histEndDate   = historyPage.GetDateTo(1);

            //Assert
            Assert.AreEqual(strStartDate, histStartDate, "Start Date value is wrong.");
            Assert.AreEqual(strEndDate, histEndDate, "End Date value is wrong.");
        }
Ejemplo n.º 32
0
 public SettingsPageValidator(SettingsPage settingsPage)
 {
     this.settingsPage = settingsPage;
 }
Ejemplo n.º 33
0
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            _main = (MainViewModel)DataContext;
            InitUserSettings();

            if (_main.UserSettings.FirstLaunch)
            {
                var settings = new SettingsPage();
                settings.ShowDialog();
                return;
            }

            ProcessCLI();
        }
Ejemplo n.º 34
0
 private void ShowSettingsDialog()
 {
     Locator.GetViewModel<SettingsViewModel>().UserSettings = new UserSettings();
     var settings = new SettingsPage();
     settings.ShowDialog();
 }
Ejemplo n.º 35
0
        public static Page GetPage(ApplicationPages page)
        {
            Page result = null;

            using (_pageLocker.GetUpgradeableReadLock())
            {
                if (!_pages.ContainsKey(page))
                {
                    using (_pageLocker.GetWriteLock())
                    {
                        if (!_pages.ContainsKey(page))
                        {
                            switch (page)
                            {
                                case ApplicationPages.IssueSet1Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set1)});
                                    break;
                                case ApplicationPages.IssueSet2Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set2)});
                                    break;
                                case ApplicationPages.IssueSet3Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set3)});
                                    break;
                                case ApplicationPages.IssueSet4Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set4)});
                                    break;
                                case ApplicationPages.IssueSet5Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set5)});
                                    break;
                                case ApplicationPages.IssueSet6Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set6)});
                                    break;
                                case ApplicationPages.IssueSet7Page:
                                    _pages[page] = (result = new IssuePage {DataContext = new IssueViewModel(IssueSets.Set7)});
                                    break;
                                case ApplicationPages.SettingsPage:
                                    _pages[page] = (result = new SettingsPage {DataContext = new SettingsViewModel()});
                                    break;
                            }
                        }
                    }
                }
                else
                    result = _pages[page];
            }

            return result;
        }
 public ApplicationSettings(SettingsPage initialPage)
    : this()
 {
    SelectedIndex = (int) initialPage;
 }
Ejemplo n.º 37
0
        /// <summary>
        /// Every application in Starcounter works like a console application. They have an .EXE ending. They have a Main() function and
        /// they can do console output. However, they are run inside the scope of a database rather than connecting to it.
        /// </summary>
        public static void Init()
        {
            Application application = Application.Current;

            Layout.Register();

            JsonResponseMerger.RegisterMergeCallback(OnJsonMerge);

            application.Use((Request req) => {
                string uri = req.Uri;

                // Checking if we should process this request.
                if (("/" == uri) || (uri.StartsWith("/launcher/", StringComparison.InvariantCultureIgnoreCase)) || (uri.Equals("/launcher", StringComparison.InvariantCultureIgnoreCase))) {
                    return null;
                }
                return WrapInLauncher(req);
            });

            Handle.GET("/launcher", (Request req) => {
                var session = Session.Current;
                LauncherPage launcher;

                if (session != null && session.Data != null) {
                    launcher = (LauncherPage)Session.Current.Data;
                    launcher.uri = req.Uri;
                    MarkWorkspacesInactive(launcher.workspaces);
                    return launcher;
                }

                if (session == null) {
                    session = new Session(SessionOptions.PatchVersioning);
                }

                launcher = new LauncherPage() {
                    Html = "/Launcher/viewmodels/LauncherTemplate.html"
                };

                launcher.Session = session;

                launcher.launchpad.names = Self.GET<Json>(UriMapping.MappingUriPrefix + "/app-name", () => {
                    var p = new Page();
                    return p;
                });
                var setup = Layout.GetSetup("/launcher/launchpad");

                if (setup == null) {
                    // launcher.launchpad.layout = null
                    // workaround for https://github.com/Starcounter/Starcounter/issues/3072
                    // set default value
                    // consider moving to HTML, or pre-populatind default layouts
                    //launcher.launchpad.layout = new Json("{\"width\": \"1000\", \"items\":[]}");
                    launcher.launchpad.layout = "{\"width\": \"1000\", \"items\":[]}";
                } else {
            //                    dynamic setupJson = new Json(setup.Value);
                    launcher.launchpad.layout = setup.Value; //setupJson;
                }

                launcher.user = Self.GET(UriMapping.MappingUriPrefix + "/user", () => {
                    var p = new Page();
                    return p;
                });

                launcher.menu = Self.GET<Json>(UriMapping.MappingUriPrefix + "/menu", () => {
                    var p = new Page() {
                        Html = "/Launcher/viewmodels/LauncherMenu.html"
                    };
                    return p;
                });

                launcher.uri = req.Uri;
                MarkWorkspacesInactive(launcher.workspaces);
                return launcher;
            });

            Handle.GET("/launcher/dashboard", (Request req) => {

                LauncherPage launcher = Self.GET<LauncherPage>("/launcher");

                launcher.currentPage = Self.GET(UriMapping.MappingUriPrefix + "/dashboard", () => {
                    var p = new Page();

                    return p;
                });

                launcher.uri = req.Uri;
                return launcher;
            });

            Handle.GET("/launcher/settings", (Request req) => {

                LauncherPage launcher = Self.GET<LauncherPage>("/launcher");

                launcher.currentPage = Self.GET<SettingsPage>(UriMapping.MappingUriPrefix + "/settings", () => {
                    var p = new SettingsPage() {
                        Html = "/Launcher/viewmodels/SettingsPage.html"

                    };
                    return p;
                });

                launcher.uri = req.Uri;
                return launcher;
            });

            Handle.GET("/launcher/search?query={?}", (Request req, string query) => {
             //   LauncherPage launcher = Self.GET<LauncherPage>("/launcher");

               // string uri = UriMapping.MappingUriPrefix + "/search?query=" + HttpUtility.UrlEncode(query);
                /*
                launcher.currentPage = Self.GET<ResultPage>(uri, () => {
                    var p = new ResultPage() {
                        Html = "/Launcher/viewmodels/ResultPage.html"
                    };
                    return p;
                });

                launcher.uri = req.Uri;
                launcher.searchBar.query = query;*/

                return null;
            });

            // + dummy responses from launcher itself
            // Merges HTML partials according to provided URLs.
            Handle.GET(StarcounterConstants.HtmlMergerPrefix + "{?}", (String s) => {

                StringBuilder sb = new StringBuilder();

                String[] allPartialInfos = s.Split(new char[] { '&' });

                foreach (String appNamePlusPartialUrl in allPartialInfos) {

                    String[] a = appNamePlusPartialUrl.Split(new char[] { '=' });
                    if (String.IsNullOrEmpty(a[1]))
                        continue;

                    Response resp = Self.GET(a[1]);
                    sb.Append("<imported-template-scope scope=\"" + a[0] + "\">");
                    sb.Append("<template><juicy-tile-group name=\"" + a[0] + "\"></juicy-tile-group></template>");
                    if (resp != null)
                        sb.Append(resp.Body);
                    sb.Append("</imported-template-scope>");
                }

                return sb.ToString();
            }, new HandlerOptions() {
                SkipHandlersPolicy = true,
                ReplaceExistingHandler = true
            });
        }
Ejemplo n.º 38
0
 public OpenSettingsMessage(SettingsPage initialPage = SettingsPage.General)
 {
    InitialPage = initialPage;
 }
Ejemplo n.º 39
0
 public override void TestInitialize()
 {
     base.TestInitialize();
     this.settingsPage = SettingsPage.Instance;
 }
Ejemplo n.º 40
0
		public static void ApplicationWiseCommands_CommandsRequested(Windows.UI.ApplicationSettings.SettingsPane sender, Windows.UI.ApplicationSettings.SettingsPaneCommandsRequestedEventArgs args)
		{
			if (!args.Request.ApplicationCommands.Any(c => ((string)c.Id) == "Options"))
			{
				var command = new Windows.UI.ApplicationSettings.SettingsCommand("Options", "Options", x =>
				{
					var settings = new SettingsPage();

					settings.Show();
				});
				args.Request.ApplicationCommands.Add(command);
			}

			if (!args.Request.ApplicationCommands.Any(c => ((string)c.Id) == "About"))
			{
				var command = new Windows.UI.ApplicationSettings.SettingsCommand("About", "About", x =>
				{
					var settings = new AboutSettingsFlyout();
					settings.Show();
				});
				args.Request.ApplicationCommands.Add(command);
			}
		}
Ejemplo n.º 41
0
 private void settings_Click(object sender, System.EventArgs e)
 {
     SettingsPage settingsPage = new SettingsPage();
       settingsPage.Show();
 }