Exemplo n.º 1
0
        public static SlotView Create(Slot data, GameObject parent, InventoryView inventoryView)
        {
            GameObject toReturnGO = Instantiate(prefab);

            toReturnGO.transform.SetParent(parent.transform, false);
            SlotView toReturn = toReturnGO.GetComponent <SlotView>();

            toReturn.data          = data;
            toReturn.inventoryView = inventoryView;
            return(toReturn);
        }
Exemplo n.º 2
0
        ////////////////////////////////////////////////////////////////////////////////////////// Delete Item
        // Name: deleteToolStripMenuItem_Click
        // Arguments : object sender, EventArgs e
        //
        // Description :
        // when clicked this method calls the Delete method of the active child form
        //
        //////////////////////////////////////////////////////////////////////////////////////////
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InventoryView activeStore = (InventoryView)this.ActiveMdiChild;

            if (activeStore != null)
            {
                activeStore.Delete();
            }
            else
            {
                MessageBox.Show("Please Open or Create a Business", "Error");
            }
        }
Exemplo n.º 3
0
        ////////////////////////////////////////////////////////////////////////////////////////// Open
        // Name: Open
        // Arguments :
        //
        // Description :
        // when theis called it creates a new child form object then sets
        // this form as the parent, then shows the file. It will call either import from text file,
        // import from serialized file, or NewCOmpany then fill in company information then resets
        // MethodofOpen string
        //
        //////////////////////////////////////////////////////////////////////////////////////////
        private void Open()
        {
            InventoryView child = new InventoryView();

            //set this form as the child's parent
            child.MdiParent = this;
            //display the child
            child.Show();
            if (MethodOfOpen == "New")
            {
                child.NewCompany();
            }
            else if (MethodOfOpen == "Serialized")
            {
                child.ImportFromSerializedFile();
            }
            else if (MethodOfOpen == "Plain")
            {
                child.ImportFromFile();
            }
            //call the child's fillCompanyDetails method
            child.FillCompanyDetails();
            MethodOfOpen = "";
        }
Exemplo n.º 4
0
        ////////////////////////////////////////////////////////////////////////////////////////// Save Serialized Click
        // Name: saveSerializedToolStripMenuItem_Click
        // Arguments : object sender, EventArgs e
        //
        // Description :
        // when clicked this method calls the SaveTexterialized method of the active child form
        //
        //////////////////////////////////////////////////////////////////////////////////////////
        private void saveSerializedToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InventoryView activeStore = (InventoryView)this.ActiveMdiChild;

            activeStore.SaveTexterialized();
        }
Exemplo n.º 5
0
 internal void RegisterView(InventoryView inventoryView)
 {
     views.Add(inventoryView);
 }
Exemplo n.º 6
0
 internal void UnRegisterView(InventoryView inventoryView)
 {
     views.Remove(inventoryView);
 }