Exemplo n.º 1
0
 public void BreackFunc()
 {
     if (!IsDone)
     {
         AddInventory add = new AddInventory(this.gameObject);
         IsDone = true;
         breackEvent.Invoke(add);
     }
 }
Exemplo n.º 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 3
0
        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());
            }
        }
Exemplo n.º 4
0
        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");
        }
Exemplo n.º 5
0
        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");
        }
Exemplo n.º 6
0
 internal IEnumerable <Inventory> AddInventory(AddInventory @object)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 7
0
 private void Start()
 {
     zxc = GameObject.Find("TaroScript").GetComponent <AddInventory> ();
     //Debug.Log (zxc.cooper);
 }