public void BreackFunc() { if (!IsDone) { AddInventory add = new AddInventory(this.gameObject); IsDone = true; breackEvent.Invoke(add); } }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
private async void CommandAdd_Executed(object sender, ExecutedRoutedEventArgs e) { var numbInventory = NumberOfInventories(); var addInventoryWindow = await AddInventory.CreateAsync(); addInventoryWindow.Owner = this; addInventoryWindow.ShowDialog(); if (numbInventory != NumberOfInventories()) { (this.DataContext as MainWindowModel).InventoryList.Clear(); InventoryList.IsEnabled = false; LoadInventories.RunWorkerAsync(NumberOfInventories()); } }
public void AddInventory() { inventory inv = new inventory(); AddInventory addWindow = new AddInventory(); // Sets the window's context and gives it the types available, that aren't deleted addWindow.DataContext = new { inventory = inv, merchandise = dataHandler.GetEntities().merchandise.ToList().FindAll(type => { return(!type.deleted); }) }; addWindow.ShowDialog(); try { dataHandler.AddOrUpdate(inv); } catch (Exception e) { System.Windows.MessageBox.Show("Error: " + e.Message); } NotifyOfPropertyChange("Inventory"); }
public void Modify(inventory inv) { AddInventory addWindow = new AddInventory(); // Sets the window's context and gives it the types available, that aren't deleted addWindow.DataContext = new { inventory = inv, merchandise = dataHandler.GetEntities().merchandise.ToList().FindAll(type => { return(!type.deleted); }) }; if (addWindow.ShowDialog() == true) { try { dataHandler.AddOrUpdate(inv); } catch (Exception e) { System.Windows.MessageBox.Show("Error: " + e.Message); } } else { ((System.Data.Entity.Infrastructure.IObjectContextAdapter)dataHandler.GetEntities()).ObjectContext.Refresh(System.Data.Entity.Core.Objects.RefreshMode.StoreWins, inv); } NotifyOfPropertyChange("Inventory"); }
internal IEnumerable <Inventory> AddInventory(AddInventory @object) { throw new NotImplementedException(); }
private void Start() { zxc = GameObject.Find("TaroScript").GetComponent <AddInventory> (); //Debug.Log (zxc.cooper); }