Exemplo n.º 1
0
        private void addTodoNotListToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                string name = listView_inventory.Items[listView_inventory.SelectedIndices[0]].SubItems[0].Text;
                uint   id   = Util.GetItemID(name);

                Globals.DoNotItemLock.EnterWriteLock();
                try
                {
                    if (!BotOptions.DoNotItems.Contains(id))
                    {
                        BotOptions.DoNotItems.Add(id); //Item ID
                        Add_Text(name + " added to Do Not List", Globals.Green, TextType.BOT);
                    }
                    else
                    {
                        Add_Text(name + " is already in Do Not List", Globals.Green, TextType.BOT);
                    }
                }
                finally
                {
                    Globals.DoNotItemLock.ExitWriteLock();
                }
            }
            catch
            {
                //Do nothing
            }
        }
Exemplo n.º 2
0
        private void addToDoNotListToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                string name = listView_items_data.Items[listView_items_data.SelectedIndices[0]].SubItems[0].Text;
                uint   id   = Util.GetItemID(name);

                Globals.DoNotItemLock.EnterWriteLock();
                try
                {
                    BotOptions.DoNotItems.Add(id); //Item ID
                }
                finally
                {
                    Globals.DoNotItemLock.ExitWriteLock();
                }
                Add_Text(name + " added to Do Not List", Globals.Green, TextType.BOT);
            }
            catch
            {
                //Do nothing
            }
        }