Inheritance: MonoBehaviour
Example #1
0
        private static void PerformOperation(MenuOption option)
        {
            switch (option)
            {
            case MenuOption.Register:
                RegistrationMenu();
                break;

            case MenuOption.Login:
                LoginMenu();
                break;

            case MenuOption.GetUserInfo:
                GetUserMenu();
                break;

            case MenuOption.GetDatesByRange:
                GetDatesByRange();
                break;

            case MenuOption.AddDate:
                AddDate();
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(option), option, null);
            }
        }
        public void PerformTransactions()
        {
            // local variable to store transaction currently being processed
            Transaction currentTransaction = null;
            bool        isUserExited       = false; // user has not chosen to exit

            // loop while user has not chosen option to exit system
            while (!isUserExited)
            {
                Console.Clear();
                MenuOption menuSelect = DisplayMainMenu();
                switch (menuSelect)
                {
                case MenuOption.BalanceInquiry:
                case MenuOption.Withdrawal:
                case MenuOption.Deposit:
                    currentTransaction = CreateTransaction(menuSelect);
                    currentTransaction.Execute();
                    break;

                case MenuOption.Exit:
                    Screen.DisplayMessageLine("Exiting the system...");
                    isUserExited = true;
                    Sleep(3000);
                    Console.Clear();
                    break;

                // Try again if you enter a value other than the enum values, regardless of the GetInput method.
                default:
                    Screen.DisplayMessageLine("You did not enter a valid selection. Try again.");
                    break;
                }
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            Bank bank = new Bank();

            do
            {
                MenuOption chosen = ReadUserOption();
                switch (chosen)
                {
                case MenuOption.CreateAccount:
                    CreateAccount(bank); break;

                case MenuOption.Withdraw:
                    DoWithdraw(bank); break;

                case MenuOption.Deposit:
                    DoDeposit(bank); break;

                case MenuOption.Transfer:
                    DoTransfer(bank); break;

                case MenuOption.Rollback:
                    DoRollback(bank); break;

                case MenuOption.Print:
                    DoPrint(bank); break;

                case MenuOption.Quit:
                default:
                    Console.WriteLine("Goodbye");
                    return;     // Terminates the program
                }
            } while (true);
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,FoodServiceId")] MenuOption menuOption)
        {
            if (id != menuOption.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(menuOption);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MenuOptionExists(menuOption.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(menuOption));
        }
    public void SelectOption(MenuOption option)
    {
        switch (option)
        {
        case MenuOption.PLAY_WITH_RANDOS:
            NetworkingManager.instance.ChangeConnectionType(ConnectionType.JOIN_OR_CREATE_RANDOM);
            break;

        case MenuOption.PLAY_WITH_FRIENDS:
            ActivateMultiplayerMenu(joinFriendsRoomMenu);
            break;

        case MenuOption.BACK:
            backButton.SetActive(false);
            if (joinFriendsRoomMenu.activeInHierarchy)
            {
                ActivateMultiplayerMenu(mainMenu);
            }
            else
            {
                NetworkingManager.instance.ChangeConnectionType(ConnectionType.CREATE_PRIVATE);
            }
            break;
        }
    }
Example #6
0
    public void AddMenuOption(string text)
    {
        MenuOption m = gameObject.AddComponent <MenuOption>();

        m.Menu = this;
        m.text = text;
    }
Example #7
0
        static void Main()
        {
            Menu();
            MenuOption menuOption = ReadMenuOption();

            MenuWorker(menuOption);
        }
Example #8
0
        void connect(object obj)
        {
            ConnectionThread cxn = (ConnectionThread)obj;

            try
            {
                cxn.Connection.connect();
                // Authenticated Vista Connection Handling
                if (this.PoolSource.Credentials != null) // should be an authenticated connection!
                {
                    AbstractPermission permission = new MenuOption(VistaConstants.CAPRI_CONTEXT);
                    permission.IsPrimary = true;
                    if (String.IsNullOrEmpty(this.PoolSource.Credentials.AccountName) || String.IsNullOrEmpty(this.PoolSource.Credentials.AccountPassword))
                    {
                        cxn.Connection.Account.AuthenticationMethod = VistaConstants.NON_BSE_CREDENTIALS; // if no A/V codes, visit
                    }
                    else
                    {
                        cxn.Connection.Account.AuthenticationMethod = VistaConstants.LOGIN_CREDENTIALS;
                    }
                    cxn.Connection.Account.authenticateAndAuthorize(this.PoolSource.Credentials, permission);
                }
                // END Authenticated cxn handling
                else if (cxn.Connection is VistaPoolConnection) // else if pool cxn and no creds - get default state
                {
                    ((VistaPoolConnection)cxn.Connection)._rawConnectionSymbolTable = ((VistaPoolConnection)cxn.Connection).getState();
                }
                this.TotalResources++;
                cxn.Connection.setTimeout(this.PoolSource.Timeout); // now gracefully timing out connections!
            }
            catch (Exception)
            {
                cxn.Connection.IsConnected = false;
            }
        }
    // Update is called once per frame
    void Update()
    {
        float input = Input.GetAxisRaw ("Vertical");
        int index = options.IndexOf (currentSelection);
        if (canMove) {
            if (input > 0) {
                index = index - 1;
                canMove = false;
            } else if (input < 0) {
                index = index + 1;
                canMove = false;
            }
        }
        index = mod(index, options.Count);
        if (input == 0) {
            canMove = true;
        }
        if (currentSelection != options[index]) {
            currentSelection = options[index];
            currentSelection.OnCursorOver();
        }

        Vector3 target = currentSelection.GetAnchorPosition ();
        target.z = target.z + zOffset;
        this.transform.position = Vector3.Lerp(this.transform.position, target, Time.deltaTime * speed);

        if (canSelect && Input.GetButton ("Jump")) {
            currentSelection.ActivateItem();
            canSelect = false;
        }
        if (!Input.GetButton ("Jump")) {
            canSelect = true;
        }
    }
        public override IQuery GetHsql(object data)
        {
            StringBuilder sql        = new StringBuilder("select a from MenuOption a  where  ");
            MenuOption    menuoption = (MenuOption)data;

            if (menuoption != null)
            {
                Parms = new List <Object[]>();

                if (menuoption.MenuOptionID != 0)
                {
                    sql.Append(" a.MenuOptionID = :id     and    ");
                    Parms.Add(new Object[] { "id", menuoption.MenuOptionID });
                }

                if (!String.IsNullOrEmpty(menuoption.Name))
                {
                    sql.Append(" a.Name = :nom     and   ");
                    Parms.Add(new Object[] { "nom", menuoption.Name });
                }

                if (!String.IsNullOrEmpty(menuoption.Url))
                {
                    sql.Append(" a.Url = :nom1    and   ");
                    Parms.Add(new Object[] { "nom1", menuoption.Url });
                }

                if (menuoption.MenuOptionType != null && menuoption.MenuOptionType.MenuOptionTypeID != 0)
                {
                    sql.Append(" a.MenuOptionType.MenuOptionTypeID = :id1     and   ");
                    Parms.Add(new Object[] { "id1", menuoption.MenuOptionType.MenuOptionTypeID });
                }

                if (menuoption.NumOrder != 0)
                {
                    sql.Append(" a.NumOrder = :id2     and    ");
                    Parms.Add(new Object[] { "id2", menuoption.NumOrder });
                }

                if (menuoption.Active != null)
                {
                    sql.Append(" a.Active = :ia2     and    ");
                    Parms.Add(new Object[] { "ia2", menuoption.Active });
                }


                if (menuoption.OptionType != null && menuoption.OptionType.OpTypeID != 0)
                {
                    sql.Append(" a.OptionType.OpTypeID = :io2     and    ");
                    Parms.Add(new Object[] { "io2", menuoption.OptionType.OpTypeID });
                }
            }

            sql = new StringBuilder(sql.ToString());
            sql.Append("1=1 order by a.MenuOptionID asc ");
            IQuery query = Factory.Session.CreateQuery(sql.ToString());

            SetParameters(query);
            return(query);
        }
Example #11
0
        // This constructor is needed for API level tests.
        public MockConnection(string siteId, string protocol, bool updateRpc = false) : base(null)
        {
            this.DataSource          = new DataSource();
            this.DataSource.SiteId   = new SiteId(siteId, "Mock");
            this.DataSource.Protocol = protocol;

            //DP 3/24/2011
            //I commented out the line below, the pid should not be set to
            //"0" as the default, as all of the other subclasses of
            //AbstractCollection do not set it.  This was causing conflicts
            //b/w the MockConnection.XML file and the DaoX tests.

            //I will fix the affected tests (14 now fail as the exception
            //message has changed).

            //this.Pid = "0";

            setXmlSource(siteId, updateRpc);

            this.Account   = new VistaAccount(this);
            this.updateRpc = updateRpc;

            AbstractCredentials credentials = new VistaCredentials();

            credentials.AccountName     = "AccessCode";
            credentials.AccountPassword = "******";
            AbstractPermission permission = new MenuOption(VistaConstants.MDWS_CONTEXT);

            permission.IsPrimary = true;
            this.Account.Permissions.Add(permission.Name, permission);
            //permission = new MenuOption(VistaConstants.DDR_CONTEXT);
            //this.Account.Permissions.Add(permission.Name, permission);
            sysFileHandler = new VistaSystemFileHandler(this);
        }
Example #12
0
        protected override void CreateMenuDefinition()
        {
            MainOption = new MenuOption("e", Header);
            Menu       = new List <MenuOption>()
            {
                new MenuOption("a", "List Orders"),
                new MenuOption("b", "List Released orders"),
                new MenuOption("c", "List Created/Released orders for specific date"),
                new MenuOption("d", "List Acknowledged orders"),
                new MenuOption("e", "List Acknowledged orders created on a specific date"),
                new MenuOption("f", "List Shipped/Refunded orders"),
                new MenuOption("g", "List Shipped orders created on a specific date"),
                new MenuOption("h", "List Cancelled orders"),
                new MenuOption("i", "List Cancelled orders created on a specific date"),

                new MenuOption("j", "List orders for Specific SKU"),
                new MenuOption("k", "List orders created after specific date"),
                new MenuOption("l", "List orders created before specific date"),
                new MenuOption("m", "List orders with expected ship date after specific date"),
                new MenuOption("n", "List orders to be shipped based on creation date"),
                new MenuOption("o", "View order detail"),
                new MenuOption("p", "Acknowledge order"),
                new MenuOption("q", "Ship order"),
                new MenuOption("r", "Cancel order"),
                new MenuOption("s", "Refund order")
            };
        }
Example #13
0
        private static Dictionary <string, MenuOption> Menu()
        {
            var awaitSamples           = new AwaitSamples();
            var continueSamples        = new ContinueSamples();
            var cancelSamples          = new CancelSamples();
            var whenAllSamples         = new WhenAllSamples();
            var parallelSamples        = new ParallelSamples();
            var unsafeQueueSamples     = new UnsafeQueueSamples();
            var concurrentQueueSamples = new ConcurrentQueueSamples();
            var mutexSamples           = new MutexSamples();
            var exceptionSamples       = new ExceptionSamples();

            return(new Dictionary <string, MenuOption>
            {
                { "1", MenuOption.New("async/await", awaitSamples.DoWorkAsync) },
                { "2", MenuOption.New("ContinueWith", continueSamples.DoWorkAsync) },
                { "3", MenuOption.New("CancellationToken", cancelSamples.DoWorkAsync) },
                { "4", MenuOption.New("WhenAll", whenAllSamples.DoWorkAsync) },
                { "5", MenuOption.New("AsParallel", parallelSamples.DoWorkAsync) },
                { "6", MenuOption.New("Unsafe Queue<>", unsafeQueueSamples.DoWorkAsync) },
                { "7", MenuOption.New("ConcurrentQueue<>", concurrentQueueSamples.DoWorkAsync) },
                { "8", MenuOption.New("Mutex", mutexSamples.DoWorkAsync) },
                { "9", MenuOption.New("Ex Handling", exceptionSamples.DoWorkAsync) }
            });
        }
Example #14
0
        public TaggedTextArray visitDoD(string pwd)
        {
            Site site = mySession.SiteTable.getSite(MdwsConstants.DOD_SITE);
            AbstractCredentials credentials = getAdministrativeCredentials(site);

            credentials.SecurityPhrase = mySession.MdwsConfiguration.AllConfigs[ConfigFileConstants.PRIMARY_CONFIG_SECTION][MdwsConfigConstants.SERVICE_ACCOUNT_PASSWORD];

            string context = MdwsConstants.MDWS_CONTEXT;

            if (mySession.DefaultVisitMethod == MdwsConstants.NON_BSE_CREDENTIALS)
            {
                context = MdwsConstants.CPRS_CONTEXT;
            }
            AbstractPermission permission = new MenuOption(context);

            permission.IsPrimary = true;

            TaggedTextArray result = new TaggedTextArray();

            try
            {
                User u = doTheVisit(site.Id, credentials, permission);
                result.results = new TaggedText[] { new TaggedText(site.Id, u.Uid) };
                addMyCxn2CxnSet();
                mySession.Credentials       = credentials;
                mySession.PrimaryPermission = permission;
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            return(result);
        }
Example #15
0
        /// <summary>
        /// Displays the outcome of a deposit or withdraw action
        /// </summary>
        /// <param name="action">The MenuOption currently in use</param>
        /// <param name="result">Boolean result of the deposit or withdraw</param>
        private static void DisplayResult(MenuOption action, Boolean result)
        {
            String output = action + " "
                            + (result == true ? "succeeded" : "failed. Invalid amount.");

            Console.WriteLine(output);
        }
    protected void OnMouseDown()
    {
        if (!menuIsOpened)
        {
            if (isPerson)
            {
                GameObject tempMenu = Instantiate(optionMenu) as GameObject;
                tempMenu.transform.position = new Vector3(baseGameObject.transform.position.x,
                                                          baseGameObject.transform.position.y, tempMenu.transform.position.z);


                MenuOption menu = (MenuOption)tempMenu.GetComponent(typeof(MenuOption));
                menu.SetOrigin(baseGameObject);

                gameObject.GetComponent <SpriteRenderer>().sprite = sprites[0];
                menuIsOpened = true;
            }
            else
            {
                GameObject tempNotebook = Instantiate(notebook) as GameObject;
                tempNotebook.transform.position = new Vector3(Camera.main.gameObject.transform.position.x,
                                                              Camera.main.gameObject.transform.position.y, tempNotebook.transform.position.z);

                menuIsOpened = true;
            }
        }
    }
Example #17
0
        // This does an administrative visit in order to get the true user's data
        internal User getVisitorData(string userSitecode, string DUZ, string appPwd)
        {
            Site site = mySession.SiteTable.getSite(userSitecode);
            AbstractCredentials credentials = getAdministrativeCredentials(site);

            credentials.AuthenticationToken = userSitecode + '_' + credentials.LocalUid;
            credentials.SecurityPhrase      = appPwd;

            string context = MdwsConstants.MDWS_CONTEXT;

            if (mySession.DefaultVisitMethod == MdwsConstants.NON_BSE_CREDENTIALS)
            {
                context = MdwsConstants.CPRS_CONTEXT;
            }

            // Here we do NOT set mySession.PrimaryPermission.  This context is being set
            // solely for the Admin user to get the true user's credentials.  mySession.PrimaryPermission
            // is for the true user.
            AbstractPermission permission = new MenuOption(context);

            permission.IsPrimary = true;

            User u = doTheVisit(userSitecode, credentials, permission);

            UserApi userApi  = new UserApi();
            User    trueUser = userApi.getUser(myCxn, DUZ);

            myCxn.disconnect();
            return(trueUser);
        }
Example #18
0
    // Use this for initialization
    void Start()
    {
        MenuOption main = new MenuOption("Main", null, null);
        MenuOption play = new MenuOption("Play", main, null);
        MenuOption settings = new MenuOption("Settings", main, null);
        MenuOption quit = new MenuOption("Quit", main, null);
        MenuOption[] mainSub = new MenuOption[3];
        mainSub[0] = play;
        mainSub[1] = settings;
        mainSub[2] = quit;
        main.Children = mainSub;
        MenuOption singlePlayer = new MenuOption("Single Player", play, null);
        MenuOption multiPlayer = new MenuOption("Multi Player", play, null);
        MenuOption playBack = new MenuOption("Back", play, null);
        MenuOption[] playSub = new MenuOption[3];
        playSub[0] = singlePlayer;
        playSub[1] = multiPlayer;
        playSub[2] = playBack;
        play.Children = playSub;
        MenuOption rndOppo = new MenuOption("Random Opponent", multiPlayer, null);
        MenuOption specificOppo = new MenuOption("Specific Opponent", multiPlayer, null);
        MenuOption multiBack = new MenuOption("Back", multiPlayer, null);
        MenuOption[] multSub = new MenuOption[3];
        multSub[0] = rndOppo;
        multSub[1] = specificOppo;
        multSub[2] = multiBack;
        multiPlayer.Children = multSub;

        currentMenu = main;

        GameObject.Find("Menu Item 1").GetComponent<MenuBox>().menuOption = play;
        GameObject.Find("Menu Item 2").GetComponent<MenuBox>().menuOption = settings;
        GameObject.Find("Menu Item 3").GetComponent<MenuBox>().menuOption = quit;
    }
Example #19
0
    public void Clicked(int i)
    {
        Camera.main.audio.PlayOneShot(MenuClick);
        int j = 1;
        currentMenu = currentMenu.Children[i-1];
        if(currentMenu.Title == "Quit") { Application.Quit(); return; }
        else if(currentMenu.Title == "Back") { currentMenu = currentMenu.Parent.Parent; }
        else if(currentMenu.Title == "Settings") { currentMenu = currentMenu.Parent; }
        else if(currentMenu.Title == "Specific Opponent") { currentMenu = currentMenu.Parent; }
        else if(currentMenu.Title == "Random Opponent") { GameControl.IsMulti = true; LoadingScreen.show (); iTween.Stop(); Application.LoadLevel(1); return; }
        else if(currentMenu.Title == "Single Player") { GameControl.IsMulti = false; LoadingScreen.show (); iTween.Stop(); Application.LoadLevel(1); return; }
        foreach(Transform child in transform.transform) {

            Camera.main.audio.PlayOneShot(MenuDown);
            Camera.main.audio.PlayDelayed(1.3f);
            MenuBox menu = child.gameObject.GetComponent<MenuBox>();
            if(!menu.clicked) {

                menu.SetMenuOption(currentMenu.Children[j-1]);
                menu.index = j;
                iTween.MoveTo(child.gameObject, iTween.Hash("y", -30,
                                                  "time", 1,
                                                  "delay", j*0.1,
                                                  "onstart", "ToggleMoving",
                                                  "oncomplete", "MoveBack",
                                                  "oncompleteparams", 1,
                                                  "islocal", true));
                j++;
            }
        }
    }
Example #20
0
        /// <summary>
        /// set navigation while a major menu is already open
        /// usually for confirmation dialogs
        /// </summary>
        public void ShowSubMenu(int index)
        {
            if (index >= 0 && index < gameMenuList.Length)
            {
                currentMenu = gameMenuList[index];
                currentMenu.MenuObject.SetActive(true);
                if (currentMenu.MenuCodeName == GameMenuCodeName.SettingsMenu && optionsMenu is OptionsMenu)
                {
                    optionsMenu.ShowOptionsMenu();
                }

                if (index == 0)
                {
                    currentMenuButtonIndex = previousIndex;
                    previousIndex          = currentMenu.defaultButtonIndex;
                    CurrentMenuButton      = currentMenu.buttons[currentMenuButtonIndex];
                }
                else
                {
                    previousIndex = currentMenuButtonIndex;
                    StartAtDefaultButton();
                }
            }
            else
            {
                Debug.LogWarning("not a valid sub menu index number");
            }
        }
Example #21
0
    void SaveWindow(int id)
    {
        Rect position = GetInnerWindowRect(modalWindowRect);

        tempSaveName = GUI.TextField(GetRect(ref position, kButtonHeight, kSpacing), tempSaveName);

        Rect buttonsRect = GetRect(ref position, kButtonHeight, 0);

        if (GUI.Button(new Rect(buttonsRect.xMax - 204, buttonsRect.y, 100, buttonsRect.height), "Cancel"))
        {
            menu = MenuOption.None;
        }

        if (GUI.Button(new Rect(buttonsRect.xMax - 100, buttonsRect.y, 100, buttonsRect.height), "Save"))
        {
            puzzle.name = tempSaveName;

            string     filename = folder + puzzle.name + ".txt";
            TextWriter writer   = new StreamWriter(filename);
            Puzzle.Serialize(puzzle, writer);
            writer.Close();

            menu = MenuOption.None;
        }
    }
Example #22
0
    /// <summary>Page's load event</summary>
    /// <param name="sender">Loaded page</param>
    /// <param name="e">Event's arguments</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        this.LtBuild.Text = ConfigurationManager.AppSettings["issusVersion"];
        if (this.Session["User"] == null)
        {
            this.Response.Redirect("Default.aspx", Constant.EndResponse);
            Context.ApplicationInstance.CompleteRequest();
        }

        this.Session["LastTime"] = DateTime.Now;
        this.navigation          = Session["Navigation"] as List <string>;

        this.ApplicationUser = Session["User"] as ApplicationUser;
        this.Company         = Session["Company"] as Company;
        this.Dictionary      = Session["Dictionary"] as Dictionary <string, string>;

        // Renew session
        //// ---------------------------------
        this.Session["User"]       = this.ApplicationUser;
        this.Session["Company"]    = this.Company;
        this.Session["Dictionary"] = this.Dictionary;
        //// ---------------------------------

        this.LeftMenu.Text += MenuOption.RenderMenu((ReadOnlyCollection <MenuOption>)Session["Menu"]);
        this.RenderShortCuts();

        var logo = Company.GetLogoFileName(this.Company.Id);

        this.ImgCompany.ImageUrl = string.Format("/images/Logos/{0}?ac={1}", logo, Guid.NewGuid());
        this.ImgCompany.Attributes.Add("height", "30");
        this.GetTasks();
        this.Alerts();
    }
Example #23
0
        public void Down(PlayerSelection playerSelection)
        {
            if (playerSelection == PlayerSelection.Player)
            {
                if (cooldown)
                {
                    return;
                }

                cooldown = true;
                switch (currentOption)
                {
                case MenuOption.OnePlayer:
                    currentOption = MenuOption.TwoPlayer;
                    break;

                case MenuOption.TwoPlayer:
                    currentOption = MenuOption.Exit;
                    break;

                case MenuOption.Exit:
                    // Does not change.
                    break;
                }
                SoundFactory.Instance.PlayFireballSound();
            }
        }
        public ActionResult GiaSalePage()
        {
            string     barcode    = Request.QueryString.Get("barcode");
            int        Idmenu     = 0;
            decimal    gia        = 0;
            decimal    giakm      = 0;
            MenuOption menuOption = _menuOptionRepository.Get(o => o.Barcode == barcode);
            // kiem tra barcode đó có khuyến mãi hay không
            PromotionDetail  HasSalePage = _promotionDetailRepository.CheckKhuyenMaiSalePage(barcode);
            GiaSalePageModel model       = new GiaSalePageModel();

            if (menuOption != null)
            {
                Idmenu = menuOption.IdMenu;
                Menu menu = _menuRepository.Get(o => o.id_ == Idmenu);
                if (HasSalePage != null)
                {
                    // co khuyen mai
                    giakm = HasSalePage.PriceDiscount;
                }
                gia   = Convert.ToInt32(menu.PricePro);
                model = new GiaSalePageModel()
                {
                    GiaKM       = giakm,
                    HasSalePage = HasSalePage,
                    Gia         = gia
                };
            }
            return(View("GiaSalepage", model));
        }
Example #25
0
        public void Navigate(MenuOption menuOption)
        {
            UserControl userControl = this.GetUserControl(menuOption);

            this.panel.Controls.Clear();
            this.panel.Controls.Add(userControl);
        }
Example #26
0
 protected void ChangeSelection(MenuOption option)
 {
     selectedOption = option;
     UI.MoveCurrentSelectionCursor(option.cursorSelectionTarget);
     AudioManager.instance.PlayFromLibrary(AudioLibrary.SoundTag.MenuMove);
     canMove = false;
 }
Example #27
0
    // When the navigation gesture is cleanly finished
    public override bool OnNavigationCompleted(InteractionSourceKind source, Vector3 relativePosition, Ray ray)
    {
        HideMenu();
        if (IsNavigating)
        {
            IsNavigating = false;
            //Select currently higlighted option and activate callback
            if (SelectedOption == null)
            {
                SelectedOption = GetSelectedOption(relativePosition);

                //If no option on selected position, gesture handled, but nothing shoul happen
                if (SelectedOption == null)
                {
                    return(true);
                }
            }
            SelectedOption.OptionAction(); // Perform action from this option (This does work for some reason)
            SelectedOption.RemoveHighlight();

            SelectedOption = null;
            return(true);
        }

        return(false);
    }
Example #28
0
        static void ShieldingExceptionsInWCF()
        {
            // You can run this example in one of three ways:
            // - Inside VS by starting it with F5 (debugging mode) and then pressing F5 again
            //   when the debugger halts at the exception in the SalaryCalculator class.
            // - Inside VS by right-clicking SalaryService.svc in Solution Explorer and selecting
            //   View in Browser to start the service, then pressing Ctrl-F5 (non-debugging mode)
            //   to run the application.
            // - By starting the SalaryService in VS (as in previous option) and then running the
            //   executable file ExceptionHandlingExample.exe in the bin\debug folder directly.

            try
            {
                Console.WriteLine("Getting salary for 'jsmith' from WCF Salary Service...");
                // Create an instance of the client for the WCF Salary Service.
                ISalaryService svc = new SalaryServiceClient();
                // Call the method of the service to get the result.
                Console.WriteLine("Result is: {0}", svc.GetWeeklySalary("jsmith", 0));
            }
            catch (Exception ex)
            {
                // Show details of the exception returned to the calling code.
                MenuOption.ShowExceptionDetails(ex);
                // Show details of the fault contract returned from the WCF service.
                ShowFaultContract(ex);
            }
        }
Example #29
0
    private void Update()
    {
        // Updates Selected Option when the player pushes one of the vertical Options.
        if (Input.GetButtonDown("Vertical") && !freezeArrow)
        {
            MoveArrow();
            if (horizontalSelect != null)
            {
                StopCoroutine(horizontalSelect);
            }
        }
        else if (Input.GetKeyDown(KeyCode.Space) || Input.GetKeyDown(KeyCode.Return))
        {
            menuSelector.LoadCurrentOption();
        }
        else if (Input.GetButtonDown("Horizontal"))
        {
            MenuOption currentOption = menuSelector.GetCurrentOption();
            if (currentOption is IMenuOptionHorizontalSelect currentOptionH)
            {
                if (horizontalSelect != null)
                {
                    StopCoroutine(horizontalSelect);
                }
                horizontalSelect = StartCoroutine(HorizontalSelectDAS(currentOptionH));
            }
        }

        Debug.Log(horizontalSelect);
    }
Example #30
0
    public void MenuOptionSelect(MenuOption theMenuOption)//List<KeyValuePair<MenuOptionType, Object>> menuEffects)
    {
        for (int i = 0; i < theMenuOption.MyMenuEffects.Count; i++)
        {
            switch (theMenuOption.MyMenuEffects[i].Key)
            {
            case MenuOptionType.LOADMENU:
                LoadNewMenu((theMenuOption.MyMenuEffects[i].Value as GameObject).GetComponent <Menu>());
                //Invoke("LoadNewMenu", );
                break;

            case MenuOptionType.LOADDIALOG:
                LoadDialog();
                _theMenuManager.CloseMenu();
                _theGameManager.CurrentInputType = InputType.DIALOG;
                //Invoke("LoadDialog", menuEffects[i].Value);
                break;

            case MenuOptionType.LOADANIM:
                //Invoke("CueAnimation", menuEffects[i].Value);
                break;

            case MenuOptionType.CHANGECAMERA:
                ChangeCamera(theMenuOption.LocationToMove);
                break;
            }
        }

        _theGameManager.CheckProgress(theMenuOption.MenuAction);
    }
Example #31
0
        private void ManageGameMenuForm(MenuOption option)
        {
            switch (option)
            {
            case MenuOption.Exit:
                //Stop();
                switchView(Views.ChatForm);
                break;
            //throw new NotImplementedException("System exit from " + actualView + ": " + option);

            case MenuOption.Options:
                switchView(Views.OptionsForm);
                ((MainMenuForm)(actualForm)).LastView = Views.GameMenuForm;
                break;

            case MenuOption.Ok:
                switchView(Views.GameForm, true);
                break;

            case MenuOption.Pause:
                switchView(Views.PauseForm);
                break;

            default:
                throw new NotImplementedException("bad option from " + actualView + ": " + option);
            }
        }
Example #32
0
        static void Main(string[] args)
        {
            Bank bank = new Bank();

            do
            {
                MenuOption chosen = ReadUserOption();
                switch (chosen)
                {
                case MenuOption.CreateAccount:
                    CreateAccount(bank); break;

                case MenuOption.Withdraw:
                    DoWithdraw(bank); break;

                case MenuOption.Deposit:
                    DoDeposit(bank); break;

                case MenuOption.Transfer:
                    DoTransfer(bank); break;

                case MenuOption.Print:
                    DoPrint(bank); break;

                case MenuOption.Quit:
                default:
                    Console.WriteLine("Goodbye");
                    System.Environment.Exit(0); // terminates the program
                    break;                      // unreachable
                }
            } while (true);
        }
Example #33
0
        private void ManageOptionsForm(MenuOption option)
        {
            switch (option)
            {
            case MenuOption.CancelToGameMenu:
                switchView(Views.GameMenuForm);
                break;

            case MenuOption.Cancel:
                switchView(Views.MainMenuForm);
                break;

            case MenuOption.CancelToPauseMenu:
                switchView(Views.PauseForm);
                break;

            case MenuOption.OkToGameMenu:
                switchView(Views.GameMenuForm);
                break;

            case MenuOption.Ok:
                switchView(Views.MainMenuForm);
                break;

            case MenuOption.OkToPauseMenu:
                switchView(Views.PauseForm);
                break;

            default:
                throw new NotImplementedException("bad option from " + actualView + ": " + option);
            }
        }
Example #34
0
 public Banking()
 {
     Menu = new MenuOption[] {
         new MenuOption("Listing", "/banking/default.html"),
         new MenuOption("Names", "/banking/names.html"),
         new MenuOption("New Account", "/banking/detail.html?id=0")
     };
 }
Example #35
0
 public Company()
 {
     Menu = new MenuOption[] {
         new MenuOption("Summary", "/company/default.html"),
         new MenuOption("To Do", "/company/schedule.html"),
         new MenuOption("New To Do", "/company/job.html?id=0")
     };
 }
Example #36
0
 public Investments()
 {
     Menu = new MenuOption[] {
         new MenuOption("Listing", "/investments/default.html"),
         new MenuOption("Securities", "/investments/securities.html"),
         new MenuOption("New Account", "/investments/detail.html?id=0")
     };
 }
Example #37
0
 public void Update()
 {
     MenuOption newselected = md.GetSelectedOption();
     if(newselected != selected){
         selected = newselected;
         buttonText.text = selected.GetButtonText();
     }
 }
Example #38
0
        public void Selected(MenuOption item)
        {
            master.IsPresented = false; // close the slide-out

            switch (item)
            {
                case MenuOption.Home:
                    master.Detail = home ??
                    (home = new NavigationPage(
                        new ContentPage
                        {
                            Title = "Home",
                            Content = new Label { Text = "Home", Font = Font.SystemFontOfSize(40), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }
                        })
                    );
                    break;
                case MenuOption.Profile:
                    master.Detail = profile ??
                    (profile = new NavigationPage(
                        new ContentPage
                        {
                            Title = "Profile",
                            Content = new Label { Text = "Profile", Font = Font.SystemFontOfSize(40), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }
                        })
                    );
                    break;
                case MenuOption.Add_new:
                    master.Detail = addNew ??
                    (addNew = new NavigationPage(
                        new ContentPage
                        {
                            Title = "Add New",
                            Content = new Label { Text = "Add new", Font = Font.SystemFontOfSize(40), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }
                        })
                    );
                    break;
                case MenuOption.Favorites:
                    master.Detail = Favorites ??
                        (Favorites = new NavigationPage(
                            new ContentPage
                            {
                                Title = "Favotites",
                                Content = new Label { Text = "Favorites", Font = Font.SystemFontOfSize(40), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }
                            }));
                    break;
                case MenuOption.Exit:
                    Device.BeginInvokeOnMainThread(async () =>
                    {
                        var result = await this.DisplayAlert("Alert!", "Do you really want to exist?", "Yes", "No");
                        if (result) Android.OS.Process.KillProcess(Android.OS.Process.MyPid());  
                    });
                    break;




            }
        }
Example #39
0
 public Admin()
 {
     Menu = new MenuOption[] {
         new MenuOption("Settings", "/admin/default.html"),
         new MenuOption("Integrity Check", "/admin/integritycheck.html"),
         new MenuOption("Import", "/admin/import.html"),
         new MenuOption("Backup", "/admin/backup.html"),
         new MenuOption("Restore", "/admin/restore.html")
     };
 }
    void OnMouseUp()
    {
        // MAIN MENU

        if (menuOption == MenuOption.MENU_CONTINUE)
        {
            //Application.LoadLevel(LastCheckpoint);
            GetComponent<Renderer>().material.color = Color.green;
            lastOption = menuOption;
        }
        if (menuOption == MenuOption.MENU_NEW_GAME)
        {
            Application.LoadLevel(1);
            GetComponent<Renderer>().material.color = Color.green;
            lastOption = menuOption;
        }

        if (menuOption == MenuOption.MENU_OPTION)
        {
            // Application.LoadLevel(2);
            mainMenuText.SetActive(false);
            optionsText.SetActive(true);
            GetComponent<Renderer>().material.color = Color.green;
            lastOption = menuOption;
        }

        if (menuOption == MenuOption.MENU_CREDITS)
        {
            // Application.LoadLevel(3);
            GetComponent<Renderer>().material.color = Color.green;
            lastOption = menuOption;
        }

        if (menuOption == MenuOption.MENU_QUIT)
        {
            Application.Quit();
            GetComponent<Renderer>().material.color = Color.green;
            lastOption = menuOption;
        }
        /////////////////////////////////////////////////////////////

        // OPTIONS


        if (menuOption == MenuOption.MENU_BACK)
        {
            optionsText.SetActive(false);
            mainMenuText.SetActive(true);
            GetComponent<Renderer>().material.color = Color.green;
            lastOption = menuOption;
        }
    }
Example #41
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            MainPanorama.Title = IsolatedStorageSettings.ApplicationSettings["CurrentConvention"];
            MenuOption option1 = new MenuOption("events by day", "/View/SchedulePivotView.xaml?PivotOn=Day");
            MenuOption option2 = new MenuOption("events by location", "/View/SchedulePivotView.xaml?PivotOn=Location");
            MenuOption option4 = new MenuOption("my schedule", "/View/SchedulePivotView.xaml?PivotOn=Stars");
            MenuOption option5 = new MenuOption("search", "/View/SchedulePivotView.xaml?PivotOn=Search");
            MenuOption expo = new MenuOption("exhibitor list", "/View/SchedulePivotView.xaml?PivotOn=Expo");

            menuOptions = new ObservableCollection<MenuOption>{option1, option2, option4, option5, expo};
            scheduleMenu.ItemsSource = menuOptions;
        }
 public CustomerSupplier(string nameType, Acct ledgerAccount, DocType invoiceDoc, DocType creditDoc, DocType paymentDoc)
 {
     NameType = nameType;
     Name = NameType.NameType();
     LedgerAccount = ledgerAccount;
     InvoiceDoc = invoiceDoc;
     CreditDoc = creditDoc;
     PaymentDoc = paymentDoc;
     string module = nameType == "C" ? "/customer/" : "/supplier/";
     Menu = new MenuOption[] {
         new MenuOption("Listing", module + "default.html"),
         new MenuOption("VAT codes", module + "vatcodes.html"),
         new MenuOption("New " + Name, module + "detail.html?id=0"),
         new MenuOption("New " + InvoiceDoc.UnCamel(), module + "document.html?id=0&type=" + (int)InvoiceDoc),
         new MenuOption("New " + CreditDoc.UnCamel(), module + "document.html?id=0&type=" + (int)CreditDoc),
         new MenuOption("New " + PaymentDoc.UnCamel(), module + "payment.html?id=0")
     };
 }
        public StartScreen()
        {
            title = "Login or create account";

            options = new List<MenuOption>();
            MenuOption login = new MenuOption("Login");
            login.Highlighted = true;
            login.OptionSelected += LoginSelected;

            MenuOption createAcct = new MenuOption("Create Account");
            createAcct.OptionSelected += CreateAccountSelected;

            options.Add(login);
            options.Add(createAcct);

            CalculateWindowSize();
            CalculateWindowPosition();

            textXPos = menuXPos + 2;
        }
Example #44
0
        public MainMenu()
        {
            title = "Main Menu";

            options = new List<MenuOption>();

            MenuOption buy = new MenuOption("Buy Stocks");
            buy.OptionSelected += BuySelected;
            buy.Highlighted = true;

            MenuOption sell = new MenuOption("Sell Stocks");
            sell.OptionSelected += SellSelected;

            MenuOption lookup = new MenuOption("Lookup Stock");
            lookup.OptionSelected += LookupSelected;

            MenuOption compare = new MenuOption("Compare Stocks");
            compare.OptionSelected += CompareSelected;

            MenuOption viewPortfolio = new MenuOption("View Portfolio");
            viewPortfolio.OptionSelected += PortfolioSelected;

            MenuOption goBack = new MenuOption("Go Back");
            goBack.OptionSelected += GoBackSelected;

            options.Add(buy);
            options.Add(sell);
            options.Add(lookup);
            options.Add(compare);
            options.Add(viewPortfolio);
            options.Add(goBack);

            CalculateWindowSize();
            CalculateWindowPosition();

            textXPos = menuXPos + 2;
        }
Example #45
0
        private void AddMenuOption(MenuOption menuOption)
        {
            if (menuOption == null)
                return;

            try
            {
                MenuOptionByRol relation = new MenuOptionByRol                             
                {
                    Rol = View.Model.Record,
                    MenuOption = menuOption,
                    Company = App.curCompany,
                    //ModDate = DateTime.Today,
                    //ModifiedBy = App.curUser.UserName,
                    Status = new Status{ StatusID = EntityStatus.Active },
                    CreatedBy = App.curUser.UserName,
                    CreationDate = DateTime.Today                    
                };

                relation = service.SaveMenuOptionByRol(relation);

                if (View.Model.AssignPermission == null)
                    View.Model.AssignPermission = new List<MenuOptionByRol>();

                View.Model.AssignPermission.Insert(0, relation);

                View.Model.AvailablePermission.Remove(menuOption);
            }
            catch (Exception ex)
            {
                throw ex;
            }

        }
        public void AddMenuOption(MenuOption menuOption)
        {
            Debug.Assert(menuOption != null, "Menu option cannot be added if null!");

            // Add menu option
            if ( menuOption != null )
                m_MenuOptions.Add(menuOption);
        }
 public MenuOption(string title, MenuOption parent, MenuOption[] children)
 {
     this.Title = title;
     this.Parent = parent;
     this.Children = children;
 }
        public void AddItemWithOptions(int menuId, int optionId, ref BxCartItem cartItem)
        {
            if (cartItem == null || optionId <= 0)
                return;

            var menuItemToAddOptionsOn = cartItem.Product.GetMenuItem(menuId);
            if (menuItemToAddOptionsOn == null)
            {
                AddMenuItemOnToExistedDeal(cartItem.CartId, menuId, 0);
                menuItemToAddOptionsOn = cartItem.Product.GetMenuItem(menuId);
            }

            var optDetail = new MenuOption(menuId, optionId);
            optDetail.Load(IsDeliveryOrder);

            // Check the limitation of number of items to be added
            IsErrorMessage = false;
            int allowedItems = optDetail.GetAllowedItems(optDetail.ParentId);
            if ((allowedItems != 0))
            {
                if (menuItemToAddOptionsOn.CountOfMenuOptions(optDetail.ParentId) == allowedItems)
                {
                    IsErrorMessage = true;
                    Message = "You can add only " + allowedItems + " options to this item";
                    return;
                }
            }

            if (!menuItemToAddOptionsOn.Contains(optDetail))
            {
                //cartItem.Product.Items.Add(optDetail);
                menuItemToAddOptionsOn.Items.Add(optDetail);
                Message = "An item has been added to your basket!";
            }
        }
Example #49
0
 protected BaseMenuPrompt(MenuOption[] options, bool foradmin = false)
 {
     AdminOnly = foradmin;
     _options = options;
 }
        public override void HandleInput(InputState input)
        {
            //This needs to be check for values in whichOne and allowContinue because for some reason the menutemplate is not what it's suppossed to be.
            //The menu template should have a blocked out continue and the menu should not allow for continue selection if there was nothing loaded

            if (input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.DPadDown) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.DPadDown) == true ||
                input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.LeftThumbstickDown) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.LeftThumbstickDown) == true)
            {
                if (whichOne == 0)
                {
                    menuOption++;
                    menuSelectPosition += new Vector2(0, 180);

                    if (menuOption > MenuOption.Credits)
                    {
                        menuOption = 0;
                        menuSelectPosition = new Vector2(100.0f);
                    }
                }
                else
                {
                    if (allowContinue)
                    {
                        startOption++;
                        menuSelectPosition += new Vector2(0, 180);

                        if (startOption > StartOption.Continue)
                        {
                            startOption = 0;
                            menuSelectPosition = new Vector2(100.0f);
                        }
                    }
                }
            }
            if (input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.DPadUp) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.DPadUp) == true ||
                input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.LeftThumbstickUp) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.LeftThumbstickUp) == true)
            {
                if (whichOne == 0)
                {
                    menuOption--;
                    menuSelectPosition -= new Vector2(0, 180);

                    if (menuOption < 0)
                    {
                        menuOption = MenuOption.Credits;
                        menuSelectPosition = new Vector2(0, 540);
                    }
                }
                else
                {
                    if (allowContinue)
                    {
                        startOption--;
                        menuSelectPosition -= new Vector2(0, 180);

                        if (startOption < 0)
                        {
                            startOption = StartOption.Continue;
                            menuSelectPosition = new Vector2(0, 540);
                        }
                    }
                }

            }
            if (input.CurrentGamePadStates[(int)gamerOne.PlayerIndex].IsButtonDown(Buttons.A) == true && input.PreviousGamePadStates[(int)gamerOne.PlayerIndex].IsButtonUp(Buttons.A) == true)
            {
                if (whichOne == 0)
                {
                    if (menuOption == MenuOption.Start)
                    {

                        //LoadingScreen.Load(ScreenManager, false, ControllingPlayer, new DifferentMenuScreen());
                        //reset the position of the rectangle
                        menuSelectPosition = new Vector2(100.0f);

                        //which menuTemplate to use
                        whichOne++;
                        if (allowContinue)
                        {
                            whichOne++;
                        }
                        return;
                    }

                    else if (menuOption == MenuOption.Gallery)
                    {

                        //TODO:
                    }
                    else if (menuOption == MenuOption.Credits)
                    {
                        //TODO:
                    }
                }
                if (whichOne == 1)
                {
                    if (startOption == StartOption.NewGame)
                    {
                        GamePlayScreen.storageDevice = storageDevice;

                        LoadingScreen.Load(ScreenManager, true, gamerOne.PlayerIndex, new LevelOne(gamerOne));
                        //load up a new game

                    }

                    if (startOption == StartOption.Continue)
                    {
                        if (gamerOne != null)
                        {
                            gameLoadRequested = true;
                            resultCheck = StorageDevice.BeginShowSelector(gamerOne.PlayerIndex, null, null);
                        }

                    }
                }

            }
        }
 // Use this for initialization
 void Start()
 {
     currentSelection = options [0];
     currentSelection.OnCursorOver();
 }
Example #52
0
 public DataSet GetReportObject(MenuOption data, IList<String> rpParam, Location location)
 {
     try
     {
         SetService(); return 
         SerClient.GetReportObject(data, rpParam.ToList(), location);
     }
     finally
     {
         SerClient.Close();
         if (SerClient.State == CommunicationState.Faulted)
             SerClient.Abort();
     }
 }
 public void SetMenuOption(MenuOption mo)
 {
     menuOption = mo;
 }
Example #54
0
 public void DeleteMenuOption(MenuOption data)
 {
     try {
     SetService();  SerClient.DeleteMenuOption(data); }
     finally
     {
         SerClient.Close();
         if (SerClient.State == CommunicationState.Faulted)
         SerClient.Abort(); 
     }
 }
Example #55
0
 public Menu(MenuOption option)
 {
     Option = option;
 }
Example #56
0
 public MenuOption SaveMenuOption(MenuOption data)
 {
     try {
     SetService();  return SerClient.SaveMenuOption(data); }
     finally
     {
         SerClient.Close();
         if (SerClient.State == CommunicationState.Faulted)
         SerClient.Abort(); 
     }
 }
Example #57
0
 public void Update()
 {
     MenuOption newselected = md.GetSelectedOption();
     if (newselected != selected)
     {
         selected = newselected;
     }
 }
Example #58
0
 public override void ModMenuAction(TehModAPI api, MenuOption opt)
 {
     if (!toolkit.IsInGame() || Main.netMode != 0) return;
     try
     {
         switch (opt.action)
         {
             case "addSnow":
                 WriteSnow();
                 UpdateFrames();
                 break;
             case "convertSnow":
                 bool doet;
                 if (ConfirmAction.TryGetValue("convertSnow", out doet))
                 {
                     ConfirmAction.Remove("convertSnow");
                     OverwriteSnow();
                     UpdateFrames();
                 }
                 else
                 {
                     Main.NewText("Please click the button again to confirm that you want to do this.", 255, 0, 0);
                     ConfirmAction.Add("convertSnow", false);
                 }
                 break;
             case "convertWorldSnow":
                 if (ConfirmAction.TryGetValue("convertWorldSnow", out doet))
                 {
                     ConfirmAction.Remove("convertWorldSnow");
                     OverwriteSnowTotal();
                     UpdateFrames();
                 }
                 else
                 {
                     Main.NewText("Please click the button again to confirm that you want to do this.", 255, 0, 0);
                     ConfirmAction.Add("convertWorldSnow", false);
                 }
                 break;
             case "exitNoSave":
                 QuitGame();
                 break;
             case "addDungeon":
                 WorldGen.MakeDungeon((int) (toolkit.GetPlayer().position.X/16), (int) (toolkit.GetPlayer().position.Y/16));
                 UpdateFrames();
                 Main.NewText("Made a dungeon.");
                 break;
             case "addHell":
                 WorldGen.HellHouse((int) (toolkit.GetPlayer().position.X/16), (int) (toolkit.GetPlayer().position.Y/16));
                 UpdateFrames();
                 Main.NewText("Made a hell house.");
                 break;
             case "addIsland":
                 WorldGen.FloatingIsland((int) (toolkit.GetPlayer().position.X/16), (int) (toolkit.GetPlayer().position.Y/16));
                 UpdateFrames();
                 Main.NewText("Made a floating island.");
                 break;
             case "addIslandHouse":
                 WorldGen.IslandHouse((int) (toolkit.GetPlayer().position.X/16), (int) (toolkit.GetPlayer().position.Y/16));
                 UpdateFrames();
                 Main.NewText("Made a floating island house.");
                 break;
             case "addMineHouse":
                 WorldGen.MineHouse((int) (toolkit.GetPlayer().position.X/16), (int) (toolkit.GetPlayer().position.Y/16));
                 UpdateFrames();
                 Main.NewText("Made a mine house.");
                 break;
             case "startHm":
                 WorldGen.StartHardmode();
                 break;
             case "startHm2":
                 Main.hardMode = true;
                 Main.NewText("Enabled hardmode.");
                 break;
             case "stopHm":
                 Main.hardMode = false;
                 Main.NewText("Disabled hardmode.");
                 break;
             case "convertCorruption":
                 ConvertCorruption();
                 UpdateFrames();
                 break;
             case "convertHallow":
                 ConvertHallow();
                 UpdateFrames();
                 break;
             case "convertCorruptionNormal":
                 ConvertCorruptionNormal();
                 UpdateFrames();
                 break;
             case "convertHallowNormal":
                 ConvertHallowNormal();
                 UpdateFrames();
                 break;
             case "startGoblin":
                 Main.StartInvasion();
                 Main.NewText("Started a goblin invasion.");
                 break;
             case "startFrost":
                 Main.StartInvasion(2);
                 Main.NewText("Started a Frost Legion invasion.");
                 break;
             case "stopInvade":
                 Main.invasionSize = 0;
                 Main.NewText("Invasion has been stopped.");
                 break;
             case "xMas":
                 Main.xMas = xMas;
                 break;
         }
     }
     catch (Exception e)
     {
         Main.NewText("ERROR: " + e.Message, 255, 0, 0);
     }
 }