Example #1
0
    public void buyDeskBed()
    {
        MyFurnitrue.stuffLv[1]  = 1;
        MyFurnitrue.stuffLv[2]  = 1;
        User.money             -= 30000;
        Story.tutorialseqeuence = 6;
        List <Furnitrue> myfurnitrue = MyItems.LoadFurnitrueXML();

        for (int i = 1; i < myfurnitrue.Count; i++)
        {
            if (MyFurnitrue.stuffLv[i] == 0)
            {
                GameObject.Find("Canvas/Panels").transform.GetChild(6).GetChild(1).GetChild(0).GetChild(0).GetChild(i).GetChild(5).gameObject.SetActive(true);
                if (GameObject.Find("Furniture/" + myfurnitrue[i].id) != null)
                {
                    GameObject.Find("Furniture/" + myfurnitrue[i].id).gameObject.SetActive(false);
                }
            }
            else
            {
                if (GameObject.Find("Furniture/" + myfurnitrue[i].id) != null)
                {
                    GameObject.Find("Furniture/" + myfurnitrue[i].id).gameObject.SetActive(true);
                }
                GameObject.Find("Canvas/Panels").transform.GetChild(6).GetChild(1).GetChild(0).GetChild(0).GetChild(i).GetChild(5).gameObject.SetActive(false);
            }
        }
        GameObject.Find("House" + User.house + "/Furniture/Bed").gameObject.SetActive(true);
        GameObject.Find("House" + User.house + "/Furniture/Desk").gameObject.SetActive(true);
    }
        public void SpreekwoordFromSearchGridClick(Spreekwoord spreekwoord)
        {
            if (!spreekwoord.IsInList)
            {
                foreach (Spreekwoord sw in MyItems)
                {
                    if (sw.ID == spreekwoord.ID)
                    {
                        return;
                    }
                }

                MyItems.Add(spreekwoord);
                spreekwoord.Notify();
            }
            else
            {
                MyItems.Remove(spreekwoord);
                spreekwoord.Notify();

                foreach (Spreekwoord sw in MyItems)
                {
                    if (sw.ID == spreekwoord.ID)
                    {
                        MyItems.Remove(sw);
                        return;
                    }
                }
            }

            Notify();
        }
Example #3
0
        public Form6(MyItems CurentItem)
        {
            InitializeComponent();
            this.textBox1.Text = CurentItem.IPath;
            this.textBox2.Text = CurentItem.IName;
            if (CurentItem.IIsPhoto == "true")
            {
                this.textBox3.Text = "Foto";
            }
            else
            {
                this.textBox3.Text = " Video";
            }
            this.textBox4.Text = CurentItem.IDate;
            this.textBox6.Text = CurentItem.IType;
            ItemsServiceClient service = new ItemsServiceClient();
            var PlaceItem = service.getPlaceByItem(CurentItem.IPath);
            var EventItem = service.getEventByItem(CurentItem.IPath);

            if (EventItem != null)
            {
                this.textBox7.Text = EventItem.EName;
            }
            if (PlaceItem != null)
            {
                this.textBox5.Text = PlaceItem.PName;
            }
            this.richTextBox1.Text = CurentItem.IDescription;
        }
Example #4
0
        private void button7_Click(object sender, EventArgs e)
        {
            MyItems item     = (MyItems)this.dataGridView1.CurrentRow.DataBoundItem;
            Form3   NewSlide = new Form3(item.IPath);

            NewSlide.ShowDialog();
        }
        void ExecuteLoadMyItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                MyItems.Clear();
                string list = Settings.myAgendaList;
                var    list_deserialized = JsonConvert.DeserializeObject <List <Item> >(list);
                var    items             = MyItems;
                foreach (var item in list_deserialized)  //Originally foreach (var item in items)
                {
                    MyItems.Add(item);
                }

                var savedAgenda_srl = JsonConvert.SerializeObject(SavedAgenda);
                Settings.myAgendaList = savedAgenda_srl;
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #6
0
        private void button8_Click(object sender, EventArgs e)
        {
            MyItems delete = (MyItems)this.dataGridView1.CurrentRow.DataBoundItem;

            Service.MarkToDelete(delete.IPath);
            this.dataGridView1.DataSource = Service.GetItems();
        }
Example #7
0
 /// <summary>
 /// Removes the item from the slot
 /// </summary>
 /// <param name="item"></param>
 public void RemoveItem(Item item)
 {
     if (!IsEmpty)
     {
         InventoryScript.MyInstance.OnItemCountChanged(MyItems.Pop());
     }
 }
Example #8
0
    /// <summary>
    /// Swaps two items in the inventory
    /// </summary>
    /// <param name="from"></param>
    /// <returns></returns>
    private bool SwapItems(SlotScript from)
    {
        from.MyCover.enabled = false;
        if (IsEmpty)
        {
            return(false);
        }
        if (from.MyItem.GetType() != MyItem.GetType() || from.MyCount + MyCount > MyItem.MyStackSize)
        {
            //Copy all the items we need to swap from A
            ObservableStack <Item> tmpFrom = new ObservableStack <Item>(from.MyItems);

            //Clear Slot a
            from.MyItems.Clear();
            //All items from slot b and copy them into A
            from.AddItems(MyItems);

            //Clear B
            MyItems.Clear();
            //Move the items from ACopy to B
            AddItems(tmpFrom);

            return(true);
        }

        return(false);
    }
Example #9
0
    public void Buy()
    {
        List <Furnitrue> fList = MyItems.LoadFurnitrueXML();

        furnitruename = GameObject.Find("Canvas/Panels/PanelQuestion").transform.GetChild(2).name;
        for (int i = 0; i < fList.Count; i++)
        {
            if (fList[i].name == furnitruename && GameObject.Find("House" + User.house + "/Furniture/" + fList[i].id) != null)
            {
                if (fList[i].price > User.money)
                {
                    break;
                }
                GameObject.Find("House" + User.house + "/Furniture/" + fList[i].id).gameObject.SetActive(true);
                GameObject.Find("Canvas/Panels").transform.GetChild(6).GetChild(1).GetChild(0).GetChild(0).GetChild(i).GetChild(5).gameObject.SetActive(false);
                GameObject.Find("Canvas/Panels").transform.GetChild(6).GetChild(1).GetChild(0).GetChild(0).GetChild(i).GetChild(0).GetChild(0).GetComponent <Text>().text = fList[i].name + " Lv 1";
                User.money            -= fList[i].price;
                MyFurnitrue.stuffLv[i] = 1;
                MyFurnitrue.SaveDate();
                GameObject.Find("Canvas/Panels/PanelQuestion").gameObject.SetActive(false);
                break;
            }
            else
            {
                Debug.Log(fList[i].id);
            }
        }
    }
        public void OnNavigatedTo(NavigationParameters parameters)
        {
            MyItems.Clear();

            Random rm = new Random();

            for (int i = 0; i < 20; i++)
            {
                var fooItem = new MyItem
                {
                };
                fooItem.Number = rm.Next(0, 100);
                var fooM3 = fooItem.Number % 3;
                if (fooM3 == 0)
                {
                    fooItem.ShowImage = false;
                    fooItem.ImageUrl  = "http://www.isgoodstuff.com/wp-content/uploads/2016/06/xamarin-logo.jpg";
                    fooItem.BoxColor  = Color.Red;
                }
                else if (fooM3 == 1)
                {
                    fooItem.ShowImage = true;
                    fooItem.ImageUrl  = "http://3bo61w2s39sh2nxd9917cfju.wpengine.netdna-cdn.com/wp-content/uploads/2015/12/Prism-Logo-Graphic-900x400.jpg";
                    fooItem.BoxColor  = Color.PowderBlue;
                }
                else
                {
                    fooItem.ShowImage = true;
                    fooItem.ImageUrl  = "http://www.isgoodstuff.com/wp-content/uploads/2016/06/xamarin-logo.jpg";
                    fooItem.BoxColor  = Color.DarkSalmon;
                }
                MyItems.Add(fooItem);
            }
        }
Example #11
0
 public void Clear()
 {
     if (items.Count > 0)
     {
         InventoryScript.MyInstance.OnItemCountChanged(MyItems.Pop());
         items.Clear();
     }
 }
Example #12
0
 public bool AddItem(Item item)
 {
     MyItems.Push(item);
     icon.sprite       = item.MyIcon;
     icon.color        = Color.white;
     item.MySlotScript = this;
     return(true);
 }
 void fadeOutStoryBoard_Completed(object sender, EventArgs e)
 {
     if (this._itemToDelete != null)
     {
         MyItems myItems = Resources["myItems"] as MyItems;
         myItems.Remove(this._itemToDelete);
     }
 }
Example #14
0
 /// <summary>
 /// Adds an item to the slot
 /// </summary>
 /// <param name="item">the item to add</param>
 /// <returns>returns true if the item was added</returns>
 public bool AddItem(Item item)
 {
     MyItems.Push(item);
     icon.sprite     = item.MyIcon;
     icon.color      = Color.white;
     MyCover.enabled = false;
     item.MySlot     = this;
     return(true);
 }
        // public because of dynamic call
        public void SaveEverything()
        {
            var items = MyItems.ToList();

            foreach (var item in items)
            {
                item.SaveToDB();
            }
        }
Example #16
0
 /// <summary>
 /// Adds an item to the slot
 /// </summary>
 /// <param name="item">the item to add</param>
 /// <returns>returns true if the item was added</returns>
 public bool AddItem(Item item)
 {
     MyItems.Push(item);
     icon.sprite     = item.MyIcon;
     icon.color      = InventoryScript.MyInstance.colorItems;
     MyCover.enabled = false;
     item.MySlot     = this;
     return(true);
 }
Example #17
0
        private void button3_Click(object sender, EventArgs e)
        {
            MyItems move = new MyItems();

            move = (MyItems)this.dataGridView1.CurrentRow.DataBoundItem;
            Form5 NewSlide = new Form5(move.IPath);

            NewSlide.ShowDialog();
        }
Example #18
0
        private void button2_Click(object sender, EventArgs e)
        {
            MyItems delete = (MyItems)this.dataGridView1.CurrentRow.DataBoundItem;

            if (delete.IMark == "true")
            {
                Service.Remove(delete);
            }
            this.dataGridView1.DataSource = Service.GetItems();
        }
Example #19
0
 public bool StackItem(Item item)
 {
     if (!IsEmpty && item.name == MyItem.name && MyItems.Count < MyItem.MyStackSize)
     {
         MyItems.Push(item);
         item.MySlot = this;
         return(true);
     }
     return(false);
 }
 public BadgesIdeaViewModel()
 {
     for (int i = 0; i < 10; i++)
     {
         MyItems.Add(new BadgedItem
         {
             Title      = $"Item {i}",
             BadgeCount = i
         });
     }
 }
        public object MyList(int id)
        {
            try
            {
                return(new { Success = true, MyList = MyItems.GetMyItems(_config.Value.FileSaveLocation, id) });
            }
            catch
            {
            }

            return(new { Success = false });
        }
Example #22
0
    public void Clear()
    {
        int initCount = MyItems.Count;

        if (initCount > 0)
        {
            for (int i = 0; i < initCount; i++)
            {
                InventoryScript.MyInstance.OnItemCountChanged(MyItems.Pop());
            }
        }
    }
        public object SaveItems(int id, string item_one, string item_two)
        {
            try
            {
                GraphData graph = new GraphData();

                return(new { Success = MyItems.SaveItem(_config.Value.FileSaveLocation, id, item_one, item_two) });
            }
            catch (Exception excp)
            {
                return(new { Success = false, Error = excp.Message });
            }
        }
Example #24
0
        public virtual void RemoveItem(NamedTradeline item)
        {
            if (item == null)
            {
                return;
            }
            var matchFromCollection = MyItems.FirstOrDefault(i => i.Equals(item) || ReferenceEquals(i, item));

            if (matchFromCollection == null)
            {
                return;
            }
            MyItems.Remove(matchFromCollection);
        }
 public MainViewModel()
 {
     for (int i = 0; i < 3; i++)
     {
         ObservableCollection <Task> Source = new ObservableCollection <Task>();
         for (int j = 0; j < 5; j++)
         {
             Source.Add(new Task {
                 ID = i, Name = "Name_" + i, Duration = (i + 2) * 6 + (3 * j)
             });
         }
         MyItems.Add(new TfsTask {
             ID = i, Items = Source
         });
     }
 }
Example #26
0
 public MainWindow()
 {
     InitializeComponent();
     MyItems.Add(new MyObject {
         Name = "Test1"
     });
     MyItems.Add(new MyObject {
         Name = "Test2"
     });
     MyItems.Add(new MyObject {
         Name = "Test3"
     });
     MyItems.Add(new MyObject {
         Name = "Test4"
     });
 }
    private void Add(StringItem current)
    {
        var item = new StringItem {
            MyText = "new item " + (MyItems.Count + 1)
        };
        int idx = MyItems.IndexOf(current);

        if (idx < 0)
        {
            MyItems.Add(item);
        }
        else
        {
            MyItems.Insert(idx + 1, item);
        }
    }
Example #28
0
 private void SetList0()
 {
     MyItems.Clear();
     MyItems.Add(new Item {
         Text = "Sing"
     });
     MyItems.Add(new Item {
         Text = "Listen to music"
     });
     MyItems.Add(new Item {
         Text = "Listen to music"
     });
     MyItems.Add(new Item {
         Text = "Listen to music"
     });
 }
        public object SaveItems(int id, string item_one, string item_two)
        {
            try
            {
                GraphData graph = new GraphData();

                var userPath = Electron.App.GetPathAsync(PathName.AppData);
                userPath.Wait();

                return(new { Success = MyItems.SaveItem(Path.Combine(userPath.Result, "bobelectron"), id, item_one, item_two) });
            }
            catch (Exception excp)
            {
                return(new { Success = false, Error = excp.Message });
            }
        }
Example #30
0
        public void Load()
        {
            if (File.Exists("Randomizer.dat"))
            {
                var items  = new List <RandomizerItem>();
                var xml    = new XmlSerializer(typeof(List <RandomizerItem>));
                var stream = File.Open("Randomizer.dat", FileMode.Open, FileAccess.Read);

                using (TextReader tr = new StreamReader(stream))
                {
                    items = (List <RandomizerItem>)xml.Deserialize(tr);
                }

                stream.Close();

                foreach (var item in items)
                {
                    var it = NewItem();
                    it.Item   = item;
                    it.Header = item.ItemName;

                    if (item.ParentID != Guid.Empty)
                    {
                        bool FoundParent = false;
                        foreach (var itema in _ItemAccess)
                        {
                            if (itema.Item.ChildID == item.ParentID)
                            {
                                itema.Items.Add(it);
                                FoundParent = true;
                                break;
                            }
                        }

                        if (!FoundParent)
                        {
                            Items.Remove(it);
                        }
                    }
                    else
                    {
                        MyItems.Add(it);
                    }
                }
            }
        }