<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FValidation</id>
		<title>Csharp/CSharp Tutorial/GUI Windows Forms/Validation - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGUI_Windows_Forms%2FValidation"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Validation&amp;action=history"/>
		<updated>2026-04-30T06:09:30Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Validation&amp;diff=5395&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Validation&amp;diff=5395&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Validation&amp;diff=5396&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/GUI_Windows_Forms/Validation&amp;diff=5396&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:17Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Validate text box value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Linq;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
&lt;br /&gt;
   public class Form1 : Form&lt;br /&gt;
   {&lt;br /&gt;
      public Form1()&lt;br /&gt;
      {&lt;br /&gt;
         InitializeComponent();&lt;br /&gt;
         this.buttonOK.Enabled = false;&lt;br /&gt;
         this.textBoxAddress.Tag = false;&lt;br /&gt;
         this.textBoxAge.Tag = false;&lt;br /&gt;
         this.textBoxName.Tag = false;&lt;br /&gt;
         this.textBoxName.Validating += new CancelEventHandler(textBoxEmpty_Validating);&lt;br /&gt;
         this.textBoxAddress.Validating += new CancelEventHandler(textBoxEmpty_Validating);&lt;br /&gt;
         this.textBoxAge.Validating += new CancelEventHandler(textBoxEmpty_Validating);&lt;br /&gt;
      }&lt;br /&gt;
      void textBoxEmpty_Validating(object sender, CancelEventArgs e)&lt;br /&gt;
      {&lt;br /&gt;
         TextBox tb = (TextBox)sender;&lt;br /&gt;
         if (tb.Text.Length == 0)&lt;br /&gt;
         {&lt;br /&gt;
            tb.BackColor = Color.Red;&lt;br /&gt;
            tb.Tag = false;&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
            tb.BackColor = System.Drawing.SystemColors.Window;&lt;br /&gt;
            tb.Tag = true;&lt;br /&gt;
         }&lt;br /&gt;
         ValidateOK();&lt;br /&gt;
      }&lt;br /&gt;
      private void buttonOK_Click(object sender, EventArgs e)&lt;br /&gt;
      {&lt;br /&gt;
         string output;&lt;br /&gt;
         output = this.textBoxName.Text + &amp;quot;\r\n&amp;quot;;&lt;br /&gt;
         this.textBoxOutput.Text = output;&lt;br /&gt;
      }&lt;br /&gt;
      private void buttonHelp_Click(object sender, EventArgs e)&lt;br /&gt;
      {&lt;br /&gt;
         this.textBoxOutput.Text = &amp;quot;No&amp;quot;;&lt;br /&gt;
      }&lt;br /&gt;
      private void textBoxAge_KeyPress(object sender, KeyPressEventArgs e)&lt;br /&gt;
      {&lt;br /&gt;
         if ((e.KeyChar &amp;lt; 48 || e.KeyChar &amp;gt; 57) &amp;amp;&amp;amp; e.KeyChar != 8)&lt;br /&gt;
            e.Handled = true; &lt;br /&gt;
      }&lt;br /&gt;
      private void textBox_TextChanged(object sender, EventArgs e)&lt;br /&gt;
      {&lt;br /&gt;
         TextBox tb = (TextBox)sender;&lt;br /&gt;
         if (tb.Text.Length == 0)&lt;br /&gt;
         {&lt;br /&gt;
            tb.Tag = false;&lt;br /&gt;
            tb.BackColor = Color.Red;&lt;br /&gt;
         }&lt;br /&gt;
         else&lt;br /&gt;
         {&lt;br /&gt;
            tb.Tag = true;&lt;br /&gt;
            tb.BackColor = SystemColors.Window;&lt;br /&gt;
         }&lt;br /&gt;
         ValidateOK();&lt;br /&gt;
      }&lt;br /&gt;
      private void ValidateOK()&lt;br /&gt;
      {&lt;br /&gt;
         this.buttonOK.Enabled = ((bool)(this.textBoxAddress.Tag) &amp;amp;&amp;amp;&lt;br /&gt;
                                 (bool)(this.textBoxAge.Tag) &amp;amp;&amp;amp;&lt;br /&gt;
                                 (bool)(this.textBoxName.Tag));&lt;br /&gt;
      }&lt;br /&gt;
      private void InitializeComponent()&lt;br /&gt;
      {&lt;br /&gt;
         this.labelName = new System.Windows.Forms.Label();&lt;br /&gt;
         this.textBoxName = new System.Windows.Forms.TextBox();&lt;br /&gt;
         this.buttonOK = new System.Windows.Forms.Button();&lt;br /&gt;
         this.textBoxAddress = new System.Windows.Forms.TextBox();&lt;br /&gt;
         this.labelAddress = new System.Windows.Forms.Label();&lt;br /&gt;
         this.buttonHelp = new System.Windows.Forms.Button();&lt;br /&gt;
         this.labelAge = new System.Windows.Forms.Label();&lt;br /&gt;
         this.textBoxAge = new System.Windows.Forms.TextBox();&lt;br /&gt;
         this.labelOutput = new System.Windows.Forms.Label();&lt;br /&gt;
         this.textBoxOutput = new System.Windows.Forms.TextBox();&lt;br /&gt;
         this.checkBoxProgrammer = new System.Windows.Forms.CheckBox();&lt;br /&gt;
         this.groupBox1 = new System.Windows.Forms.GroupBox();&lt;br /&gt;
         this.radioButtonMale = new System.Windows.Forms.RadioButton();&lt;br /&gt;
         this.radioButtonFemale = new System.Windows.Forms.RadioButton();&lt;br /&gt;
         this.groupBox1.SuspendLayout();&lt;br /&gt;
         this.SuspendLayout();&lt;br /&gt;
         // &lt;br /&gt;
         // labelName&lt;br /&gt;
         // &lt;br /&gt;
         this.labelName.AutoSize = true;&lt;br /&gt;
         this.labelName.Location = new System.Drawing.Point(12, 9);&lt;br /&gt;
         this.labelName.Name = &amp;quot;labelName&amp;quot;;&lt;br /&gt;
         this.labelName.Size = new System.Drawing.Size(35, 13);&lt;br /&gt;
         this.labelName.TabIndex = 0;&lt;br /&gt;
         this.labelName.Text = &amp;quot;Name&amp;quot;;&lt;br /&gt;
         // &lt;br /&gt;
         // textBoxName&lt;br /&gt;
         // &lt;br /&gt;
         this.textBoxName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)&lt;br /&gt;
                     | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
         this.textBoxName.Location = new System.Drawing.Point(98, 6);&lt;br /&gt;
         this.textBoxName.Name = &amp;quot;textBoxName&amp;quot;;&lt;br /&gt;
         this.textBoxName.Size = new System.Drawing.Size(277, 20);&lt;br /&gt;
         this.textBoxName.TabIndex = 1;&lt;br /&gt;
         this.textBoxName.TextChanged += new System.EventHandler(this.textBox_TextChanged);&lt;br /&gt;
         // &lt;br /&gt;
         // buttonOK&lt;br /&gt;
         // &lt;br /&gt;
         this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
         this.buttonOK.Location = new System.Drawing.Point(381, 4);&lt;br /&gt;
         this.buttonOK.Name = &amp;quot;buttonOK&amp;quot;;&lt;br /&gt;
         this.buttonOK.Size = new System.Drawing.Size(75, 23);&lt;br /&gt;
         this.buttonOK.TabIndex = 2;&lt;br /&gt;
         this.buttonOK.Text = &amp;quot;OK&amp;quot;;&lt;br /&gt;
         this.buttonOK.UseVisualStyleBackColor = true;&lt;br /&gt;
         this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);&lt;br /&gt;
         // &lt;br /&gt;
         // textBoxAddress&lt;br /&gt;
         // &lt;br /&gt;
         this.textBoxAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)&lt;br /&gt;
                     | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
         this.textBoxAddress.Location = new System.Drawing.Point(98, 32);&lt;br /&gt;
         this.textBoxAddress.Multiline = true;&lt;br /&gt;
         this.textBoxAddress.Name = &amp;quot;textBoxAddress&amp;quot;;&lt;br /&gt;
         this.textBoxAddress.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;&lt;br /&gt;
         this.textBoxAddress.Size = new System.Drawing.Size(277, 100);&lt;br /&gt;
         this.textBoxAddress.TabIndex = 3;&lt;br /&gt;
         this.textBoxAddress.TextChanged += new System.EventHandler(this.textBox_TextChanged);&lt;br /&gt;
         // &lt;br /&gt;
         // labelAddress&lt;br /&gt;
         // &lt;br /&gt;
         this.labelAddress.AutoSize = true;&lt;br /&gt;
         this.labelAddress.Location = new System.Drawing.Point(12, 35);&lt;br /&gt;
         this.labelAddress.Name = &amp;quot;labelAddress&amp;quot;;&lt;br /&gt;
         this.labelAddress.Size = new System.Drawing.Size(45, 13);&lt;br /&gt;
         this.labelAddress.TabIndex = 4;&lt;br /&gt;
         this.labelAddress.Text = &amp;quot;Address&amp;quot;;&lt;br /&gt;
         // &lt;br /&gt;
         // buttonHelp&lt;br /&gt;
         // &lt;br /&gt;
         this.buttonHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
         this.buttonHelp.CausesValidation = false;&lt;br /&gt;
         this.buttonHelp.Location = new System.Drawing.Point(381, 30);&lt;br /&gt;
         this.buttonHelp.Name = &amp;quot;buttonHelp&amp;quot;;&lt;br /&gt;
         this.buttonHelp.Size = new System.Drawing.Size(75, 23);&lt;br /&gt;
         this.buttonHelp.TabIndex = 5;&lt;br /&gt;
         this.buttonHelp.Text = &amp;quot;Help&amp;quot;;&lt;br /&gt;
         this.buttonHelp.UseVisualStyleBackColor = true;&lt;br /&gt;
         this.buttonHelp.Click += new System.EventHandler(this.buttonHelp_Click);&lt;br /&gt;
         // &lt;br /&gt;
         // labelAge&lt;br /&gt;
         // &lt;br /&gt;
         this.labelAge.AutoSize = true;&lt;br /&gt;
         this.labelAge.Location = new System.Drawing.Point(12, 255);&lt;br /&gt;
         this.labelAge.Name = &amp;quot;labelAge&amp;quot;;&lt;br /&gt;
         this.labelAge.Size = new System.Drawing.Size(26, 13);&lt;br /&gt;
         this.labelAge.TabIndex = 8;&lt;br /&gt;
         this.labelAge.Text = &amp;quot;Age&amp;quot;;&lt;br /&gt;
         // &lt;br /&gt;
         // textBoxAge&lt;br /&gt;
         // &lt;br /&gt;
         this.textBoxAge.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)&lt;br /&gt;
                     | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
         this.textBoxAge.Location = new System.Drawing.Point(98, 252);&lt;br /&gt;
         this.textBoxAge.MaxLength = 3;&lt;br /&gt;
         this.textBoxAge.Name = &amp;quot;textBoxAge&amp;quot;;&lt;br /&gt;
         this.textBoxAge.Size = new System.Drawing.Size(277, 20);&lt;br /&gt;
         this.textBoxAge.TabIndex = 9;&lt;br /&gt;
         this.textBoxAge.TextChanged += new System.EventHandler(this.textBox_TextChanged);&lt;br /&gt;
         this.textBoxAge.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBoxAge_KeyPress);&lt;br /&gt;
         // &lt;br /&gt;
         // labelOutput&lt;br /&gt;
         // &lt;br /&gt;
         this.labelOutput.AutoSize = true;&lt;br /&gt;
         this.labelOutput.Location = new System.Drawing.Point(12, 271);&lt;br /&gt;
         this.labelOutput.Name = &amp;quot;labelOutput&amp;quot;;&lt;br /&gt;
         this.labelOutput.Size = new System.Drawing.Size(39, 13);&lt;br /&gt;
         this.labelOutput.TabIndex = 10;&lt;br /&gt;
         this.labelOutput.Text = &amp;quot;Output&amp;quot;;&lt;br /&gt;
         // &lt;br /&gt;
         // textBoxOutput&lt;br /&gt;
         // &lt;br /&gt;
         this.textBoxOutput.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)&lt;br /&gt;
                     | System.Windows.Forms.AnchorStyles.Left)&lt;br /&gt;
                     | System.Windows.Forms.AnchorStyles.Right)));&lt;br /&gt;
         this.textBoxOutput.Location = new System.Drawing.Point(15, 287);&lt;br /&gt;
         this.textBoxOutput.Multiline = true;&lt;br /&gt;
         this.textBoxOutput.Name = &amp;quot;textBoxOutput&amp;quot;;&lt;br /&gt;
         this.textBoxOutput.ReadOnly = true;&lt;br /&gt;
         this.textBoxOutput.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;&lt;br /&gt;
         this.textBoxOutput.Size = new System.Drawing.Size(360, 168);&lt;br /&gt;
         this.textBoxOutput.TabIndex = 11;&lt;br /&gt;
         // &lt;br /&gt;
         // checkBoxProgrammer&lt;br /&gt;
         // &lt;br /&gt;
         this.checkBoxProgrammer.AutoSize = true;&lt;br /&gt;
         this.checkBoxProgrammer.Checked = true;&lt;br /&gt;
         this.checkBoxProgrammer.CheckState = System.Windows.Forms.CheckState.Checked;&lt;br /&gt;
         this.checkBoxProgrammer.Location = new System.Drawing.Point(15, 138);&lt;br /&gt;
         this.checkBoxProgrammer.Name = &amp;quot;checkBoxProgrammer&amp;quot;;&lt;br /&gt;
         this.checkBoxProgrammer.Size = new System.Drawing.Size(88, 17);&lt;br /&gt;
         this.checkBoxProgrammer.TabIndex = 12;&lt;br /&gt;
         this.checkBoxProgrammer.Text = &amp;quot;Programmer?&amp;quot;;&lt;br /&gt;
         this.checkBoxProgrammer.UseVisualStyleBackColor = true;&lt;br /&gt;
         // &lt;br /&gt;
         // groupBox1&lt;br /&gt;
         // &lt;br /&gt;
         this.groupBox1.Controls.Add(this.radioButtonMale);&lt;br /&gt;
         this.groupBox1.Controls.Add(this.radioButtonFemale);&lt;br /&gt;
         this.groupBox1.Location = new System.Drawing.Point(15, 161);&lt;br /&gt;
         this.groupBox1.Name = &amp;quot;groupBox1&amp;quot;;&lt;br /&gt;
         this.groupBox1.Size = new System.Drawing.Size(360, 85);&lt;br /&gt;
         this.groupBox1.TabIndex = 13;&lt;br /&gt;
         this.groupBox1.TabStop = false;&lt;br /&gt;
         this.groupBox1.Text = &amp;quot;Sex&amp;quot;;&lt;br /&gt;
         // &lt;br /&gt;
         // radioButtonMale&lt;br /&gt;
         // &lt;br /&gt;
         this.radioButtonMale.AutoSize = true;&lt;br /&gt;
         this.radioButtonMale.Checked = true;&lt;br /&gt;
         this.radioButtonMale.Location = new System.Drawing.Point(187, 33);&lt;br /&gt;
         this.radioButtonMale.Name = &amp;quot;radioButtonMale&amp;quot;;&lt;br /&gt;
         this.radioButtonMale.Size = new System.Drawing.Size(48, 17);&lt;br /&gt;
         this.radioButtonMale.TabIndex = 1;&lt;br /&gt;
         this.radioButtonMale.TabStop = true;&lt;br /&gt;
         this.radioButtonMale.Text = &amp;quot;Male&amp;quot;;&lt;br /&gt;
         this.radioButtonMale.UseVisualStyleBackColor = true;&lt;br /&gt;
         // &lt;br /&gt;
         // radioButtonFemale&lt;br /&gt;
         // &lt;br /&gt;
         this.radioButtonFemale.AutoSize = true;&lt;br /&gt;
         this.radioButtonFemale.Location = new System.Drawing.Point(58, 33);&lt;br /&gt;
         this.radioButtonFemale.Name = &amp;quot;radioButtonFemale&amp;quot;;&lt;br /&gt;
         this.radioButtonFemale.Size = new System.Drawing.Size(59, 17);&lt;br /&gt;
         this.radioButtonFemale.TabIndex = 0;&lt;br /&gt;
         this.radioButtonFemale.Text = &amp;quot;Female&amp;quot;;&lt;br /&gt;
         this.radioButtonFemale.UseVisualStyleBackColor = true;&lt;br /&gt;
         // &lt;br /&gt;
         // Form1&lt;br /&gt;
         // &lt;br /&gt;
         this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);&lt;br /&gt;
         this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;&lt;br /&gt;
         this.ClientSize = new System.Drawing.Size(468, 466);&lt;br /&gt;
         this.Controls.Add(this.groupBox1);&lt;br /&gt;
         this.Controls.Add(this.checkBoxProgrammer);&lt;br /&gt;
         this.Controls.Add(this.textBoxOutput);&lt;br /&gt;
         this.Controls.Add(this.labelOutput);&lt;br /&gt;
         this.Controls.Add(this.textBoxAge);&lt;br /&gt;
         this.Controls.Add(this.labelAge);&lt;br /&gt;
         this.Controls.Add(this.buttonHelp);&lt;br /&gt;
         this.Controls.Add(this.labelAddress);&lt;br /&gt;
         this.Controls.Add(this.textBoxAddress);&lt;br /&gt;
         this.Controls.Add(this.buttonOK);&lt;br /&gt;
         this.Controls.Add(this.textBoxName);&lt;br /&gt;
         this.Controls.Add(this.labelName);&lt;br /&gt;
         this.MinimumSize = new System.Drawing.Size(484, 370);&lt;br /&gt;
         this.Name = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
         this.Text = &amp;quot;Form1&amp;quot;;&lt;br /&gt;
         this.groupBox1.ResumeLayout(false);&lt;br /&gt;
         this.groupBox1.PerformLayout();&lt;br /&gt;
         this.ResumeLayout(false);&lt;br /&gt;
         this.PerformLayout();&lt;br /&gt;
      }&lt;br /&gt;
      private System.Windows.Forms.Label labelName;&lt;br /&gt;
      private System.Windows.Forms.TextBox textBoxName;&lt;br /&gt;
      private System.Windows.Forms.Button buttonOK;&lt;br /&gt;
      private System.Windows.Forms.TextBox textBoxAddress;&lt;br /&gt;
      private System.Windows.Forms.Label labelAddress;&lt;br /&gt;
      private System.Windows.Forms.Button buttonHelp;&lt;br /&gt;
      private System.Windows.Forms.Label labelAge;&lt;br /&gt;
      private System.Windows.Forms.TextBox textBoxAge;&lt;br /&gt;
      private System.Windows.Forms.Label labelOutput;&lt;br /&gt;
      private System.Windows.Forms.TextBox textBoxOutput;&lt;br /&gt;
      private System.Windows.Forms.CheckBox checkBoxProgrammer;&lt;br /&gt;
      private System.Windows.Forms.GroupBox groupBox1;&lt;br /&gt;
      private System.Windows.Forms.RadioButton radioButtonFemale;&lt;br /&gt;
      private System.Windows.Forms.RadioButton radioButtonMale;&lt;br /&gt;
      [STAThread]&lt;br /&gt;
      static void Main()&lt;br /&gt;
      {&lt;br /&gt;
         Application.EnableVisualStyles();&lt;br /&gt;
         Application.SetCompatibleTextRenderingDefault(false);&lt;br /&gt;
         Application.Run(new Form1());&lt;br /&gt;
      }&lt;br /&gt;
   }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Validation callback==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
using System.Data;&lt;br /&gt;
using System.Drawing;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.Xml;&lt;br /&gt;
using System.Xml.XPath;&lt;br /&gt;
using System.Xml.Schema;&lt;br /&gt;
public class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static void Main()&lt;br /&gt;
    {&lt;br /&gt;
        XmlDocument doc;&lt;br /&gt;
        XPathNavigator editor2;&lt;br /&gt;
        XmlWriter writer;&lt;br /&gt;
        XmlSchemaSet schemaSet;&lt;br /&gt;
        ValidationEventHandler handler;&lt;br /&gt;
        doc = new XmlDocument();&lt;br /&gt;
        doc.Load(&amp;quot;pubs.xml&amp;quot;);&lt;br /&gt;
        foreach (XPathNavigator editor in doc.CreateNavigator().Select(&amp;quot;/pubs/titles[authors/@au_lname=&amp;quot;Green&amp;quot;]&amp;quot;))&lt;br /&gt;
        {&lt;br /&gt;
            editor2 = editor.SelectSingleNode(&amp;quot;authors[@au_lname!=&amp;quot;Green&amp;quot;]&amp;quot;);&lt;br /&gt;
            if (editor2 != null) editor2.DeleteSelf();&lt;br /&gt;
            writer = editor.AppendChild();&lt;br /&gt;
            writer.WriteStartElement(&amp;quot;authors&amp;quot;);&lt;br /&gt;
            writer.WriteAttributeString(&amp;quot;au_lname&amp;quot;, &amp;quot;MacFeather&amp;quot;);&lt;br /&gt;
            writer.WriteAttributeString(&amp;quot;au_fname&amp;quot;, &amp;quot;Stearns&amp;quot;);&lt;br /&gt;
            writer.Close();&lt;br /&gt;
        }&lt;br /&gt;
        XPathNavigator editor3 = doc.CreateNavigator();&lt;br /&gt;
        schemaSet = new XmlSchemaSet();&lt;br /&gt;
        schemaSet.Add(null, &amp;quot;pubs.xsd&amp;quot;);&lt;br /&gt;
        schemaSet.rupile();&lt;br /&gt;
        handler = new System.Xml.Schema.ValidationEventHandler(ValidationCallback);&lt;br /&gt;
        doc.Save(&amp;quot;output.xml&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    public static void ValidationCallback(object sender, ValidationEventArgs e)&lt;br /&gt;
    {&lt;br /&gt;
        System.Console.WriteLine(e.Message);&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>