j'ai des problems avec InitializeComponent(); dans ce code
jene voit pas c quoi aidez moi svp
XmlReaderTest.cs
// Reading an XML document.
using System;
using System.Windows.Forms;
using System.Xml;
public class XmlReaderTest : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox outputTextBox;
private System.ComponentModel.Container components = null;
public XmlReaderTest()
{
InitializeComponent();
// 17 reference to "XML document"
XmlDocument document = new XmlDocument();
document.Load( "..\\..\\article.xml" );
//21 create XmlNodeReader for document
XmlNodeReader reader = new XmlNodeReader( document );
//24 show form before outputTextBox is populated
/*25*/ this.Show();
//27 tree depth is -1, no indentation
/*28*/ int depth = -1;
//30 display each node's content
/*31*/ while ( reader.Read() )
{
/*33*/ switch ( reader.NodeType )
{
//35 if Element, display its name
/*36*/ case XmlNodeType.Element:
//38 increase tab depth
/*39*/ depth++;
/*40*/ TabOutput( depth );
/*41*/ outputTextBox.Text += "<" + reader.Name + ">" + "\r\n";
// if empty element, decrease depth
/*45*/ if ( reader.IsEmptyElement )
/*46*/ depth--;
/*48*/ break;
// 50 if Comment, display it
/*51*/ case XmlNodeType.Comment:
/*52*/ TabOutput( depth );
/*53*/ outputTextBox.Text += "<!--" + reader.Value + "-->\r\n";
/*55*/ break;
//57 if Text, display it
/*58*/ case XmlNodeType.Text:
/*59*/ TabOutput( depth );
/*60*/ outputTextBox.Text += "\t" + reader.Value + "\r\n";
/*62*/ break;
//64 if XML declaration, display it
/*65*/ case XmlNodeType.XmlDeclaration:
/*66*/ TabOutput( depth );
/*67*/ outputTextBox.Text += "<?" + reader.Name + " " + reader.Value + " ?>\r\n";
/*69*/ break;
// 71 if EndElement, display it and decrement depth
/*72*/ case XmlNodeType.EndElement:
/*73*/ TabOutput( depth );
/*74*/ outputTextBox.Text += "</" + reader.Name + ">\r\n";
/*76*/ depth--;
/*77*/ break;
} //78 end switch statement
} //79 end while loop
} //80 End XmlReaderTest constructor
// 82 insert tabs
private void TabOutput( int number )
{
for ( int i = 0; i < number; i++ )
/*86*/ outputTextBox.Text += "\t";
} // 87 end TabOutput
// 89 Windows Form Designer generated code
[STAThread]
static void Main()
{
Application.Run( new XmlReaderTest() );
} // 95 end Main
} // 96 end XmlReaderTest