Пример #1
0
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = this;

            ParseDataXML.AddSchemaValidation(@"..\..\XMLWiki.xsd", XmlReaderSettings_ValidationEventHandler);
        }
Пример #2
0
        private async Task <Person> LoadRandomPersonAsync()
        {
            Person result = null;
            string responseXML;

            while (result == null)
            {
                responseXML = await WikiConnection.LoadRandomData();

                if (responseXML != null)
                {
                    using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(responseXML)))
                    {
                        result = ParseDataXML.Parse(stream);
                    }
                }
            }

            return(result);
        }