exportEventsXML() public method

public exportEventsXML ( String path ) : void
path String
return void
コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            String inputPath =
                //@"..\..\..\..\Data\Aristotle.txt";
                //@"D:\downNew\wiki\enwiki-latest-pages-articles1.xml-p000000010p000010000";
                //@"D:\downNew\wiki\enwiki-latest-pages-articles1.xml-p000000010p000010000";
                //		@"..\..\..\..\Data\sample_input_enwiki-latest-pages-articles1.xml";
                //@"D:\downNew\wiki\enwiki-latest-pages-articles6.xml";
                @"D:\downNew\wiki\enwiki-latest-pages-articles3.xml-p000025001p000055000";
            //@"D:\downNew\wiki\enwiki-latest-pages-articles10.xml-p000925001p001325000";//1gb
            //@"D:\downNew\wiki\enwiki-latest-pages-articles22.xml-p015725013p018225000"; //privelky
            String exportPath = @"..\..\..\..\Data\sample_output_enwiki-latest-pages-articles1_Real_output.xml";

            //Thread backgroundThread = new Thread(
            //	new ThreadStart(() =>
            //	{
            //		for (int n = 0; n < 1000; n++)
            //		{
            //			if (control.pagesCount != 0)
            //			{
            //				Thread.Sleep(50);
            //				pagesProgresBar.Value = control.pageCounter / control.pagesCount;
            //				pagesCountTextBox.Text = control.pagesCount.ToString();
            //				eventsCountTextBox.Text = control.eventsCount.ToString();
            //			}

            //		}

            //		MessageBox.Show("Thread completed!");
            //		pagesProgresBar. Value = 100;
            //	}
            //));


            //backgroundThread.Start();

            control.initParsing(inputPath);
            control.exportEventsXML(exportPath);
            List <long> days = control.getAllDays();

            foreach (long day in days)
            {
                DropDownMenuDate.Items.Add(day);
            }
            List <String> distinctEvents = control.getDistinctEventTypes();

            foreach (String dEvent in distinctEvents)
            {
                TextConsole.Text += dEvent + '\n';
            }

            pagesCountTextBox.Text  = control.pagesCount.ToString();
            eventsCountTextBox.Text = control.eventsCount.ToString();

            statistics.Text = control.getEventStatistics();
        }
コード例 #2
0
ファイル: CalendarEventTest.cs プロジェクト: irfiit/wikipedia
		public void exportXML_test()
		{

			XElement expected = XElement.Load(@"..\..\..\..\Data\sample_output_enwiki-latest-pages-articles1_Test_example.xml");
			Console.WriteLine(expected.ToString());

			String inputPath =	@"..\..\..\..\Data\sample_input_enwiki-latest-pages-articles1.xml";
			String exportPath = @"..\..\..\..\Data\sample_output_enwiki-latest-pages-articles1_unit_test.xml";
			
			MyXMLParser control = new MyXMLParser();
			control.initParsing(inputPath);
			control.exportEventsXML(exportPath);

			Console.WriteLine(control.getXmlString());
			Assert.AreEqual(expected.ToString(), control.getXmlString());
			//XElement actual = testClass.exportXML();
		}