Beispiel #1
0
        void CategoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            SuspendLayout();

            DataView.Nodes.Clear();
            DescriptionBox.Clear();

            switch (CategoryComboBox.SelectedIndex)
            {
            case 0:     // Items
                foreach (IDRange range in Data.ItemIDRanges.Where(range => DataView.Nodes.Find(range.Name, true).Length == 0))
                {
                    DataView.Nodes.Add(range.Name);
                }

                foreach (ItemDef def in Data.ItemDefs)
                {
                    bool found = false;

                    foreach (IDRange range in Data.ItemIDRanges.Where(range => def.ID >= range.StartID && def.ID <= range.EndID))
                    {
                        DataView.Nodes.Cast <TreeNode>().First(n => n.Text == range.Name).Nodes.Add($"{def.ID} - {def.Name}").Tag = def;

                        found = true;

                        break;
                    }

                    if (!found)
                    {
                        DataView.Nodes.Add($"{def.ID} - {def.Name}").Tag = def;
                    }
                }

                break;

            case 1:     // Parameters
                foreach (ParameterDef def in Data.ParamDefs)
                {
                    DataView.Nodes.Add($"{def.ID} - {def.Name}").Tag = def;
                }

                break;

            case 2:     // Traits
                foreach (string category in Data.TraitCategories)
                {
                    DataView.Nodes.Add(category);
                }

                foreach (TraitDef def in Data.TraitDefs)
                {
                    DataView.Nodes.Cast <TreeNode>().First(n => n.Text == def.Category).Nodes.Add($"{def.ID} - {def.Name}").Tag = def;
                }

                break;
            }

            ResumeLayout();
        }
        private void AddButton_Click(object sender, EventArgs e)
        {
            string name        = NameBox.Text;
            string description = DescriptionBox.Text;
            string profession;
            int    lvl;

            int.TryParse(LevelBox.Text, out lvl);

            if (ClassCombo.SelectedItem == null)
            {
                profession = "Warrior";
            }
            else
            {
                profession = ClassCombo.SelectedItem.ToString();
            }

            Character New_Character = new Character(name, lvl, description, profession);

            CharactersList.Add(New_Character);
            ComboBind.ResetBindings(false);

            NameBox.Clear();
            LevelBox.Clear();
            DescriptionBox.Clear();
            ClassCombo.ResetText();
        }
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            CharactersList.RemoveAt(CharactersCombo.SelectedIndex);
            ComboBind.ResetBindings(false);

            NameBox.Clear();
            LevelBox.Clear();
            DescriptionBox.Clear();
            ClassCombo.ResetText();
        }
        private void Reset()
        {
            panelAnimation.Controls.Clear();
            variableDataGridView.Rows.Clear();
            codeDesription.Clear();
            DescriptionBox.Clear();
            btnPrevious.Enabled = false;
            btnNext.Enabled     = true;

            ctrl.newList(textList.Text);
        }
 private void ClearAll()
 {
     ModelNameBox.Clear();
     RegNumberBox.Clear();
     OdometerBox.Clear();
     PropBlock.Clear();
     DescriptionBox.Clear();
     TypeOfProblemList.Items.Clear();
     VehicleComboBox.Items.Clear();
     FuelComboBox.Items.Clear();
     cbTypeOfCar.Items.Clear();
     TowBarNo.IsChecked  = false;
     TowBarYes.IsChecked = false;
 }
Beispiel #6
0
        private void DeleteButton_Click(object sender, EventArgs e)
        {
            ItemsList.RemoveAt(ItemsListBox.SelectedIndex);
            ListBind.DataSource = null;
            ListBind.DataSource = ItemsList;

            NameBox.Clear();
            TypeBox.Clear();
            DescriptionBox.Clear();
            MightBox.Clear();
            DefenceBox.Clear();
            WeightBox.Clear();
            ItemWeightBox.Clear();
            PropertiesBox.Clear();

            foreach (int i in RequirementsCheckedListBox.CheckedIndices)
            {
                RequirementsCheckedListBox.SetItemChecked(i, false);
            }
        }
Beispiel #7
0
        internal void EditDescription()
        {
            //Populate the excel data
            GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ExcelPath, "Profile");
            // Refresh the page
            GlobalDefinitions.driver.Navigate().Refresh();

            //Click on edit Description
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/div/div/div/h3/span/i", 10000);
            DescriptionEdit.Click();

            //Click on Description Text and clear the details
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/div/div/form/div/div/div[2]/div[1]/textarea", 10000);
            Thread.Sleep(1000);
            DescriptionBox.Clear();
            DescriptionBox.SendKeys(GlobalDefinitions.ExcelLib.ReadData(3, "Description"));

            //Click on Save button
            GlobalDefinitions.WaitForElementVisibility(GlobalDefinitions.driver, "XPath", "//*[@id='account-profile-section']/div/section[2]/div/div/div/div[3]/div/div/form/div/div/div[2]/button", 10000);
            SaveDescription.Click();
            Base.test.Log(LogStatus.Info, "Description Edited Successfully");
        }
 private void ClearInfo()
 {
     TypeComboBox.Text = "";
     StepsGird.ItemsSource = null;
     DescriptionBox.Clear();
 }
 private void ClearInfo()
 {
     PriorityTextBox.Clear();
     DescriptionBox.Clear();
 }
Beispiel #10
0
 private void ClearInfo()
 {
     PriorityTextBox.Clear();
     ProcedureComboBox.Text = "";
     DescriptionBox.Clear();
 }
Beispiel #11
0
        private void AddButton_Click(object sender, EventArgs e)
        {
            string        name, type, description;
            int           weight, might, defence, carryweight;
            List <string> requirements = new List <string>();
            List <string> properties;
            List <Tuple <string, int> > bonus = new List <Tuple <string, int> >();

            if (NameBox.Text == "")
            {
                MessageBox.Show("Puste pole na imię!");
                return;
            }
            else
            {
                name = NameBox.Text;
            }

            if (TypeBox.Text == "")
            {
                MessageBox.Show("Puste pole określające typ przedmiotu!");
                return;
            }
            else
            {
                type = TypeBox.Text;
            }

            if (DescriptionBox.Text == "")
            {
                MessageBox.Show("Puste pole opisu!");
                return;
            }
            else
            {
                description = DescriptionBox.Text;
            }

            int.TryParse(ItemWeightBox.Text, out weight);
            if (weight == 0)
            {
                MessageBox.Show("Błąd w polu określającym wagę przedmiotu!");
                return;
            }

            bool might_result       = int.TryParse(MightBox.Text, out might);
            bool defence_result     = int.TryParse(DefenceBox.Text, out defence);
            bool carryweight_result = int.TryParse(WeightBox.Text, out carryweight);

            if (!might_result || !defence_result || !carryweight_result)
            {
                MessageBox.Show("Błąd w polach określających bonusy!");
                return;
            }
            else
            {
                Tuple <string, int> MightTuple       = new Tuple <string, int>("Might", might);
                Tuple <string, int> DefenceTuple     = new Tuple <string, int>("Defence", defence);
                Tuple <string, int> CarryWeightTuple = new Tuple <string, int>("CarryWeight", carryweight);
                bonus.Add(MightTuple);
                bonus.Add(DefenceTuple);
                bonus.Add(CarryWeightTuple);
            }

            if (RequirementsCheckedListBox.CheckedItems.Count == 0)
            {
                requirements.Add("Any");
            }
            else
            {
                foreach (object item in RequirementsCheckedListBox.CheckedItems)
                {
                    requirements.Add(item.ToString());
                }
            }

            properties = new List <string>(PropertiesBox.Lines);

            Item New_Item = new Item(name, type, description, requirements, bonus, properties, weight);

            ItemsList.Add(New_Item);
            ListBind.DataSource = null;
            ListBind.DataSource = ItemsList;

            NameBox.Clear();
            TypeBox.Clear();
            DescriptionBox.Clear();
            MightBox.Clear();
            DefenceBox.Clear();
            WeightBox.Clear();
            ItemWeightBox.Clear();
            PropertiesBox.Clear();

            foreach (int i in RequirementsCheckedListBox.CheckedIndices)
            {
                RequirementsCheckedListBox.SetItemChecked(i, false);
            }
        }