﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml;

namespace WindowsFormsApp4
{
    public partial class Form1 : Form
    {
        private XmlReader xtr = null;

        public Form1()
        {
            InitializeComponent();
            xtr = XmlReader.Create(@"C:\ucenik\Filmovi.xml");
                        
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            if(xtr.Read()==true)
            {
                txtNode.Text = xtr.NodeType.ToString();
                txtValue.Text = xtr.Value.ToString();
                txtName.Text = xtr.Name.ToString();
            }
            else
            {
                txtName.Text = "EoF";
                txtNode.Text = "EoF";
                txtValue.Text = "EoF";
            }
        }

        private void btnExit_Click(object sender, EventArgs e)
        {
            if (xtr != null) xtr.Close();

            Application.Exit();
        }
    }
}
