protected void Page_Load(object sender, EventArgs e) { GridMenu.DataSource = Burgerconn.Menus.ToList(); GridMenu.DataBind(); GridOrder.DataSource = Burgerconn.Orders.ToList(); GridOrder.DataBind(); }
public GameObject flag; // a reference to the flag; only used if this unit has the flag // Use this for initialization protected virtual void Start() { contextMenu = GetComponent <ContextMenu>(); grid = FindObjectOfType <GridMenu>(); //FindGridElement(); unitType = UnitType.Unit; }
protected void ordercomplete_Click(object sender, EventArgs e) { objburger.Orderemove(Convert.ToInt32(burgerid.Text)); GridMenu.DataSource = Burgerconn.Menus.ToList(); GridMenu.DataBind(); GridOrder.DataSource = Burgerconn.Orders.ToList(); GridOrder.DataBind(); orderup = 0; }
protected void orderupdate_Click(object sender, EventArgs e) { objburger.OrderUpdate(Convert.ToInt32(burgerid.Text), BurgerName.Text, Order1.Text, Order2.Text, Order3.Text, OrderMobile.Text); GridMenu.DataSource = Burgerconn.Menus.ToList(); GridMenu.DataBind(); GridOrder.DataSource = Burgerconn.Orders.ToList(); GridOrder.DataBind(); orderup = 0; }
protected void Ordertake_Click(object sender, EventArgs e) { objburger.TAkeorder(BurgerName.Text, Order1.Text, Order2.Text, Order3.Text, OrderMobile.Text); GridMenu.DataSource = Burgerconn.Menus.ToList(); GridMenu.DataBind(); GridOrder.DataSource = Burgerconn.Orders.ToList(); GridOrder.DataBind(); orderup = 0; }
// Use this for initialization void Start() { unitPool = new ObjectPool(unitPrefab, false, 1, transform); pusherPool = new ObjectPool(pusherPrefab, false, 1, transform); pullerPool = new ObjectPool(pullerPrefab, false, 1, transform); twisterPool = new ObjectPool(twisterPrefab, false, 1, transform); portalPlacerPool = new ObjectPool(portalPlacerPrefab, false, 1, transform); grid = FindObjectOfType <GridMenu>(); }
protected void IniGrid() { Maticsoft.BLL.tAbout BLL = new Maticsoft.BLL.tAbout(); DataTable table = null; table = BLL.GetList(" Id >0 order by Sort desc").Tables[0]; GridMenu.DataSource = table; GridMenu.DataBind(); }
public void Cancel() { if (prevMenu.GetComponent <Menu>() is GridMenu) { GridMenu gm = prevMenu.GetComponent <GridMenu>(); gm.activeGO = null; gm.SetElementColor(gm.selectedGO, selectedColor, defaultColor); HideContextMenu(); } }
private async Task ManageMenuVisibility() { if (GridMenu.TranslationY == 0) { await Task.WhenAll(GridMenu.TranslateTo(0, 215), BvMenuVisibility.FadeTo(0)); BvMenuVisibility.IsVisible = false; } else { BvMenuVisibility.IsVisible = true; await Task.WhenAll(GridMenu.TranslateTo(0, 0), BvMenuVisibility.FadeTo(0.5)); } }
protected void IniGrid() { Maticsoft.BLL.tArticleType BLL = new Maticsoft.BLL.tArticleType(); DataTable table = null; if (ddlfatherId.SelectedValue == "") { table = BLL.GetList(" Id >0 order by FatherID,Sort desc").Tables[0]; } else { table = BLL.GetList(string.Format(" FatherID={0} order by FatherID, Sort desc", ddlfatherId.SelectedValue)).Tables[0]; } GridMenu.DataSource = table; GridMenu.DataBind(); }
public void SQLconnections(string veg, string nonveg, string query, string Address) { using (SqlConnection connection = new SqlConnection(Address)) { //Selects query accourding to conditions using (SqlCommand menuCmd = new SqlCommand(query)) { menuCmd.CommandType = CommandType.Text; menuCmd.Connection = connection; connection.Open(); menuCmd.Parameters.AddWithValue("@Rest", LblName.Text); SqlDataReader ReadFromTable = menuCmd.ExecuteReader(); GridMenu.DataSource = ReadFromTable; GridMenu.DataBind(); } } }
// TO-DO - MAKE MENU HANDLE THINGS BEING LOCKED private void Start() { gridMenu = FindObjectOfType <GridMenu>(); if (buttonType != ButtonTypeEnum.None) { gameObject.GetComponent <Button>().onClick.RemoveAllListeners(); } switch (buttonType) { case ButtonTypeEnum.SpawnUnit: gameObject.GetComponent <Button>().onClick.AddListener(delegate { gridMenu.PlaceUnit("unit"); }); break; case ButtonTypeEnum.SpawnPusher: gameObject.GetComponent <Button>().onClick.AddListener(delegate { gridMenu.PlaceUnit("pusher"); }); break; case ButtonTypeEnum.SpawnPuller: gameObject.GetComponent <Button>().onClick.AddListener(delegate { gridMenu.PlaceUnit("puller"); }); break; case ButtonTypeEnum.SpawnTwister: gameObject.GetComponent <Button>().onClick.AddListener(delegate { gridMenu.PlaceUnit("twister"); }); break; case ButtonTypeEnum.SpawnPortalPlacer: gameObject.GetComponent <Button>().onClick.AddListener(delegate { gridMenu.PlaceUnit("portalPlacer"); }); break; case ButtonTypeEnum.Move: gameObject.GetComponent <Button>().onClick.AddListener(delegate { GetComponentInParent <Unit>().DisplayMoveGrid(); }); break; case ButtonTypeEnum.Push: gameObject.GetComponent <Button>().onClick.AddListener(delegate { GetComponentInParent <Pusher>().DisplayActionGrid(); }); break; case ButtonTypeEnum.Pull: gameObject.GetComponent <Button>().onClick.AddListener(delegate { GetComponentInParent <Puller>().DisplayActionGrid(); }); break; case ButtonTypeEnum.Twist: gameObject.GetComponent <Button>().onClick.AddListener(delegate { GetComponentInParent <Twister>().DisplayActionGrid(); }); break; } }
private void GridMenu_ItemSelectedHandler(object sender, EventArgs e) { if (GridMenu.SelectedItem != null) { if (GridMenu.SelectedItem.IsSelected) { return; } Redirect(GridMenu.SelectedItem.MenuType); foreach (var mi in _model.MenuItems) { mi.IsSelected = false; mi.TextStyle = _model.DefaultStyle; } var menu = _model.MenuItems.Find(t => t.MenuType == GridMenu.SelectedItem.MenuType); menu.IsSelected = true; menu.TextStyle = _model.SelectedStyle; GridMenu.Source = _model.MenuItems; GridMenu.Rebind(sender, _model.MenuItems); } }
private async void MenuListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { int index = MenuListView.SelectedIndex; if (index == -1) { return; } if (GridMenu.Width != 60) { OpenMenuButton.Visibility = Visibility.Visible; UserInfo.Visibility = CloseMenuButton.Visibility = Visibility.Collapsed; DoubleAnimation buttonAnimation = new DoubleAnimation { From = GridMenu.ActualWidth, To = 60, Duration = TimeSpan.FromSeconds(0.2), FillBehavior = FillBehavior.Stop }; GridMenu.BeginAnimation(Button.WidthProperty, buttonAnimation); Storyboard sb = new Storyboard(); ThicknessAnimation commGridAnimation = new ThicknessAnimation { From = new Thickness(200, 0, 0, 0), To = new Thickness(0, 0, 0, 0), FillBehavior = FillBehavior.Stop, Duration = TimeSpan.FromSeconds(0.3) }; Storyboard.SetTarget(commGridAnimation, ContentGrid); Storyboard.SetTargetProperty(commGridAnimation, new PropertyPath(MarginProperty)); sb.Children.Add(commGridAnimation); sb.Begin(); } switch (index) { case 0: ContentGrid.Children.Clear(); ContentGrid.Children.Add(new MyAccount(user)); break; case 1: MyBooks myBooks = new MyBooks(); ProgressBar1.Visibility = Visibility.Visible; using (SqlConnection con2 = new SqlConnection(ConnectionString)) { con2.Open(); string sqlExpression = "select id_book from Book_" + user.username; SqlCommand command = new SqlCommand(sqlExpression, con2); SqlDataReader reader = command.ExecuteReader(); List <int> id_list = new List <int>(); if (reader.HasRows) { while (reader.Read()) { id_list.Add(Convert.ToInt32(reader.GetValue(0))); } } reader.Close(); if (id_list.Count() != 0) { List <Book> Spisok = await Task.Run(() => Founder(library.MyBooks)); for (int i = 0; i < id_list.Count; i++) { var spc = from n in Spisok where n.Id == id_list[i] select n; foreach (Book n in spc) { myBooks.MyBookWrapPanel.Children.Add(new MyBookItem(n)); } } ContentGrid.Children.Clear(); ContentGrid.Children.Add(myBooks); } else { Empty.IsOpen = true; } ProgressBar1.Visibility = Visibility.Collapsed; } break; case 2: SearchBooks searchBooks = new SearchBooks(); ProgressBar1.Visibility = Visibility.Visible; List <Book> Res = await Task.Run(() => Founder(library.MyBooks)); ProgressBar1.Visibility = Visibility.Collapsed; foreach (Book n in Res) { searchBooks.ListBookWrapPanel.Children.Add(new BookItem(n)); } ContentGrid.Children.Clear(); ContentGrid.Children.Add(searchBooks); break; case 3: ContentGrid.Children.Clear(); ContentGrid.Children.Add(new AddNewBookAdmin()); break; } }
public void SetLocation(GameObject newLoc) { transform.position = newLoc.transform.TransformPoint(Vector3.zero) + Vector3.forward * gameObject.transform.position.z; if (flag) { flag.transform.position = newLoc.transform.TransformPoint(Vector3.zero) + Vector3.forward * flag.transform.position.z; flag.GetComponent <GamePiece>().gridElement = newLoc.GetComponent <GridElement>(); if (newLoc.GetComponent <GridElement>().goal) { grid.gameMan.EndLevel(); } } // Check if gridElement has been assigned (this is for spawning) if (!gridElement) { if (!FindGridElement()) { Debug.Log(gridElement.piece); } } // Handle Collisions; We're assuming newLoc always has a GridElement GridElement otherGE = newLoc.GetComponent <GridElement>(); if (otherGE && otherGE.piece && otherGE.piece != gameObject) { //Debug.Log("Collided with: " + otherGE.piece.name); // Check to make sure we're working with a unit if (otherGE.piece.GetComponent <GamePiece>() is Unit) { Unit otherUnit = otherGE.piece.GetComponent <Unit>(); otherUnit.owner.GetComponent <Player>().ReturnUnit(otherGE.piece); if (otherUnit.unitType == UnitType.Portalist) { otherUnit.GetComponent <PortalPlacer>().PlacePortal(otherGE); } otherGE.piece = null; // check to see if the other piece has the flag if (otherUnit.flag) { otherGE.piece = otherUnit.flag; flag = null; } // make sure you don't have the flag if (flag) { otherGE.piece = flag; flag.GetComponent <GamePiece>().gridElement = otherGE; flag = null; } // Don't forget to kill yourself owner.GetComponent <Player>().ReturnUnit(gameObject); if (unitType == UnitType.Portalist) { this.GetComponent <PortalPlacer>().PlacePortal(otherGE); } gridElement.piece = null; return; } else { // Check for flag if (otherGE.piece.GetComponent <GamePiece>() is Flag) { flag = otherGE.piece; canAct = false; remainingMoves = 0; } else if (otherGE.piece.GetComponent <GamePiece>() is Trap) { if (unitType == UnitType.Portalist) { this.GetComponent <PortalPlacer>().PlacePortal(otherGE); } if (gridElement.piece == gameObject) { gridElement.piece = null; } if (!grid) { grid = FindObjectOfType <GridMenu>(); } owner.GetComponent <Player>().ReturnUnit(gameObject); if (flag) // flags will destroy traps; currently no piece can destroy traps, // so if a flag lands on one, it must either destroy the trap or the game is unwinnable // it may be better to have traps pull/pushable, while the flag remains aloof. This would // prevent the need to destroy the trap { Destroy(otherGE.piece); otherGE.piece = flag; flag.GetComponent <GamePiece>().gridElement = otherGE; flag = null; } return; } } } gridElement.piece = null; gridElement = newLoc.GetComponent <GridElement>(); gridElement.piece = gameObject; if (flag) { flag.GetComponent <GamePiece>().gridElement = gridElement; if (gridElement.goal) { // Player has moved the flag into the goal! // Someone should probably contact the gamemanager grid.gameMan.EndLevel(); grid.activeUIMenu = false; } } if (!grid) { grid = FindObjectOfType <GridMenu>(); } grid.UpdateDescription(); }
public static void UpdateWallSprite(GameObject GO) { GridMenu grid = FindObjectOfType <GridMenu>(); GridElement element = GO.GetComponent <GridElement>(); if (element.northWall && element.eastWall && element.southWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.FourWalls; } else if (element.northWall && element.eastWall && element.southWall) { GO.GetComponent <Image>().sprite = grid.ThreeWalls; GO.transform.rotation = Quaternion.Euler(0, 0, -90); } else if (element.northWall && element.eastWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.ThreeWalls; } else if (element.northWall && element.southWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.ThreeWalls; GO.transform.rotation = Quaternion.Euler(0, 0, 90); } else if (element.eastWall && element.southWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.ThreeWalls; GO.transform.rotation = Quaternion.Euler(0, 0, 180); } else if (element.northWall && element.eastWall) { GO.GetComponent <Image>().sprite = grid.TwoWallsL; GO.transform.rotation = Quaternion.Euler(0, 0, -90); } else if (element.northWall && element.southWall) { GO.GetComponent <Image>().sprite = grid.TwoWallsHall; GO.transform.rotation = Quaternion.Euler(0, 0, 90); } else if (element.northWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.TwoWallsL; } else if (element.eastWall && element.southWall) { GO.GetComponent <Image>().sprite = grid.TwoWallsL; GO.transform.rotation = Quaternion.Euler(0, 0, 180); } else if (element.eastWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.TwoWallsHall; } else if (element.southWall && element.westWall) { GO.GetComponent <Image>().sprite = grid.TwoWallsL; GO.transform.rotation = Quaternion.Euler(0, 0, 90); } else if (element.northWall) { GO.GetComponent <Image>().sprite = grid.OneWall; GO.transform.rotation = Quaternion.Euler(0, 0, -90); } else if (element.eastWall) { GO.GetComponent <Image>().sprite = grid.OneWall; GO.transform.rotation = Quaternion.Euler(0, 0, 180); } else if (element.southWall) { GO.GetComponent <Image>().sprite = grid.OneWall; GO.transform.rotation = Quaternion.Euler(0, 0, 90); } else if (element.westWall) { GO.GetComponent <Image>().sprite = grid.OneWall; } else { GO.GetComponent <Image>().sprite = grid.NoWalls; GO.transform.rotation = Quaternion.identity; } }
public void PlaceUnit(GameObject location, UnitType type) { GameObject unitGO = null; switch (type) { case UnitType.Unit: unitGO = unitPool.GetObject(); break; case UnitType.Puller: unitGO = pullerPool.GetObject(); break; case UnitType.Pusher: unitGO = pusherPool.GetObject(); break; case UnitType.Twister: unitGO = twisterPool.GetObject(); break; case UnitType.Portalist: unitGO = portalPlacerPool.GetObject(); break; } if (unitGO) { Unit uScript = unitGO.GetComponent <Unit>(); uScript.owner = gameObject; uScript.SetLocation(location); uScript.remainingMoves = 2; // Set up linked list if (head != null) { DoublyLinkedListNode current = head; while (current.forward != head) { current = current.forward; } DoublyLinkedListNode newNode = new DoublyLinkedListNode(unitGO.GetComponent <Unit>(), current, head); current.forward = newNode; head.prev = newNode; } else { DoublyLinkedListNode newHead = new DoublyLinkedListNode(unitGO.GetComponent <Unit>()); newHead.forward = newHead; newHead.prev = newHead; head = newHead; } if (grid == null) { grid = FindObjectOfType <GridMenu>(); } grid.UpdateDescription(); } else { Debug.Log("Player::PlaceUnit() - Insufficient " + type + " units"); } }