private void btnAddNewItem_Click(object sender, EventArgs e)
        {
            // Add new item to doc.
            LinqToXmlObjectModel.InsertNewElement(txtMake.Text, txtColor.Text, txtPetName.Text);

            // Display current XML inventory document in TextBox control.
            txtInventory.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
        }
Exemple #2
0
        private void BtnAddNewItem_Click(object sender, EventArgs e)
        {
            //  为文档添加一个新项
            LinqToXmlObjectModel.InsertNewElement(txtMake.Text, txtColor.Text, txtPetName.Text);

            //  在TextBox控件中显示当前库存的XML文档
            txtInventory.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
        }
Exemple #3
0
 private void addButton_Click(object sender, EventArgs e)
 {
     LinqToXmlObjectModel.InsertNewElement(new CarEntity() // Добавить новый элемент к документу
     {
         Make    = makeTextBox.Text,
         Color   = colorTextBox.Text,
         PetName = petNameTextBox.Text
     });
     inventoryTextBox.Text = LinqToXmlObjectModel.GetXmlInventory().ToString(); // Отобразить текущий
 }
Exemple #4
0
        private void lookUpColorsButton_Click(object sender, EventArgs e)
        {
            List <string> foundColors = LinqToXmlObjectModel.LookUpColorsForMake(makeToLookUpTextBox.Text);
            StringBuilder founded     = new StringBuilder();

            foreach (string foundColor in foundColors)
            {
                founded.Append(foundColor).Append(Environment.NewLine);
            }
            MessageBox.Show(founded.ToString());
        }
Exemple #5
0
 private void BtnLookUpColors_Click(object sender, EventArgs e)
 {
     LinqToXmlObjectModel.LookUpColorsForMake(txtMakeToLookUp.Text);
 }
Exemple #6
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     //  在TextBox控件中显示当前库存的XML文档
     txtInventory.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
 }
Exemple #7
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     inventoryTextBox.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
 }
 private void MainForm_Load(object sender, EventArgs e)
 {
     // Display current XML inventory document in TextBox control.
     txtInventory.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
 }
Exemple #9
0
 private void btnAddNewItem_Click(object sender, EventArgs e)
 {
     LinqToXmlObjectModel.InsertNewElement(txtMake.Text, txtColor.Text, txtPetName.Text);
     txtInventory.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
 }
 /// <summary>
 /// When the form loads, display the Inventory.xml file
 /// Note use of static methods in LinqToXmlObjectModel class
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LinqToXmlWinAppMainForm_Load(object sender, EventArgs e)
 {
     // Display current XML inventory document in TextBox control.
     // Inventory is from Inventory.xml file
     textBoxDisplayInventory.Text = LinqToXmlObjectModel.GetXmlInventory().ToString();
 }