Beispiel #1
0
        public SettingMenu(IntPtr owner, BiorhythmCalculator calculator)
            : base(owner)
        {
            this.calculator = calculator;
            this.owner = owner;
            MenuPage item = new MenuPage();

            base.ImageList = ImageList.FromResource(Assembly.GetExecutingAssembly(), "TripleSoftware.NeoRhythm.Resource.resources", "tool", 48);

            base.TabPages.Add(item);

            item.Buttons[0].ImageIndex = 0;
            item.Buttons[0].Text = "Set Birthday";
            item.Buttons[0].Click += new CancelEventHandler(birthdayClick);
            item.Buttons[0].Enabled = true;
            item.Buttons[1].ImageIndex = 1;
            item.Buttons[1].Text = "Set day";
            item.Buttons[1].Click += new CancelEventHandler(setdayClick);
            item.Buttons[1].Enabled = true;
            item.Buttons[2].ImageIndex = 2;
            item.Buttons[2].Text = "About";
            item.Buttons[2].Click += new CancelEventHandler(aboutClick);
            item.Buttons[2].Enabled = true;

            base.CloseViewSweep.Enabled = true;
            base.CloseViewSweep.Occurred +=new CancelEventHandler(CloseViewSweep_Occurred);
        }
Beispiel #2
0
        private MenuPage rootMenu; //furthest menu to go back to, e.g. Splash

        #endregion Fields

        #region Constructors

        public IMenuStack(MenuPage rootPage, Boolean drawBackground)
        {
            rootMenu = rootPage;
            MenuTrail.Push(rootMenu);
            currentPage = getIMenuPageFromEnum(rootMenu);
            DrawBackground = drawBackground;
        }
    public void GoToPage(PageType pageType)
    {
        RXDebug.Log("Here i am changing the page");
        if(_currentPageType == pageType) return;

        Page pageToCreate = null;

        if(pageType == PageType.MenuPage)
        {
            pageToCreate = new MenuPage();
        }
        if(pageType == PageType.InGamePage)
        {
            pageToCreate = new InGamePage();
        }

        if(pageToCreate != null)
        {
            _currentPageType = pageType;

            if(_currentPage != null)
            {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();

        }
    }
Beispiel #4
0
 public MenuManager()
 {
     titleMenu = new TitleMenu();
     inGameMenu = new MainMenu(titleMenu);
     rootMenu = titleMenu;
     currentMenu = rootMenu;
 }
Beispiel #5
0
    public void SetPage(MenuPage _page, bool _outAnim = true, bool _inAnim = true)
    {
        nextPage = _page;
        InAnim = _inAnim;

        if(currentPage)
        {
            if(_outAnim)
            {
                currentPage.AnimateOut();
            }
        }

        if(!currentPage || currentPage.IsAnimationFinished())
        {
            if(currentPage != null)
            {
                currentPage.gameObject.SetActive(false);
            }

            currentPage = nextPage;
            nextPage = null;
            currentPage.gameObject.SetActive(true);
            currentPage.OnSetPage();
            if(_inAnim)
            {
                currentPage.AnimateIn();
            }
        }
    }
Beispiel #6
0
    public void GoToPage(BPageType pageType)
    {
        if(_currentPageType == pageType) {
            return;
        } //we're already on the same page, so don't bother doing anything

        BPage pageToCreate = null;

        if(pageType == BPageType.MenuPage) {
            pageToCreate = new MenuPage();
        }else if(pageType == BPageType.InGamePage) {
            pageToCreate = new InGamePage();
        }

        if(pageToCreate != null) { //destroy the old page and create a new one
            _currentPageType = pageType;

            if(_currentPage != null) {
                _stage.RemoveChild(_currentPage);
            }

            _currentPage = pageToCreate;
            _stage.AddChild(_currentPage);
            _currentPage.Start();
        }
    }
Beispiel #7
0
 public MainPage()
 {
     var welcomePage = new ContentPage {Title = "Welcome"};
     var navigationPage = new NavigationPage {Title = "Detail"};
     navigationPage.PushAsync(welcomePage);
     var master = new MenuPage(navigationPage) {Title = "Menu"};
     Master = master;
     Detail = navigationPage;
 }
Beispiel #8
0
    public RootPage()
    {
        menuPage = new MenuPage ();

        menuPage.Menu.ItemSelected += (sender, e) => NavigateTo (e.SelectedItem as MenuItem);

        Master = menuPage;
        Detail = new NavigationPage (new AcceptPayPage ());
    }
Beispiel #9
0
		public void SwitchToMenu(MenuPage page)
		{
			if (this.currentMenu != null)
			{
				this.currentMenu.GameObj.Active = false;
			}

			page.GameObj.Active = true;
			this.currentMenu = page;
		}
 public void EnterPressed()
 {
     switch (currentPage)
     {
         case MenuPage.Main:
             MainPageEnter();
             break;
         case MenuPage.Help:
             currentPage = MenuPage.Main;
             cursorPosition = 0;
             break;
     }
 }
Beispiel #11
0
		public RootPage ()
		{
			var menuPage = new MenuPage {Title = "menu", };
			Device.OnPlatform (iOS: () => {
				menuPage.Icon = "menu_icon.png";	// Don;t do this on Android as it uses the Application icon in the navigation bar
			});


			menuPage.Menu.ItemSelected += (sender, e) => NavigateTo(e.SelectedItem as MenuItem);

			this.Master = menuPage;

			NavigateTo(menuPage.Menu.ItemsSource.Cast<MenuItem>().First());
		}
Beispiel #12
0
 private void InitializeComponent()
 {
     ImageList imgList = new ImageList();
     imgList.Images.Add(base.GetType().Assembly, "HelloWorld.Properties.Resources.resources", "Settings");
     imgList.Images.Add(base.GetType().Assembly, "HelloWorld.Properties.Resources.resources", "About");
     this.ImageList = imgList;
     MenuPage menuPage = new MenuPage();
     menuPage.Buttons[0].Text = "Settings";
     menuPage.Buttons[0].ImageIndex = 0;
     menuPage.Buttons[0].Enabled = true;
     menuPage.Buttons[0].Click += new System.ComponentModel.CancelEventHandler(MenuViewSettings_Click);
     menuPage.Buttons[1].Text = "About";
     menuPage.Buttons[1].ImageIndex = 1;
     menuPage.Buttons[1].Enabled = true;
     menuPage.Buttons[1].Click += new System.ComponentModel.CancelEventHandler(MenuViewAbout_Click);
     this.TabPages.Add(menuPage);
 }
Beispiel #13
0
 public virtual void Update()
 {
     if(nextPage)
     {
         if(currentPage.IsAnimationFinished())
         {
             currentPage.gameObject.SetActive(false);
             currentPage = nextPage;
             nextPage = null;
             currentPage.gameObject.SetActive(true);
             currentPage.OnSetPage();
             if(InAnim)
             {
                 currentPage.AnimateIn();
             }
         }
     }
 }
        public HomePage()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            IsGestureEnabled = false;

            Master = new MenuPage();
            Master.Icon = "action_menu.png";

            var todayPage = new TodayPage ();
            Detail = new BaseNavigationPage(todayPage);

            IsPresentedChanged += (sender, e) => {
                if(IsPresented){
                    todayPage.FadeOut();
                } else {
                    todayPage.FadeIn();
                }
            };
        }
Beispiel #15
0
    void OnGUI()
    {
        GUI.depth = -100;
        string headerText = "";

        switch (lastActualPage)
        {
        case MenuPage.Credits:
            headerText = "Game credits";
            break;

        case MenuPage.JoinGame:
            headerText = "Join by IP";
            break;

        case MenuPage.Options:
            headerText = "Options";
            break;

        case MenuPage.Customization:
            headerText = "Customization";
            break;

        case MenuPage.StartGame:
            headerText = "Start server";
            break;
        }
        GUI.skin = skin;
        GUIStyle smallButton = GUI.skin.GetStyle("SmallButton");
        Rect     pos;

        if (pageOffset > 0.01f)
        {
            pos = new Rect(
                Screen.width - 400 - pageOffset,
                0,
                400,
                Screen.height
                );

            GUI.Box(pos, "");
            GUILayout.BeginArea(pos);
            GUIStyle headerStyle = new GUIStyle(GUI.skin.label);
            headerStyle.fontSize  = 52;
            headerStyle.fontStyle = FontStyle.Bold;
            GUILayout.Label(headerText, headerStyle);
            GUILayout.FlexibleSpace();
            scrollPos2 = GUILayout.BeginScrollView(scrollPos2);
            if (lastActualPage == MenuPage.StartGame)
            {
                startGame.DrawGUI();
            }

            if (lastActualPage == MenuPage.JoinGame)
            {
                joinGame.DrawGUI();
            }

            if (lastActualPage == MenuPage.Options)
            {
                options.DrawGUI();
            }

            if (lastActualPage == MenuPage.Customization)
            {
                customization.DrawGUI();
            }

            if (lastActualPage == MenuPage.Credits)
            {
                #region Credits
                GUIStyle titleStyle = new GUIStyle(GUI.skin.label);
                titleStyle.fontSize  = 24;
                titleStyle.fontStyle = FontStyle.Bold;
                GUIStyle creditsStyle = new GUIStyle(GUI.skin.label);
                creditsStyle.fontSize = 16;
                GUILayout.Label("Original game by BK-TN \n" +
                                "Current version made by uhm.. github?\n" +
                                "Contribute at: https://github.com/HannesMann/Sanicball", creditsStyle);
                GUILayout.Label("Graphics", titleStyle);
                GUILayout.Label("- GRASS TEXTURE: Solon001 on Deviantart\n" +
                                "Most other textures are either made by Unity or taken from royality-free texture sites.", creditsStyle);
                GUILayout.Label("Character faces", titleStyle);
                GUILayout.Label("- SANIC: Popular wallpaper - unknown origin\n" +
                                "- KNACKLES: Disappeared from internet somehow\n" +
                                "- TAELS: Mew087123 on Deviantart\n" +
                                "- AME ROES: o_opc on Reddit\n" +
                                "- SHEDEW: GalaxyTheHedgehog1 on Deviantart\n" +
                                "- ROGE DA BAT: tysonhesse on Deviantart\n" +
                                "- ASSPIO: drawn by me\n" +
                                "- BIG DA CAT: EdulokoX on Reddit\n" +
                                "- DR. AGGMEN: tysonhesse on Deviantart", creditsStyle);
                GUILayout.Label("Music", titleStyle);
                GUILayout.Label("- MENU: Chariots Of Fire theme song\n" +
                                "- LOBBY: Green Hill Zone from Sonic The Hedgehog" +
                                "- INGAME PLAYLIST\n" +
                                "- Sonic Generations - vs. Metal Sonic (Stardust Speedway Bad Future) JP [Generations Mix]\n" +
                                "- Deadmau5 - Infra Super Turbo Pig Cart Racer\n" +
                                "- Sonic Adventure 2 - City Escape\n" +
                                "- Tube and Berger - Straight Ahead (Instrumental)\n" +
                                "- Sonic R - Can you feel the Sunshine?\n" +
                                "- Sonic X theme song (Gotta go fast)\n" +
                                "- Sonic the Hedgehog CD - Sonic Boom\n" +
                                "- Daytona USA - Rolling start!\n" +
                                "- Sonic the Hedgehog CD - Intro (Toot Toot Sonic Warrior)\n" +
                                "- Ugly Baby - Pronto\n" +
                                "- Katamari Damacy - Main Theme"
                                , creditsStyle);
                #endregion
                if (GUILayout.Button("Back", smallButton))
                {
                    page = MenuPage.None;
                }
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndScrollView();
            GUILayout.EndArea();
        }
        pos = new Rect(
            Screen.width - 400,
            0,
            400,
            Screen.height
            );

        GUI.Box(pos, "");
        GUILayout.BeginArea(pos);
        //Game version and slogan
        GUIStyle version = new GUIStyle(GUI.skin.label);
        version.fontSize  = 52;
        version.fontStyle = FontStyle.Bold;
        GUILayout.Label(GameVersion.AsString, version);
        GUILayout.Label(GameVersion.Slogan);
        //Page header

        GUILayout.FlexibleSpace();
        scrollPos = GUILayout.BeginScrollView(scrollPos);
        if (GUILayout.Button("Start Race"))
        {
            page               = MenuPage.StartGame;
            lastActualPage     = MenuPage.StartGame;
            startGame.gameName = GameSettings.user.playerName + "'s Game";
        }
        if (GUILayout.Button("Join Race"))
        {
            GetComponent <ServerBrowser>().Toggle();
        }
        if (GUILayout.Button("Options"))
        {
            page           = MenuPage.Options;
            lastActualPage = MenuPage.Options;
        }
        if (GUILayout.Button("Customization"))
        {
            page           = MenuPage.Customization;
            lastActualPage = MenuPage.Customization;
        }
        if (GUILayout.Button("Credits"))
        {
            page           = MenuPage.Credits;
            lastActualPage = MenuPage.Credits;
        }

        if (GUILayout.Button("Visit Website"))
        {
            if (Application.isWebPlayer)
            {
                Application.ExternalEval("window.open('http://www.sanicball.com','SANICBALL');");
            }
            else
            {
                Application.OpenURL("http://www.sanicball.com");
            }
        }
        if (!Application.isWebPlayer)
        {
            if (GUILayout.Button("Quit"))
            {
                Application.Quit();
            }
        }

        GUILayout.EndScrollView();
        GUILayout.FlexibleSpace();

        GUIStyle style = new GUIStyle(GUI.skin.label);
        style.fontSize = 12;
        int currentYear = Mathf.Max(DateTime.Today.Year, 2014);
        GUILayout.Label("Sanicball is a game by BK-TN and is not related to Sega or Sonic Team in any way. © " + currentYear + " a few rights reserved", style);

        GUILayout.EndArea();
    }
Beispiel #16
0
 public RootPage()
 {
     menuPage = new MenuPage(this);
     Master   = menuPage;
     Detail   = new NavigationPage(new HomePage());
 }
Beispiel #17
0
 /// <summary>
 /// Sets the screen/page the menu is currently on and highlights the first item in that menu.
 /// Triggers leavingMenu() and enteringMenu() actions.
 /// </summary>
 /// <param name="page">The page to move to.</param>
 public void setCurrentMenu(MenuPage page)
 {
     MenuTrail.Push(page);
     setCurrentPage(getIMenuPageFromEnum(page));
 }
        public static void DisplayScreen()
        {
            Reservation reservation = new Reservation();

            Console.Write("Car Plate:");
            var carPlate = Console.ReadLine();
            var carID    = ReservationManagement.ValidateCar(carPlate);

            reservation.CarID = carID;


            Console.Write("Client ID:");
            var clientID = ValidateUserInput.ValidateInputInt(Console.ReadLine());

            reservation.CostumerID = ReservationManagement.ValidateClient(clientID);


            Console.Write("Start Date(mm.dd.yyyy):");
            var startDate = ValidateUserInput.ValidateInputDate(Console.ReadLine());

            Console.Write("End Date(mm.dd.yyyy):");
            var endDate = ValidateUserInput.ValidateInputDate(Console.ReadLine());

            reservation.StartDate = ReservationManagement.ValidateDates(startDate, endDate).Item1;
            reservation.EndDate   = ReservationManagement.ValidateDates(startDate, endDate).Item2;


            Console.Write("Location:");
            var location = Console.ReadLine();

            reservation.LocationID = ReservationManagement.ValidateCarLocation(carID, location);


            List <Nullable <DateTime> > carReserved = ReservationManagement.IsCarAvailabe(carID, startDate, endDate);

            if (carReserved.Count() > 0)
            {
                Console.WriteLine("Car is not available on: " + carReserved);
                ReservationManagement.DisplayReservationInfo(reservation);
            }

            using (var db = new RentCDb())
            {
                Car car = db.Cars.Find(reservation.CarID);

                var     price = car.PricePerDay * (decimal)((endDate - startDate).TotalDays);
                decimal totalPrice;

                Console.WriteLine("The car is available for " + car.PricePerDay + "/day");
                Console.Write("Do you have a cupone code?\nIf yes enter it, if no type NO: ");
                var ans = Console.ReadLine();
                if (ans.ToUpper() == "NO")
                {
                    totalPrice = price;
                }
                else
                {
                    var customerCupon = Console.ReadLine();
                    var cupon         = db.Coupons.FirstOrDefault(c => c.CouponCode == customerCupon);
                    if (cupon != null)
                    {
                        Console.WriteLine("Discount: " + cupon.Discount + ": " + cupon.Description);
                        totalPrice = price - (cupon.Discount * price);
                    }
                    totalPrice = price;
                }

                Console.WriteLine("Total price: " + totalPrice);
                Console.WriteLine("Save the reservation? Type YES to save \nNO to go back to main menu: ");

                ans = Console.ReadLine();
                if (ans == "NO")
                {
                    MenuPage.SelectOption();
                }
                else
                {
                    reservation.ReservStatsID = 1;
                    db.Reservations.Add(reservation);
                    db.SaveChanges();
                }
            }
        }
Beispiel #19
0
        private static bool ManageServiceMenu()
        {
            void StopService()
            {
                Console.WriteLine("Stopping the service...");
                Service?.Stop();
                Service?.WaitForStatus(ServiceControllerStatus.Stopped);
            }

            void StartService()
            {
                Console.WriteLine("Starting the service...");
                try
                {
                    Service?.Start();
                    Service?.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(30));
                }
                catch (Exception e)
                {
                    Console.WriteLine("Failed to start the service...");
                    Console.WriteLine(e);
                    Console.WriteLine("Press any key to return to the menu...");
                    Console.ReadKey(true);
                }
            }

            var menu = new MenuPage("Main Menu > Manage Service");

            menu.Add("Start", () =>
            {
                StartService();
                return(false);
            }, () => Service != null && Service.Status != ServiceControllerStatus.Running);
            menu.Add("Stop", () =>
            {
                StopService();
                return(false);
            }, () => Service?.Status == ServiceControllerStatus.Running);
            menu.Add("Restart", () => {
                StopService();
                StartService();
                return(false);
            }, () => Service?.Status == ServiceControllerStatus.Running);
            menu.Add("Uninstall", () => {
                if (Service?.Status != ServiceControllerStatus.Stopped)
                {
                    StopService();
                }

                try
                {
                    ManagedInstallerClass.InstallHelper(new[]
                                                        { "/u", "/LogFile=", "/LogToConsole=true", Assembly.GetExecutingAssembly().Location });
                }
                catch (Exception e)
                {
                    Console.WriteLine("Failed to uninstall the service...");
                    Console.WriteLine(e);
                }

                Console.WriteLine("Press any key to return to the menu...");
                Console.ReadKey(true);
                return(false);
            }, () => Service != null);
            menu.Add("Install", () => {
                try
                {
                    ManagedInstallerClass.InstallHelper(new[]
                                                        { "/LogFile=", "/LogToConsole=true", Assembly.GetExecutingAssembly().Location });
                }
                catch (Exception e)
                {
                    Console.WriteLine("Failed to install the service...");
                    Console.WriteLine(e);
                }

                Console.WriteLine("Press any key to return to the menu...");
                Console.ReadKey(true);
                return(false);
            }, () => Service == null);
            menu.Add("Back", () => true, () => true, '0');

            while (true)
            {
                Console.Clear();
                var selected = menu.Show();
                if (selected.Callback())
                {
                    return(false);
                }
            }
        }
Beispiel #20
0
        public override void Update(GameTime gameTime, InputManager inputMan, WorldManager worldMan)
        {
            //title.pos.Y = 0.4f + ((float)Math.Sin(gameTime.TotalGameTime.TotalMilliseconds / 300.0) * 0.01f);

            if (inputMan.StartPressed()) exitmenu = true;
            if (inputMan.DownPressed()) cursorpos += 1;
            if (inputMan.UpPressed()) cursorpos -= 1;
            if (cursorpos > 3) cursorpos = 0;
            if (cursorpos < 0) cursorpos = 3;

            cursor.pos.Y = 0.50f + ((float)cursorpos) * 0.05f;
            cursor.pos.X = 0.35f + ((float)Math.Sin(gameTime.TotalGameTime.TotalMilliseconds / 100.0) * 0.005f);

            el_newgame.scale = 0.5f;
            el_options.scale = 0.5f;
            el_endgame.scale = 0.5f;
            el_quit.scale = 0.5f;

            if (cursorpos == 0)
            {
                el_newgame.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    switching = true;
                    nextPage = startGamePage;
                }
            }
            else if (cursorpos == 1)
            {
                el_options.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    //switching = true;
                }
            }
            else if (cursorpos == 2)
            {
                el_endgame.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    worldMan.LoadLevel("title");
                    nextPage = titleMenu;
                    switching = true;
                }
            }
            else if (cursorpos == 3)
            {
                el_quit.scale = 0.6f;
                if (inputMan.EnterPressed())
                {
                    exit = true;
                }
            }
        }
Beispiel #21
0
 /// <summary>
 /// Sets the screen/page the menu is currently on and highlights the first item in that menu.
 /// Triggers leavingMenu() and enteringMenu() actions.
 /// </summary>
 /// <param name="page">The page to move to.</param>
 public void setCurrentMenu(MenuPage page)
 {
     MenuTrail.Push(page);
     setCurrentPage(getIMenuPageFromEnum(page));
 }
        private void MainPageEnter()
        {
            switch (cursorPosition)
            {
                case 0:
                    if (ChangeVisibility != null)
                    {
                        ChangeVisibility(this, MenuVisibilityStatus.Hidden);
                    }
                    break;
                case 1:
                    currentPage = MenuPage.Help;
                    cursorPosition = 3;
                    break;
                case 2:
                    if (Exit != null)
                    {
                        Exit();
                    }
                    break;

            }
        }
        public ActionResult UpdateCategory(string id = "rakuten")
        {
            string   url  = "http://buyee.jp/rakuten/";
            MenuPage menu = new MenuPage();

            switch (id.ToLower())
            {
            case "rakuten":
                url  = "http://buyee.jp/rakuten/";
                menu = rakuten(url);
                break;

            case "yahooauction":
                url  = "http://buyee.jp/yahoo/auction";
                menu = yahooauction(url);
                break;

            case "yahooshopping":
                url  = "http://buyee.jp/yahoo/shopping";
                menu = yahooauction(url);
                break;

            case "zozo":
                url  = "https://zozo.buyee.jp/?lang=ja";
                menu = zozo(url);
                break;

            default:
                url = "http://buyee.jp/rakuten/"; menu = rakuten(url);
                break;
            }

            foreach (var item in menu.listCate)
            {
                if (db.Ohayoo_Category.SingleOrDefault(n => n.id == item.id.ToString() && n.website == id.ToLower()) == null)
                {
                    Ohayoo_Category ct = new Ohayoo_Category()
                    {
                        id      = item.id.ToString(),
                        name_en = item.name,
                        name_jp = item.name,
                        name_vn = item.name,
                        url     = item.url.ToLower(),
                        website = id.ToLower()
                    };

                    db.Ohayoo_Category.Add(ct);
                }
            }
            foreach (var item in menu.listSub)
            {
                if (db.Ohayoo_SubCategory.SingleOrDefault(n => n.id == item.id.ToString() && n.website == id.ToLower()) == null)
                {
                    Ohayoo_SubCategory ct = new Ohayoo_SubCategory()
                    {
                        id      = item.id.ToString(),
                        name_en = item.name,
                        name_jp = item.name,
                        name_vn = item.name,
                        url     = item.url.ToLower(),
                        website = id.ToLower(),
                        cateId  = item.CateId.ToString()
                    };
                    db.Ohayoo_SubCategory.Add(ct);
                }
            }
            db.SaveChanges();
            return(View("Index"));
        }
Beispiel #24
0
 public void SetUp()
 {
     _menu = new MenuPage(Browser);
     //_list = new ListUSerPage(Browser);
 }
Beispiel #25
0
        public void AddRatesTest(string carrierName, string fileFormat, bool isTypeShared = true)
        {
            var menu = new MenuPage(driver);

            menu.DataMenuLocator.ClickEx(driver);

            menu.CarrierRatesAddMenuLocator.Click();

            var carrierAddPage = new CarrierRatesAddPage(driver);

            carrierAddPage.SelectDatasetButtonLocator.Click();

            carrierAddPage.SelectDataset(datasetDescription);

            Assert.AreEqual(carrierAddPage.SelectDatasetButtonLocator.Text, datasetDescription, "Dataset is not selected");

            carrierAddPage.CarrierNameTextBoxLocator.SendKeys($"{carrierName}{randomString}");

            Assert.True(carrierAddPage.EnteredCarrierNameLocator.Text.Contains(carrierName), "Carrier name is not entered");

            if (!isTypeShared)
            {
                carrierAddPage.CarrierTypeButtonLocator.ClickEx(driver);
                carrierAddPage.ClientTypeLocator.Click();
                Thread.Sleep(500);

                carrierAddPage.SelectClient("Luxoft");
            }

            if (carrierName == "AdminExportLuxoft")
            {
                carrierAddPage.SelectSharedClient("Luxoft", true);
            }

            if (carrierName == "AdminLuxShared")
            {
                carrierAddPage.SelectSharedClient("Luxoft");
            }

            uploadFile(pathToRates, fileFormat, driver);

            Utils.WaitUntilLoadingDisappears(driver, secondtToWait: 500);

            Assert.True(carrierAddPage.UploadedFileTextLocator.Text.Contains(fileRates), "File is not loaded");

            Utils.Scroll(carrierAddPage.FooterLocator, driver);

            carrierAddPage.StartButtonLocator.Click();

            waitQuick.Until(ExpectedConditions.ElementToBeClickable(carrierAddPage.ConfirmAddRatesButtonLocator)).Click();

            Utils.WaitUntilLoadingDisappears(driver, secondtToWait: 500);

            var dataProcessingStatus = new DataProcessingStatusPage(driver);

            Utils.WaitUntilLoadingDisappears(driver);

            dataProcessingStatus.CheckRefreshRateToMinimum();

            wait.Until(ExpectedConditions.InvisibilityOfElementWithText(By.XPath($"//*[@id='admin-table-office']//tr[1]/td[6]"), "In queue"));

            wait.Until(ExpectedConditions.InvisibilityOfElementWithText(By.XPath($"//*[@id='admin-table-office']//tr[1]/td[6]"), "In progress"));

            Assert.AreEqual("Completed successfully", dataProcessingStatus.Status[0].Text, "Status is not Completed successfully");
        }
Beispiel #26
0
 private void DisplayMenuPage(MenuPage page)
 {
     page.gameObject.SetActive(true);
 }
Beispiel #27
0
        public void NavigateTo(string pageKey, object parameter)
        {
            lock (_pagesByKey)
            {
                if (_pagesByKey.ContainsKey(pageKey))
                {
                    var             type        = _pagesByKey[pageKey];
                    ConstructorInfo constructor = null;
                    object[]        parameters  = null;

                    if (parameter == null)
                    {
                        constructor = type.GetTypeInfo()
                                      .DeclaredConstructors
                                      .FirstOrDefault(c => !c.GetParameters().Any());

                        parameters = new object[]
                        {
                        };
                    }
                    else
                    {
                        constructor = type.GetTypeInfo()
                                      .DeclaredConstructors
                                      .FirstOrDefault(
                            c =>
                        {
                            var p = c.GetParameters();
                            return(p.Count() == 1 &&
                                   p[0].ParameterType == parameter.GetType());
                        });

                        parameters = new[]
                        {
                            parameter
                        };
                    }

                    if (constructor == null)
                    {
                        throw new InvalidOperationException(
                                  "No suitable constructor found for page " + pageKey);
                    }

                    var page = constructor.Invoke(parameters) as Page;

                    if (page is LoginView)
                    {
                        CurrentApplication.MainPage = page;
                    }
                    else
                    {
                        if (CurrentApplication.MainPage is LoginView)
                        {
                            var menuPage = new MenuPage();

                            (page as RootPage).Master = menuPage;
                            (page as RootPage).Detail = App.Navigation;
                            App.RootPage = (page as RootPage);
                            Application.Current.MainPage = App.RootPage;
                        }
                        else
                        {
                            _navigation.PushAsync(page);
                        }
                    }
                }
                else
                {
                    throw new ArgumentException(
                              string.Format(
                                  "No such page: {0}. Did you forget to call NavigationService.Configure?",
                                  pageKey),
                              "pageKey");
                }
            }
        }
 public Matratt CheckMatrattsValidation(MenuPage model)
 {
     return(_context.Matratt.FirstOrDefault(r => r.MatrattNamn == model.NewDish.Matratt.MatrattNamn));
 }
 // Start is called before the first frame update
 void Start()
 {
     SetStaticInstance();
     currentlyActiveMenuPage = startingMenuPage.GetComponent <MenuPage>();
 }
Beispiel #30
0
        public void Update(GameTime gameTime, InputManager inputMan, WorldManager worldMan)
        {
            if (currentMenu.SwitchingPages())
            {
                currentMenu = currentMenu.GetNextPage();
            }

            currentMenu.Update(gameTime, inputMan, worldMan);

            if (currentMenu.SaveGame())
            {
                save = true;
            }

            if (currentMenu.ExitMenu())
            {
                active = false;
            }

            if (currentMenu.ExitGame())
            {
                quit = true;
            }
        }
 public Menu(int w, int h)
 {
     width = w;
     height = h;
     currentPage = MenuPage.Main;
 }
Beispiel #32
0
 public void SwapPage(MenuPage to)
 {
     selectEffect.start();
     MenuManager.instance.SwapUIMenu(to);
 }
 public TransactionSummaryPage(IWebDriver driver, WebDriverWait wait, Actions actions, MenuPage menu)
     : base(driver, wait, actions)
 {
     Menu = menu;
     PageFactory.InitElements(driver, this);
     WaitUntilPageLoads();
 }
Beispiel #34
0
        private static bool DebugMenu()
        {
            if (!LogManager.Configuration.LoggingRules.Any(r => r.IsLoggingEnabledForLevel(LogLevel.Trace)))
            {
                LogManager.DisableLogging();
            }

            void WriteHeader(string header)
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine(header);
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("-------------------------------");
                Console.ForegroundColor = ConsoleColor.Gray;
            }

            void WriteFooter()
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("-------------------------------");
                Console.ForegroundColor = ConsoleColor.White;
                Console.ResetColor();
            }

            void WriteProperty(int indent, string propertyName, object value = null)
            {
                Console.ForegroundColor = ConsoleColor.DarkGray;
                Console.Write($"» {new string('\t', indent)} ");
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.Write($"{propertyName}");
                if (value != null)
                {
                    Console.ForegroundColor = ConsoleColor.Cyan;
                    Console.Write($"{value}");
                }
                Console.WriteLine();
                Console.ResetColor();
            }

            void WaitForInput()
            {
                Console.WriteLine("Press any key to continue...");
                Console.ReadKey();
            }

            void ListInfo()
            {
                WriteHeader("Info");
                WriteProperty(0, "");

                var osName      = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductName", null)?.ToString() ?? string.Empty;
                var osReleaseId = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", null)?.ToString() ?? string.Empty;
                var osBuild     = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "BuildLabEx", null)?.ToString() ?? string.Empty;
                var appVersion  = FileVersionInfo.GetVersionInfo(Assembly.GetCallingAssembly().Location)?.ProductVersion;

                WriteProperty(1, "OS: ", $"{osName} {osReleaseId} [{osBuild}]");
                WriteProperty(1, "Build: ", appVersion);

                WriteProperty(0, "");
                WriteFooter();
            }

            void ListApplications()
            {
                WriteHeader("Applications");
                WriteProperty(0, "");

                var thermaltakeExecutables = new[]
                {
                    "TT RGB Plus",
                    "ThermaltakeUpdate",
                    "Thermaltake DPS POWER",
                    "NeonMaker Light Editing Software"
                };

                foreach (var process in Process.GetProcesses())
                {
                    if (thermaltakeExecutables.Any(e => string.CompareOrdinal(process.ProcessName, e) == 0))
                    {
                        WriteProperty(0, $"{Path.GetFileName(process.ProcessName)}.exe ", process.Id);
                    }
                }

                WriteProperty(0, "");
                WriteFooter();
            }

            void ListHid()
            {
                WriteHeader("HID");
                WriteProperty(0, "");

                foreach (var device in DeviceList.Local.GetHidDevices(vendorID: 0x264a))
                {
                    WriteProperty(0, $"[0x{device.VendorID:x}, 0x{device.ProductID:x}]: ", device.DevicePath);
                }

                WriteProperty(0, "");
                WriteFooter();
            }

            void ListControllers()
            {
                WriteHeader("Controllers");
                WriteProperty(0, "");

                PluginLoader.Load(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins"), typeof(IControllerDefinition));
                using (var deviceManager = new DeviceManager())
                {
                    foreach (var controller in deviceManager.Controllers)
                    {
                        WriteProperty(0, "Name: ", controller.Name);
                        WriteProperty(1, "VendorId: ", controller.VendorId);
                        WriteProperty(1, "ProductId: ", controller.ProductId);
                        WriteProperty(1, "Version: ", controller.Version);
                        WriteProperty(1, "Ports: ");

                        foreach (var port in controller.Ports)
                        {
                            WriteProperty(2, $"{port.Id}: ");
                            WriteProperty(3, "Data: ", controller.GetPortData(port.Id));
                            WriteProperty(3, "Identifier: ", port);
                        }

                        WriteProperty(1, "Available effect types: ", string.Join(", ", controller.EffectTypes));
                    }
                }

                WriteProperty(0, "");
                WriteFooter();
            }

            void ListSensors(params SensorType[] types)
            {
                WriteHeader("Sensors");
                WriteProperty(0, "");

                string FormatValue(SensorType type, float value)
                {
                    switch (type)
                    {
                    case SensorType.Voltage:     return($"{value:F2} V");

                    case SensorType.Clock:       return($"{value:F0} MHz");

                    case SensorType.Load:        return($"{value:F1} %");

                    case SensorType.Temperature: return($"{value:F1} °C");

                    case SensorType.Fan:         return($"{value:F0} RPM");

                    case SensorType.Flow:        return($"{value:F0} L/h");

                    case SensorType.Control:     return($"{value:F1} %");

                    case SensorType.Level:       return($"{value:F1} %");

                    case SensorType.Power:       return($"{value:F0} W");

                    case SensorType.Data:        return($"{value:F0} GB");

                    case SensorType.SmallData:   return($"{value:F1} MB");

                    case SensorType.Factor:      return($"{value:F3}");

                    case SensorType.Frequency:   return($"{value:F1} Hz");

                    case SensorType.Throughput:  return($"{value:F1} B/s");
                    }

                    return($"{value}");
                }

                using (var _libreHardwareMonitorFacade = new LibreHardwareMonitorFacade())
                {
                    var availableSensors = _libreHardwareMonitorFacade.Sensors.Where(s => types.Length == 0 || types.Contains(s.SensorType));
                    foreach (var(hardware, sensors) in availableSensors.GroupBy(s => s.Hardware))
                    {
                        WriteProperty(0, $"{hardware.Name}:");
                        hardware.Update();

                        foreach (var(type, group) in sensors.GroupBy(s => s.SensorType))
                        {
                            WriteProperty(1, $"{type}:");
                            foreach (var sensor in group)
                            {
                                WriteProperty(2, $"{ sensor.Name} ({ sensor.Identifier}): ", FormatValue(type, sensor.Value ?? float.NaN));
                            }
                        }

                        WriteProperty(0, "");
                    }
                }

                WriteFooter();
            }

            void ListPlugins()
            {
                WriteHeader("Plugins");
                WriteProperty(0, "");

                var pluginAssemblies = PluginLoader.SearchAll(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins"));

                WriteProperty(0, "Detected plugins:");
                foreach (var assembly in pluginAssemblies)
                {
                    WriteProperty(1, Path.GetFileName(assembly.Location));
                }

                WriteProperty(0, "");
                WriteFooter();
            }

            var enabled = Service != null && Service.Status != ServiceControllerStatus.Running;
            var menu    = new MenuPage("Main Menu > Debug");

            menu.Add("Report", () => {
                Console.Clear();
                ListInfo();
                ListApplications();
                ListHid();
                ListControllers();
                ListSensors(SensorType.Temperature);
                WaitForInput();
                return(false);
            }, () => enabled);
            menu.Add("Controllers", () => {
                Console.Clear();
                ListHid();
                ListControllers();
                WaitForInput();
                return(false);
            }, () => enabled);
            menu.Add("Sensors", () => {
                Console.Clear();
                ListSensors();
                WaitForInput();
                return(false);
            }, () => enabled);
            menu.Add("Plugins", () => {
                Console.Clear();
                ListPlugins();
                WaitForInput();
                return(false);
            }, () => enabled);
            menu.Add("Back", () => {
                LogManager.EnableLogging();
                return(true);
            }, () => true, '0');

            while (true)
            {
                Console.Clear();
                var selected = menu.Show();
                if (selected.Callback())
                {
                    return(false);
                }
            }
        }
Beispiel #35
0
 public MenuPageWrapper(MenuPage page)
 {
     MenuPage = page;
 }
Beispiel #36
0
 public MenuPreset(MenuPage page, string prefix, Dictionary <string, T> dict, T obj,
                   Func <T, string> caption, MenuElementFactory <T> factory)
     : this(page, prefix, dict, obj, caption)
 {
     Pair(factory);
 }
Beispiel #37
0
        public MainPage()
        {
            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                loginUserInfoPage = new NavigationPage(new LoginUserInfoPage())
                {
                    Title = "UserInfo"
                };

                loginPage = new NavigationPage(new LoginPage(this))
                {
                    Title = "Login"
                };

                menuPage = new NavigationPage(new MenuPage())
                {
                    Title = "Menu"
                };

                aboutPage = new NavigationPage(new AboutPage())
                {
                    Title = "About"
                };

                aboutPage.Icon         = "tab_about.png";
                menuPage.Icon          = "tab_feed.png";
                loginUserInfoPage.Icon = "tab_user.png";
                loginPage.Icon         = "tab_user.png";

                break;

            default:

                loginUserInfoPage = new LoginUserInfoPage()
                {
                    Title = "UserInfo"
                };

                loginPage = new LoginPage(this)
                {
                    Title = "Login"
                };

                menuPage = new MenuPage()
                {
                    Title = "Menu"
                };

                aboutPage = new AboutPage()
                {
                    Title = "About"
                };
                break;
            }

            Children.Add(aboutPage);
            Children.Add(menuPage);

            SetLoginPage();

            Title = Children[0].Title;
        }
Beispiel #38
0
 IMenuPage getIMenuPageFromEnum(MenuPage page)
 {
     switch (page)
     {
         case MenuPage.Main:
             return Main;
         case MenuPage.MapSelect:
             return MapSelect;
         case MenuPage.Multiplayer:
             return Multiplayer;
         case MenuPage.Options:
             return Options;
         case MenuPage.SinglePlayerShipSelect:
             return SinglePlayerShipSelect;
         case MenuPage.RaceSelect:
             return RaceSelect;
         case MenuPage.Splash:
             return Splash;
         case MenuPage.Loading:
             GameLoop.StopTitle();
             return Loading;
         case MenuPage.HighScore:
             return HighScore;
         case MenuPage.FinishedLoading:
             return FinishedLoading;
         case MenuPage.Pause:
             return Pause;
         case MenuPage.Results:
             return Results;
         case MenuPage.Confimation:
             return Confim;
         default:
             throw new Exception();
             return null;
     }
 }
Beispiel #39
0
 /// <summary>
 /// Causes the button to hide the given MenuPage on click.
 /// </summary>
 public static void AddHideMenuPageEvent(this BaseButton self, MenuPage prev)
 {
     self.OnClick += prev.Hide;
 }
Beispiel #40
0
 public RootPage()
 {
     Master = new MenuPage(this);
     Detail = new NavigationPage(new TeamsPage());
 }
Beispiel #41
0
 /// <summary>
 /// Causes the button to show the given MenuPage on click.
 /// </summary>
 public static void AddShowMenuPageEvent(this BaseButton self, MenuPage next)
 {
     self.OnClick += next.Show;
 }
Beispiel #42
0
        public App()
        {
            InitializeComponent();

            MainPage = new MenuPage();
        }
Beispiel #43
0
 public void ResetRoot()
 {
     currentMenu = rootMenu;
 }
Beispiel #44
0
 public App()
 {
     MainPage = new MenuPage();
 }
Beispiel #45
0
 public ContactUsPage NavigateToContactUs()
 {
     MenuPage menuPage = new MenuPage(webDriver);
     ContactUsPage contactUsPage = menuPage.ClickContactUs();
     return contactUsPage;
 }
 private void RemoveMenuPage(MenuPage page)
 {
     page.gameObject.SetActive(false);
 }
Beispiel #47
0
 private void OpenLevel()
 {
     MenuPage.Close();
     LevelPages[levelId].Open();
 }
Beispiel #48
0
 public void SwapPage(MenuPage to)
 {
     MenuManager.instance.SwapUIMenu(to);
 }
Beispiel #49
0
        private async Task RefreshNavbar(bool useAll)
        {
            IsBusy = true;


            if (api.AuthenticationManager.getState() != api.AuthenticationManager.AuthenticationState.ACTIVE)
            {
                Device.BeginInvokeOnMainThread(() => DisplayAlert("Authorization needed", "Please authorize the App first", "OK"));
                IsBusy = false;
                return;
            }

            //var c = new System.Net.Http.HttpClient();

            // Get the courses!
            L2PCourseInfoSetData courses;

            if (useAll)
            {
                courses = await api.RESTCalls.L2PViewAllCourseInfoAsync();
            }
            else
            {
                string semester;
                if (DateTime.Now.Month < 4)
                {
                    // winter semester but already in new year -> ws+last year
                    semester = "ws" + DateTime.Now.AddYears(-1).Year.ToString().Substring(2);
                }
                else if (DateTime.Now.Month > 9)
                {
                    // winter semester, still in this year
                    semester = "ws" + DateTime.Now.Year.ToString().Substring(2);
                }
                else
                {
                    // summer semester
                    semester = "ss" + DateTime.Now.Year.ToString().Substring(2);
                }
                courses = await api.RESTCalls.L2PViewAllCourseIfoBySemesterAsync(semester);
            }

            // Workaround (should be moved to Manager)
            if (courses == null)
            {
                await api.AuthenticationManager.GenerateAccessTokenFromRefreshTokenAsync();

                courses = await api.RESTCalls.L2PViewAllCourseInfoAsync();
            }

            if (courses.dataset == null)
            {
                Device.BeginInvokeOnMainThread(() => DisplayAlert("Error", "An error occured: " + courses.errorDescription, "OK"));
                IsBusy = false;
                return;
            }

            MenuPage.ClearCoursesMenu();
            foreach (L2PCourseInfoData l2pcourse in courses.dataset)
            {
                MenuPage.AddCourseToMenu(l2pcourse.uniqueid, l2pcourse.courseTitle);
            }

            IsBusy = false;
        }
Beispiel #50
0
 public void SetInTitleScreen(bool isInTitleScreen)
 {
     inTitle = isInTitleScreen;
     if (inTitle)
     {
         rootMenu = titleMenu;
     }
     else
     {
         rootMenu = inGameMenu;
     }
 }
Beispiel #51
0
 public MenuPageNavigation(MenuPage page)
 {
     Page = page;
 }
Beispiel #52
0
 public void SetUp()
 {
     _menu   = new MenuPage(Browser);
     _create = new CreateUSerPage(Browser);
 }
Beispiel #53
0
        void Init()
        {
            SchemeAction.SchemeParser = (host, segments) =>
            {
                var action     = string.Empty;
                var startIndex = 0;

                if (host == "heleuscore.com" && segments[1] == "todo/")
                {
                    if (segments[2] == "request/")
                    {
                        action     = SchemeAction.GetString(segments, 3);
                        startIndex = 4;
                    }
                }

                return(new Tuple <string, int>(action, startIndex));
            };

            SchemeAction.RegisterSchemeAction <RequestInvitationSchemeAction>();
            SchemeAction.RegisterSchemeAction <InvitationSchemeAction>();

            var sem = new ServiceNodeManager(TodoServiceInfo.ChainId, TodoServiceInfo.EndPoint, TodoServiceInfo.Version, TodoServiceInfo.Name, _currentSettings, _currentSettings, PubSub, TransactionDownloadManagerFlags.DecrytpedTransactionStorage);

            TodoApp.Current.Init();
            _ = new ProfileManager(new ClientBase(sem.HasDebugEndPoint ? sem.DefaultEndPoint : ProfileServiceInfo.EndPoint, ProfileServiceInfo.ChainId), sem.CacheStorage, PubSub);

            var masterDetail = new ExtMasterDetailPage();
            var navigation   = new ExtNavigationPage(new TodoPage());

            if (IsAndroid)
            {
                MenuPage = new AndroidMenuPage(masterDetail, navigation);
            }
            else if (IsUWP)
            {
                MenuPage = new UWPMenuPage(masterDetail, navigation);
            }
            else if (IsDesktop)
            {
                MenuPage = new DesktopMenuPage(masterDetail, navigation);
            }
            else if (IsIOS)
            {
                MenuPage = new IOSMenuPage(masterDetail, navigation);
            }

            MenuPage.AddPage(typeof(TodoPage), "TodoPage.Title", Icons.CircleCheck);
            MenuPage.AddPage(typeof(SettingsPage), "SettingsPage.Title", Icons.Slider);

            //menu.AddButton(TodoApp.Current.AddGroup, "Menu.AddGroup", Icons.Plus);
            //menu.AddButton(TodoApp.Current.Reload, "Menu.Reload", Icons.Sync);

            masterDetail.Master = MenuPage;
            masterDetail.Detail = navigation;

            MainPage = MainMasterDetailPage = masterDetail;

            PubSub.Subscribe <ServiceNodeChangedEvent>(this, ServiceNodeChanged);
            PubSub.Subscribe <ServiceNodesLoadedEvent>(this, ServiceNodesLoaded);
            PubSub.Subscribe <TodoListRegistrationEvent>(this, TodoListRegistration);;

            PubSub.Subscribe <QueryTodoEvent>(this, QueryTodo);
            PubSub.Subscribe <QueryTodoListEvent>(this, QueryTodoList);

            SetupTodoSection();
            SetupTodoList(MenuPage, ViewTodoList);
        }